grunz

Q4_K_M vs Q8 vs FP16: which quantization should you run?

Run Q4_K_M when memory is tight, Q8_0 when you have room, and FP16 almost never at home. In llama.cpp's own tests on Llama 3 8B, Q8_0 raised perplexity by 0.04% and Q4_K_M by about 2.8%, while FP16 takes more than three times the memory of Q4_K_M.

What quantization does

A model is billions of numbers called weights. Most models are released with each weight stored in 16 bits (FP16 or BF16, two bytes each). Quantization stores the same weights with fewer bits, so the file shrinks and the model needs less memory to run.

The formats you see on Hugging Face come from llama.cpp and its GGUF file format. They do not round every weight the same way. Weights are packed in small blocks that share a scale, and the "K" formats mix precisions: Q4_K_M stores most tensors at 4-bit but keeps half of two sensitive tensor types at 6-bit. That is why it averages 4.89 bits per weight, not 4.

The name tells you the rough size: Q4 is about 4 bits, Q8 about 8, and the suffix (S, M, L) is small, medium or large within that family.

Memory and quality, side by side

Sizes are real files: Llama 3.1 8B from the llama.cpp quantize docs, and the GGUF files of an abliterated Llama 3.3 70B. Quality is the rise in perplexity over FP16 (lower is better), from the llama.cpp perplexity scoreboard for Llama 3 8B and its older table for Llama 2 70B.

FormatBits per weight8B file70B fileQuality loss, 8B / 70B
FP1616.016.1 GB141 GBNone (reference)
Q8_08.58.5 GB75.0 GB0.04% / not measured
Q6_K6.566.6 GB57.9 GB0.35% / 0.16%
Q5_K_M5.705.7 GB50.0 GB0.9% / 0.4%
Q4_K_M4.894.9 GB42.5 GB2.8% / 1.2%
Q3_K_M4.004.0 GB34.3 GB10.5% / 4.7%
Q2_K3.163.2 GB26.4 GB56.5% / 8.8%

The 8B losses are for Llama 3 8B without an importance matrix. The 70B losses are llama.cpp's older Llama 2 70B numbers. The two models differ, so read across a row, not down a column. The 70B FP16 size is the original 16-bit release.

How to read those numbers

Perplexity measures how well the model predicts the next word of a test text. A rise of a fraction of a percent is noise you will not see in a chat. The same scoreboard also counts how often the quantized model picks the same top word as FP16: 97.7% of the time for Q8_0, 96.0% for Q6_K and 91.9% for Q4_K_M on Llama 3 8B.

Three patterns hold across the tables:

  • Down to about 5 bits the loss is small. Q8_0 and Q6_K are within half a percent of FP16.
  • Below 4 bits it falls off fast. Q3_K_M costs 10.5% on Llama 3 8B, and Q2_K costs 56.5%.
  • Bigger models lose less. Q4_K_M costs 1.2% on Llama 2 70B and 2.8% on Llama 3 8B. llama.cpp's comparison table also shows Llama 3 8B losing more than Llama 2 7B at the same format.

An importance matrix ("imatrix" in a file name) helps the low-bit formats. On Llama 3 8B it cut the Q4_K_M loss from 2.8% to 2.4%. If a repo offers imatrix quants, prefer them.

One caution from the llama.cpp docs: perplexity is not comparable between different models, so these tables tell you what a format costs a given model, not which model is better.

Smaller is also faster

Writing each word means reading the weights from memory, so a smaller file writes faster. The llama.cpp quantize docs measured Llama 3.1 8B on one machine at 29 tokens per second in FP16, 51 in Q8_0 and 72 in Q4_K_M. The reason is memory bandwidth, explained in tokens per second and memory bandwidth.

Which one to run

Q4_K_MThe default. The best size for its quality, and the format most guides assume. Use it whenever the next size up would not leave room for the conversation.
Q5_K_M or Q6_KWhen you have spare memory. Most of the remaining loss goes away for 15 to 35 percent more memory.
Q8_0When memory is plentiful for the model you want. Practically the same as FP16 at about half the size.
FP16 / BF16For converting, fine-tuning or making your own quants. For running, Q8_0 gives nearly the same answers at about half the memory and about 1.7 times the speed.
Q3 and Q2Only to fit a model that would not fit otherwise, and only on large models, where the loss is smaller.

Some models are trained for a low-bit format from the start. OpenAI's gpt-oss models were post-trained with their expert weights in MXFP4, a 4-bit format, and OpenAI ran all its published evaluations in that format. For those, the native 4-bit file is the one to run.

To see how a format plus a context window adds up against your memory, see how much memory you need to run AI locally.

To see the real file size of each format for a given model, and whether it fits your machine, use the will it run calculator.

On Grunz Box

Grunz Box is built around 64 GB or 128 GB of unified memory, enough to choose a higher-precision format for mid-size models instead of squeezing them into Q4. Its preloaded models are picked per memory size, and the models screen shows whether a format fits before you add it. See the models page.

Reserve from $20