What is quantization?

4 min readMarkdown

Fewer bits per number

A model is billions of numbers, and each one is stored with some number of bits. Models are trained at 16 bits per number. Quantization rounds each number to fewer bits, usually 4 to 8, so the file gets smaller.

A 27B model drops from about 54 GB at 16-bit to about 16 GB at 4-bit. You lose a little accuracy. Most people never notice.

Rule of thumb

At 4-bit, budget about 0.6 GB per billion parameters. At 8-bit, budget about 1.1 GB per billion parameters. Then add room for the context.

Smaller is also faster. Writing each tokenTokenA chunk of text, usually part of a word. Models read and write in tokens.Read more means reading the whole model out of memory, so a file half the size writes about twice as fast on the same machine. What makes a model fast? explains why.

Reading the labels

Every download page lists the same model several times, once per quantization. The label tells you the bits and the method.

LabelWhere you see itWhat it means
Q4_K_MGGUF files for llama.cpp, Ollama, LM StudioAbout 4 bits per number. K is the method, M is the medium mix
Q8_0GGUF files8 bits per number, the simplest scheme
4bit, 8bitMLX models on Hugging FaceBits per number for Apple's MLX format
MXFP4, NVFP4Models that ship pre-quantized, such as gpt-oss4-bit floating point formats. The model was built for them
F16, BF16The original releaseFull 16-bit. Usually too big to run at home

The letters after the number vary by uploader. _S, _M and _L mean small, medium and large mixes. A larger mix keeps a few sensitive layers at higher precision and costs a little more memory.

What you lose

Quality drops slowly from 8-bit to 4-bit, then quickly below that. Here is one 27B model at each level.

Quantization levels for a 27B model
LabelBits per weight27B fileSizeQuality
F16 / BF16about 16about 54 GBThe original. Reference quality.
Q8_0about 8.5about 29 GBIndistinguishable from the original in practice.
Q6_Kabout 6.6about 22 GBClose to the original.
Q5_K_Mabout 5.7about 19 GBA small, rarely visible loss.
Q4_K_Mabout 4.8about 16 GBThe common default. Most people never notice.
Q3_K_Mabout 3.9about 13 GBNoticeable on small models. Often fine on big ones.
Q2_Kabout 3about 10 GBClearly degraded. Only to squeeze a much bigger model in.

As of 27 Nov 2026 · Typical llama.cpp figures. They vary a little by model. llama.cpp quantize docs

Q8 and Q6 are close to the original. Q4 is the common default, and we think it is the right starting point for almost everyone. Below Q4 the model starts to slip, more for small models than for large ones.

The catch

Coding and long chains of reasoning feel the loss first. A Q4 model that chats well can still make more small mistakes in code than its Q8 version. If you have the memory, test both on your own work.

Bigger model, fewer bits

If two options fit in the same memory, the bigger model at lower precision usually wins. A mid-class model at 4-bit beats a small model at 8-bit of the same file size on most tasks.

The rule flips below about 3 bits. At that point the damage outweighs the extra size, so drop a class instead. Which quantization should I download? turns this into a decision ladder, and Will it fit? does the sums for your machine.

Vendor-tuned quantizations

Standard quantization rounds every layer the same way. A tuned quantization measures which parts of a specific model are sensitive, then spends more bits there and fewer elsewhere. The aim is better quality at the same size.

Several uploaders and runtimeRuntimeThe software that loads a model file and runs it.Read more makers publish these, such as Unsloth's dynamic quants and Base Compute's BaseQuant. Treat their quality claims as vendor-reported until someone independent measures them.

Base Compute, for one, reports that BaseQuant stays closer to the original model than Unsloth's quants of the same size, measured by KL divergence. The files are in its BaseQuant V1 collection on Hugging Face, and Which quantization should I download? covers the tiers.

Try it

Open any model in LM Studio's search and expand its download options. Each line is the same model at a different quantization, with its file size. Pick the largest Q4 that leaves you a few GB free.

Go deeperThat's enough

How the rounding works

WeightsWeightsThe full set of a model's parameters, stored in a file.Read more are not rounded one at a time. They are grouped into blocks of a few dozen, and each block stores a shared scale plus a small integer for every weight.

To use a weight, the engine multiplies its integer by the block's scale. The scale is where most of the accuracy is kept.

K-quants such as Q4_K nest blocks inside super-blocks, so the scales themselves are stored compactly. That is why a "4-bit" file averages closer to 5 bits per weight. The extra bits are the scales.

Mixes and importance

The _M in Q4_K_M is a recipe. A few tensors that hurt most when squeezed, such as parts of the attention layers, stay at 5 or 6 bits while the rest go to 4. Some uploaders also use an importance matrix: they run sample text through the model, see which weights matter most, and round those more carefully.

Two files with the same label from different uploaders can differ in quality for this reason. Where do I download models? covers how to pick an uploader.

The KV cache is separate

Quantizing the model does not shrink the context. The context lives in the KV cacheKV cacheSaved work from earlier tokens, so the model does not reread the whole conversation for every new token.Read more, which most runtimes keep at 16-bit by default.

Some let you quantize it to 8-bit to fit a longer context. That is a separate setting with its own small quality cost, covered in How do I make it faster?.