Inference, Serving & Production·Question 7 of 76Basic

What is quantization for inference? Explain weights-only vs weights-and-activations, and the typical tradeoffs.

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

Quantization stores numbers in fewer bits (FP16 → INT8/FP8/INT4) to cut memory and, depending on the scheme, speed up compute. For LLM inference there are two distinct families, and knowing which bottleneck each attacks is the key insight:

Weights-only (e.g., W4A16): weights are stored in 4 or 8 bits, dequantized on the fly, and the math still happens in FP16. Since batch-1 decode is bound by streaming weight bytes from HBM, shrinking weights 4× directly raises the decode-speed ceiling up to ~4× and cuts memory ~4× (freeing room for KV cache). It does little for prefill or large-batch serving, which are compute-bound. GPTQ and AWQ are the standard 4-bit post-training methods; GGUF k-quants serve the llama.cpp/Ollama ecosystem.

Full worked answer

Quantization stores numbers in fewer bits (FP16 → INT8/FP8/INT4) to cut memory and, depending on the scheme, speed up compute. For LLM inference there are two distinct families, and knowing which bottleneck each attacks is the key insight:

Weights-only (e.g., W4A16): weights are stored in 4 or 8 bits, dequantized on the fly, and the math still happens in FP16. Since batch-1 decode is bound by streaming weight bytes from HBM, shrinking weights 4× directly raises the decode-speed ceiling up to ~4× and cuts memory ~4× (freeing room for KV cache). It does little for prefill or large-batch serving, which are compute-bound. GPTQ and AWQ are the standard 4-bit post-training methods; GGUF k-quants serve the llama.cpp/Ollama ecosystem.

Weights + activations (e.g., W8A8 INT8 or FP8): both operands are low-precision, so matmuls run on INT8/FP8 tensor cores - roughly 2× the FLOPs of FP16. This is what helps compute-bound regimes: prefill and high-batch throughput serving. The hard part is activations, which have extreme outlier channels; techniques like SmoothQuant migrate that difficulty into weights. FP8 (native from Hopper onward) is the mainstream production workhorse; FP4-family formats (NVFP4/MXFP4) are natively accelerated on Blackwell-class GPUs and increasingly used in production there, and some open-weight models ship natively in MXFP4. FP4 is more quality-sensitive than FP8, so it needs the same task-level evaluation.

Typical quality cost: 8-bit ≈ negligible; well-done 4-bit weights ≈ small but real degradation - often ~1-2% on benchmarks, but occasionally much worse on specific capabilities (math, code, low-resource languages). The professional answer: always evaluate the quantized model on your own task suite, not perplexity alone. KV-cache quantization is a separate, composable lever (see the dedicated question).

What a good answer covers

  • Quantization stores numbers in fewer bits (FP16 → INT8/FP8/INT4) to cut memory and, depending on the…
  • Weights-only (e.g., W4A16)
  • Since batch-1 decode is bound by streaming weight bytes from HBM, shrinking weights 4× directly raises…
  • It does little for prefill or large-batch serving, which are compute-bound
  • GPTQ and AWQ are the standard 4-bit post-training methods; GGUF k-quants serve the llama.cpp/Ollama ecosystem

Key terms: Weights-only (e.g., W4A16)

Interviewer follow-ups to expect

  1. Why does W4A16 barely help a high-batch serving deployment?

  2. What are activation outliers and why do they make W8A8 hard?

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