A model is billions of numbers, each stored in 16 bits. But do you need all 16? Round each weight to a coarser grid — 8 bits, 4, even 2 — and the model shrinks by that factor, while precision blurs. Watch the trade play out, and discover why NF4 beats plain integers by putting its levels where the weights actually live.
Act 1 · Rounding to a grid
Snap a weight to the nearest level
A quantized format has only a fixed set of representable values — a grid. Every real weight snaps to its nearest grid point, and the gap is the rounding error. Drag the weight, change the bit-width, and watch the grid get coarser as bits drop.
Bits:
Original weight0.37
Original value Nearest grid level Rounding error
16
Grid levels
2^bits
0.33
Stored value
0.04
Rounding error
Fewer bits = fewer levels = a coarser grid = bigger rounding error. INT8 has 256 levels (fine), INT4 has 16 (usable), INT2 has 4 (brutal). The art is losing bits without losing the model.
Act 2 · Levels where the weights live
INT4 vs NF4 on a real distribution
Neural weights aren't spread evenly — they bunch near zero in a bell curve. Plain INT4 spaces its 16 levels evenly, wasting most on the empty tails. NF4 puts its levels at the quantiles of the bell — dense where weights crowd. Toggle and watch the total error drop.
Format:
Weight distribution Grid levels (16)
—
Total rounding error
—
NF4 improvement
vs even INT4
16
Levels (both)
Same 16 levels, same 4 bits — but NF4 spends them where weights actually are. That's the whole idea behind QLoRA's frozen 4-bit base: no quality loss, a quarter of the memory.
Act 3 · The trade, at scale
Memory saved vs quality kept
This is the decision every deployment makes. Pick a model size and a precision and see what fits — and roughly what quality you keep. Below ~4 bits the curve turns: error accumulates faster than memory savings justify.
Model size70B
Precision:
— GB
Model memory
vs FP16
—
Smallest GPU that fits
—
Quality retained
The sweet spot for most deployments is INT4/NF4: ~4× smaller, quality essentially intact. INT8 is the zero-risk default; INT2 is research territory where cleverness fights collapse.
Why you can throw bits away
A model's memory is brutally simple: parameters × bytes-per-parameter. FP16 spends 2 bytes each; a 70B model is ~140 GB. Quantization attacks the second factor — store each weight in 1 byte (INT8), half a byte (INT4), a quarter (INT2) — and the model shrinks by exactly that ratio. A 70B model at INT4 is ~35 GB: suddenly it fits on one card.
The surprise is that this works. Rounding each weight introduces error, yet the model barely notices — because meaning is spread across billions of parameters, and no single rounded weight moves the output much. Down to about 4 bits, done carefully, quality loss is often within noise. Below that, errors compound and the model starts to slip.
The NF4 insight
Weights are approximately normally distributed — a bell curve bunched near zero. Evenly spaced levels (INT4) waste most of their 16 slots on the empty tails. NF4 places levels at the quantiles of a normal distribution, so each level covers an equal share of the actual weights — dense in the middle, sparse in the tails. Same bits, far less error. It's the format QLoRA froze its base model in.
It's also a speed win
Decode is memory-bandwidth-bound: generating a token means streaming every weight through the GPU. Fewer bytes per weight means less traffic, so quantization often makes generation faster too — the same reason it fits on smaller cards. Note one subtlety: quantizing weights shrinks the model, but the KV cache is a separate budget with its own dtype.
The catch
Not all quantization is free. Naive rounding of everything hurts; production methods (GPTQ, AWQ, NF4) protect the weights that matter, use per-block scales, and sometimes keep sensitive layers in higher precision. And activations are trickier than weights. But the headline holds: 4-bit is the practical floor where models stay sharp and memory drops 4× — which is why it powers on-device AI and cheap serving alike.
The picture: where 16 levels go
These are the exact levels the lab draws in Act 2. Even INT4 steps by 2/15 ≈ 0.133 everywhere, so the tails, where few weights live, get as many levels as the crowded middle. The quantile levels are 0.084 apart near zero and 0.292 apart at the edges. That puts 8 of the 16 inside the dashed band instead of 6. Every weight in the band rounds to a closer level, and that is most of the weights. The lab’s levels skip zero. Real NF4 keeps an exact zero, so weights that are exactly zero stay zero. To see the effect, switch Act 2 between the two formats and press ↻ New weights a few times. The samples change, but on bell-shaped weights the quantile grid’s total error keeps coming out lower.
Trade-offs: bits against memory, speed and accuracy
For a 70B model. Time is the weight bytes streamed per generated token, relative to FP16, which is what sets decode speed when decode is memory-bound. Space is the weights alone: parameters × bits ÷ 8.
Case
Time
Space
Why
FP16
1×
140 GB
The baseline. More than any single card in the lab’s list can hold.
INT8
0.5×
70 GB
The safe default. Per-channel scales keep the error tiny.
INT4, one scale per tensor
0.25×
35 GB
Cheapest bookkeeping, but one outlier stretches the grid for every weight (the page’s 4.0 example).
INT4, a scale per 128 weights
0.258×
36.1 GB
4.125 bits per weight. The extra 0.125 bits confine an outlier to its own block.
NF4 (quantile levels)
≈0.25× + scales
≈35 GB + scales
Same bits as INT4, lower error on bell-shaped weights. Needs a lookup table to dequantize.
W8A8: INT8 weights and activations
0.5×, plus INT8 math
70 GB
Speeds up compute-bound prefill too, not just decode. Activations have outlier channels, so methods like SmoothQuant move that difficulty from the activations into the weights first.
A separate knob from the weights. It matters most for long contexts and big batches, and needs its own accuracy check.
INT2
0.125×
17.5 GB
Only 4 levels. The page calls this research territory, and the lab’s quality proxy agrees.
The speed column assumes memory-bound decode. At large batch sizes, or during prefill, the GPU is busy with arithmetic, and every weight still has to be dequantized before it is used, so the gain shrinks. None of these rows touches the KV cache. It grows with context length and batch size whatever the weights are stored in. A sensible order is to start at INT8, then try 4-bit with group scales or NF4, measure on your own task and on long outputs, and only go lower if the numbers still hold.
Where this shows up in production
Quantization is rarely a research choice now. It decides what hardware a model needs at all, so it shows up wherever a model has to fit somewhere smaller than it was trained on.
Local models on laptops
Runners such as llama.cpp ship models as GGUF files in quantized variants with names like Q8_0 and Q4_K_M. That is the difference between 14 GB and 3.5 GB of weights for a 7B model, and so between “needs a GPU server” and “fits in laptop memory”.
The base model is frozen in NF4 and only small LoRA adapters train in 16-bit. The QLoRA paper fine-tuned a 65B model on a single 48 GB GPU. At 4 bits its weights are 65 × 0.5 = 32.5 GB, which leaves room for adapters, activations and optimizer state.
Serving engines
Serving stacks such as vLLM load GPTQ and AWQ checkpoints directly, so a team serves a 4-bit model with no custom kernels. On GPUs with FP8 tensor cores (Hopper and later), FP8 is a common middle ground: the same 1 byte as INT8, but a float format, so the grid is denser near zero.
The interview question
“Will a 70B model fit on one 80 GB card?” FP16 needs 140 GB, so no. INT8 needs 70 GB of weights and leaves 10 GB for the KV cache and activations, which is tight. INT4 needs 35 GB and leaves 45 GB. The strong answer also names what gets worse: rounding error, an accuracy check on your own task, and the KV cache as a separate budget.
Quantization, step by step
The arithmetic behind a quantized weight: how the scale is chosen, what one outlier does to it, and what the formats cost in memory.
Symmetric absmax quantization
Find the scale. For b bits, qmax = 2^(b−1) − 1 (127 for INT8, 7 for INT4) and s = max|x| / qmax.
Round.q = clamp(round(x / s), −qmax, qmax), stored as a small integer.
Dequantize.x̂ = s · q, computed on the fly when the weight is used.
Error. Inside the range, no weight is off by more than s/2. Affine (asymmetric) schemes add a zero point z, x̂ = s·(q − z), to cover ranges that are not centered on zero.
Worked example: eight weights
Weights: 0.12, −0.41, 0.03, 0.88, −0.27, 0.55, −0.09, 0.31. The largest magnitude is 0.88.
INT4: s = 0.88 / 7 = 0.1257. The integers are 1, −3, 0, 7, −2, 4, −1, 2, which dequantize to 0.126, −0.377, 0.000, 0.880, −0.251, 0.503, −0.126, 0.251. The worst error is 0.059, under s/2 = 0.063.
INT8: s = 0.88 / 127 = 0.00693, integers 17, −59, 4, 127, −39, 79, −13, 45, and a worst error of 0.0026.
One outlier. Replace 0.88 with 4.0 and the INT4 scale becomes 0.571. Four of the seven ordinary weights round to exactly zero and the rest become ±0.571: one value stretched the grid for everyone.
The fix is smaller groups. Give each block of 128 weights its own 16-bit scale and an outlier only hurts its own block. The scales cost 16/128 = 0.125 extra bits per weight, so "4-bit" really stores about 4.125.
Memory at that rate: a 7B model is 14.0 GB in FP16, 7.0 GB in INT8, 3.5 GB in INT4 and about 3.6 GB with group scales; a 70B model goes from 140 GB to 35 GB, or about 36 GB.
Knobs and pitfalls
Choose granularity (per tensor, per channel or per group), weight-only versus weight-and-activation, and the method. GPTQ minimizes layer output error using calibration data; AWQ scales up the weights that matter most to the activations. Activations have large outlier channels, so weight-only 4-bit with 16-bit activations is the usual deployment. Always evaluate on your own task and on long outputs, since perplexity can hide regressions, and quantize the KV cache separately, with its own accuracy check.
Check yourself
Four questions. Round to the nearest right answer.
See every answer, with the reasoning
Dropping weights from FP16 to INT4 shrinks the model by roughly…
Answer: 4× — FP16 = 2 bytes, INT4 = 0.5 bytes per weight → 4× smaller. INT8 would be 2×.
Why does quantization barely hurt quality down to ~4 bits?
Answer: Meaning is spread across billions of weights, so small per-weight rounding rarely moves the output — Networks are robust to small perturbations — the redundancy absorbs the rounding error.
Why does NF4 beat evenly spaced INT4?
Answer: It places its 16 levels at the quantiles of the bell curve, where weights actually crowd — Dense levels in the middle, sparse in the tails — minimal error for the same 4 bits. QLoRA uses it.
Quantizing weights also tends to make decode faster because…
Answer: Decode is memory-bound, so fewer bytes per weight means less memory traffic per token — Same reason it fits on smaller cards — less to stream through the GPU each step.