What is Quantization?
Quantization, told as a story about rewriting the fine numbers in a parrot's head on a coarse scale so it gets light.
We want the big parrot on our small perch (phone, laptop), but it is far too heavy.It can only live on the big perch at parrot school. To bring it home, it has to get lighter.
The parrot's head holds billions of numbers, each written very finely.An eight-decimal scale is big and heavy. Every number is written on a scale like that — so the parrot is heavy.
Quantization rewrites the fine numbers on a coarse scale, and the parrot gets light.Like writing 0.4823 as 0.5. It gets a little duller, but far smaller and faster. It is the same parrot, not a new one.
The coarser the ticks, the lighter the parrot — and the score slips a little.8-bit and 4-bit are usually fine; too coarse and it goes dull fast. Pick how coarse by testing. Do the drill (fine-tuning) before you coarsen.
Summaries and translation survive coarse ticks; math and long reasoning can go dull fast.If coarse ticks fall short, there is another road — distillation, teaching a new small parrot. What the lighter parrot costs per answer is the inference story.
Quantization = rewrite the fine numbers in the parrot's head on a coarse scale, making it far smaller and faster. It gets a little duller, so test on our job to pick how coarse.
Converting model weights from high-precision formats like FP16 or BF16 to lower bit widths such as INT8 or INT4 to cut memory and inference cost. There is a precision loss, so verify with benchmarks and apply it after fine-tuning. Nearly mandatory for on-device (phone, laptop) deployment.
When grown-ups say it
- Quantization
- Rewriting numbers on a coarse scale. The same parrot gets light and fast. A little duller.
- Bits (FP16 · INT8 · INT4)
- How coarse the ticks are. 16-bit is fine, 8-bit coarse, 4-bit coarser. Smaller number: lighter and duller.
- Precision loss
- How much duller it got. Writing 0.4823 as 0.5 is slightly off. It shows most in math and long reasoning.
- On-device
- Our small perch at home. Running the parrot right on a phone or laptop. Only a light parrot fits.
- Inference speed
- Time taken to answer. A lighter parrot answers faster. → what an answer costs
- Memory
- The room the parrot takes. A 16 GB parrot becomes 8 GB at 8-bit, 4 GB at 4-bit.
- Versus distillation
- Lighten the same bird vs teach a new one. Quantization coarsens the numbers; distillation raises a new small parrot. → teaching the small parrot to copy
- Evaluation
- The test after coarsening. Check on our job how much the score dropped. → the examiner's scorecard