Notes

Quantization

A trained model is, in the end, a very large table of numbers. Quantization asks a blunt question about it: does every number need the sixteen bits of precision it was trained in, or will eight — or four — do?

How the precision comes down

Weights are mapped from floating point onto a small set of integer levels, with a scale factor stored per block of a few dozen values so the levels cover the range that block actually occupies. Most of this happens after training: GPTQ and AWQ spend a little calibration data deciding which weights can absorb the rounding error. Quantization-aware training is the heavier alternative, for precisions low enough that rounding afterwards would break the model.

Why it buys speed, not just space

Generating a token means reading every weight out of memory, so decoding is bound by memory bandwidth, not arithmetic. Smaller weights mean less data moved per token, which is why a 4-bit model can run several times faster than the same model at 16-bit. A 13B model falls from roughly 26 GB to under 8 GB — the difference between a rented data-centre GPU and a laptop running llama.cpp on a GGUF file.

Where it starts to hurt

8-bit is close to free. 4-bit costs a small but measurable amount of accuracy, concentrated in the hardest tasks: multi-step arithmetic and long-context recall degrade well before casual conversation does. Below 4 bits quality falls away sharply unless the model was trained for it.

Quantization stores a model's weights at lower numerical precision — typically 8-bit or 4-bit integers in place of 16-bit floats — keeping a scale factor per block of values so the originals can be reconstructed approximately. It cuts memory by half or more and speeds up decoding, which is bound by memory bandwidth. Quantization is what lets a model that needs a data-centre GPU at full precision run on a single consumer card.

Think of a huge photograph saved as a smaller image file. A little fine detail is lost, but the picture still looks right — and now it fits on your phone. Quantization does that to a language model. The model is really billions of stored numbers, each written out very precisely. Quantization rewrites them more coarsely, with fewer digits each, so the whole thing takes a quarter of the space and runs faster. The answers stay almost as good, and a model that needed expensive specialist hardware can suddenly run on an ordinary laptop. Push the squeeze too far, though, and the quality starts to show.