Quantization

ProductionModels and inferencePublished By Simon Budziak

Quantization is the technique of storing a language model's weights in a lower-precision numeric format than they were trained in, which cuts memory use sharply and lets the same model run on smaller, cheaper hardware, in exchange for a small loss in numerical precision.

How does quantization actually work?

Model weights are numbers, stored at training time in high-precision floating point. Quantization maps them into coarser formats such as eight-bit integers or four-bit floats, keeping a small scale factor per group of weights so values stay in range. Post-training quantization applies this to a finished model with no retraining, which makes it the first compression lever most teams pull before considering anything more expensive. Published evaluations consistently find four-bit weights hold close to full quality on common benchmarks, while quality degrades noticeably at two bits.

When is a quantized model the wrong answer?

Compression failures surface on edge cases first, so evaluate candidates on your own hard inputs rather than generic benchmarks. Quantization also cannot add a capability the base model lacks; it only preserves what exists, more cheaply. Treat it as one lever among several: prompt caching attacks a different part of the serving bill, and a distilled model can be quantized in turn when model distillation has already produced a smaller student. Measure whichever combination you ship through inference latency and quality checks in production, not lab scores alone.

Frequently asked questions

Does quantization damage output quality?

At eight bits, usually imperceptibly. At four bits, most published evaluations find quality close to the original model. Below that, degradation becomes real, and it tends to show up on unusual or edge case inputs long before average benchmark scores move.

What is the difference between quantization and distillation?

Quantization stores the same model's weights with fewer bits per weight. Distillation trains a new, smaller model to imitate a larger one. The two compose: a distilled model can be quantized as well for further savings.

Summarize this page with

Train your team to build this