How does KV cache quantization differ from model weight quantization, and why is it often more sensitive?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Weight quant compresses static tensors offline; KV cache quant compresses runtime activations with per-request distributions, layer compounding errors, and long context noise amplification.
Picture two shrinking jobs. The first is shrinking a textbook that never changes, you scan it once, pick the best shrink trick, ship the smaller copy, and you're done forever. The second is shrinking every live conversation as it unfolds, with no way to know what the next sentence will say, and every tiny shrinking mistake at the start ripples into how the rest of the chat gets stored. The first is gentler because the textbook is steady; the second is touchier because mistakes pile up. Halve the size by storing one byte per number instead of two and chats survive; squeeze to a quarter byte and the model starts forgetting math.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Walk the static vs dynamic distinction, the calibration asymmetry, K's outlier channel pathology, layer wise error accumulation, softmax driven long context amplification, and the production landscape (per-token/per-channel quantization, fp8 on Hopper, KIVI/KVQuant for aggressive bitwidths).
| Aspect | Weight quantization | KV cache quantization |
|---|---|---|
| What's compressed | Pretrained parameters | Runtime K, V activations |
| When | Offline, one time | Online, every request |
| Distribution known? | Yes, fixed | No, varies per request |
| Calibration | Run once with corpus | Heuristic per-token/per-channel scales |
| Error propagation | Layer by layer matmul noise | Compounds through deep attention stacks AND across decode steps |
| Long context impact | Mild | Strong, softmax aggregates more noise |
| Production INT8 | Routine | Routine |
| Production INT4 | Mature (AWQ, GPTQ) | Risky on hard tasks |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating KV cache quantization as 'just another quantization' interchangeable with weight quantization, they have different distributional properties, different sensitivities, and different error accumulation dynamics.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.