Skip to content

Quantization explorer

Watch quantization error appear as you lower the bit width, then compare real GGUF quants by size and quality.

Block-wise quantization demo

A slice of synthetic weights (blue) and their reconstruction (orange) after rounding to a few levels per block. Outliers stretch a block's scale and hurt everything else in it.

Levels

16

Signal-to-noise

16.2 dB

Effective bits/weight

4.50

Effective bits include one 16-bit scale per block. Real GGUF K-quants use more elaborate super-blocks, so numbers differ.

GGUF quant comparison

File size and relative quality for a chosen model.

QuantSizeRelative sizePerplexity delta*Note
F1615.0 GiB
+0Unquantized reference
Q8_07.9 GiB
+0.0004Near-lossless
Q6_K6.1 GiB
+0.0044Very close to F16
Q5_K_M5.3 GiB
+0.0142Great quality/size
Q4_K_M4.5 GiB
+0.0535Best default for most
IQ4_XS4.0 GiB
n/aSmaller 4-bit (imatrix)
Q3_K_M3.7 GiB
+0.2437Noticeable loss
Q2_K3.1 GiB
+0.8698Last resort; big loss

*Perplexity increase over F16 on Llama-2 7B from llama.cpp's published quantization table; it is illustrative, and the effect differs by model and task.