Quantization

Quantization shrinks a model by storing its numbers in fewer bits — and because LLM decode is bottlenecked on moving those numbers from memory, making them smaller makes inference both cheaper to host and faster to run. It's the rare optimization that improves memory, cost, and speed at once, if you respect its limits on quality.

The earlier posts established that model weights are huge and that decode is memory-bandwidth-bound — the GPU spends its time hauling weights from memory. Quantization attacks both problems directly: represent each weight in 8 or 4 bits instead of 16, and the model takes a quarter to half the memory and is proportionally faster to read. This post explains what quantization is, the main approaches, and the quality trade-off you must manage.

What quantization is

A trained model’s weights are numbers, normally stored in 16-bit floating point (FP16/BF16). Quantization stores them in a lower-precision format — commonly 8-bit integers (INT8) or 4-bit (INT4) — mapping the original range of float values onto a smaller set of representable levels. Fewer bits per number means:

The catch, of course: fewer bits means less precision, and too little precision degrades the model’s quality. The whole craft of quantization is getting the memory/speed benefit while keeping quality loss negligible.

The core trade-off: bits vs. quality

Every quantization choice trades precision for size, and the quality impact is non-linear:

The critical nuance is that not all weights are equally sensitive. A small fraction of weights (and activations) are outliers whose precision matters disproportionately — quantize them crudely and quality collapses; preserve them and you can quantize everything else aggressively. The best methods exist precisely to identify and protect these sensitive values, which is why “4-bit” from a good method can vastly outperform naive 4-bit rounding.

Post-training quantization vs. quantization-aware training

There are two broad strategies for when quantization happens:

For most serving, PTQ with a good method (GPTQ/AWQ for GPU, GGUF for CPU/edge) is the practical default; QAT is the escalation when you need the last bit of quality at aggressive compression.

What gets quantized: weights, activations, and the KV cache

Quantization isn’t only about weights — there are three distinct targets, each with different implications:

Recognizing these as separate decisions matters: weight-only 4-bit for memory, activation quantization for prefill compute, KV cache quantization for concurrency — you can mix them.

Using quantization well

Quantization is one of the highest-return serving optimizations, but it needs judgment:

Quantization is the lever that makes large models affordable to serve, and — because inference is memory-bound — one of the few that improves cost, memory, and speed together. The next post covers a different kind of speedup that attacks decode’s sequential nature head-on: speculative decoding.

Key takeaways

Further reading

Sources & References

Quantization methods (GPTQ, AWQ)