Inference, Serving & Production·Question 21 of 76Intermediate

What is KV-cache quantization, and when is it the right lever?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Storing the KV cache in fewer bits - FP8 or INT8 instead of FP16, and now 4-bit: NVFP4 KV cache ships in vLLM and TensorRT-LLM and roughly halves KV memory compared with FP8, with under 1% accuracy loss in NVIDIA's benchmarks. NVIDIA's implementation dequantizes to FP8 before attention, so it saves memory and bandwidth but not attention FLOPs. It's orthogonal to weight quantization and attacks a different constraint: weights are a fixed cost, but KV grows with sequences × context length, and on a busy server it's the KV pool, not weights, that caps concurrency.

Full worked answer

Storing the KV cache in fewer bits - FP8 or INT8 instead of FP16, and now 4-bit: NVFP4 KV cache ships in vLLM and TensorRT-LLM and roughly halves KV memory compared with FP8, with under 1% accuracy loss in NVIDIA's benchmarks. NVIDIA's implementation dequantizes to FP8 before attention, so it saves memory and bandwidth but not attention FLOPs. It's orthogonal to weight quantization and attacks a different constraint: weights are a fixed cost, but KV grows with sequences × context length, and on a busy server it's the KV pool, not weights, that caps concurrency.

The payoff is direct: FP8 KV halves bytes/token - our 70B example drops from ~320 KB to ~160 KB/token - which literally doubles either max batch size (throughput) or max servable context at the same memory. It also reduces attention's memory traffic at long contexts, where reading the KV cache (which, unlike weights, doesn't amortise across the batch) becomes the bandwidth bottleneck - so long-context decode gets faster too.

Quality: 8-bit KV (especially FP8) is generally near-lossless and widely used in production; vLLM, TensorRT-LLM, and llama.cpp all support it. Below 8 bits it gets more delicate, and vendor accuracy numbers on short benchmarks are not a substitute for your own evals - attention is sensitive to key precision (keys enter the dot-product logits; error there perturbs the softmax over all positions), and research consistently finds keys need gentler treatment than values, motivating per-channel key quantization and asymmetric K/V schemes. Long multi-step tasks accumulate error, so evaluate on long-context and agentic benchmarks, not short QA.

When to reach for it: (1) KV-bound deployments - high concurrency or long context, where the dashboard shows KV utilization pegged and preemptions climbing; (2) fitting a long-context model on fixed hardware; (3) squeezing more batch out of a GPU already serving 4-bit weights. Caveat: stacking aggressive weight quant + aggressive KV quant compounds error - re-run evals on the combination, not each in isolation.

What a good answer covers

  • Storing the KV cache in fewer bits - FP8 or INT8 instead of FP16, and now 4-bit
  • NVIDIA's implementation dequantizes to FP8 before attention, so it saves memory and bandwidth but not…
  • It's orthogonal to weight quantization and attacks a different constraint
  • The payoff is direct: FP8 KV halves bytes/token - our 70B example drops from ~320 KB to ~160 KB/token -…
  • It also reduces attention's memory traffic at long contexts, where reading the KV cache (which, unlike…

Key terms: doubles

Interviewer follow-ups to expect

  1. Why are keys more quantization-sensitive than values?

  2. Your KV utilization is at 95% with rising preemptions - walk through your options and their tradeoffs.

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep