Your model meets quality but runs at 4s p95 and you need 400ms with 10x the throughput. Design the compression plan.
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
Measure first, and establish whether you are compute-bound or memory-bandwidth-bound, because the answer picks the technique. Autoregressive decode at small batch is bandwidth-bound (every token reads all the weights), so weight-only quantization buys close to linear speedup. As you raise batch size to hit the throughput target, decode drifts toward compute-bound and the KV cache becomes the memory you are actually reading. Prefill is compute-bound, so it wants lower-precision math, not just smaller weights. Getting this backwards is how people quantize aggressively and see no latency win.
Full worked answer with diagram
Measure first, and establish whether you are compute-bound or memory-bandwidth-bound, because the answer picks the technique. Autoregressive decode at small batch is bandwidth-bound (every token reads all the weights), so weight-only quantization buys close to linear speedup. As you raise batch size to hit the throughput target, decode drifts toward compute-bound and the KV cache becomes the memory you are actually reading. Prefill is compute-bound, so it wants lower-precision math, not just smaller weights. Getting this backwards is how people quantize aggressively and see no latency win.
Order of operations, cheapest first:
- Serving-level wins that cost zero quality. Continuous batching, paged KV cache, prefix caching for shared system prompts, and speculative decoding with a small draft model. Speculative decoding is lossless: the accept/reject rule preserves the target model's output distribution exactly. Do all of this before touching weights.
- Post-training quantization. 8-bit weight-only is typically a rounding error in quality. 4-bit with group-wise scales (GPTQ/AWQ-style) costs more and needs a real eval. FP8 on Hopper-class and newer GPUs gives compute speedup as well as size reduction, and Blackwell-class hardware adds block-scaled 4-bit formats (NVFP4, MXFP4) for teams willing to run the eval. Quantizing the KV cache matters specifically for long context, where it can dominate memory.
- Distillation into a smaller model. Biggest win, biggest project. Train the student on the teacher's outputs, ideally soft logits or on-policy sequences over your task distribution. Task-specific distillation goes far further than general distillation; a small student on a narrow task can match a much larger generalist.
- Structured pruning or layer dropping plus a healing fine-tune. Unstructured sparsity rarely pays without hardware support for it.
PTQ versus QAT: PTQ takes hours with a calibration set. QAT costs a training run but recovers quality at aggressive bit widths. Start with PTQ, escalate only when the eval says you must.
What I insist on: a per-technique eval on my golden set plus a tail regression check. Compression damages rare capabilities and long-context behaviour first, and aggregate benchmark averages hide exactly that. And measure p95 under realistic concurrency, not single-request latency.
Often the best move is not compression at all: route. A small model handles the easy majority of traffic, escalate to the large one on an uncertainty signal. That usually beats degrading everything uniformly.
Worth sketching. Leading with the bottleneck branch shows the interviewer you know where the time actually goes, rather than reaching for quantization by reflex.
flowchart TD
A["Measure p95 under<br/>realistic concurrency"] --> B{"Decode-bound or<br/>prefill-bound?"}
B -->|"decode: memory bandwidth"| C["Weight-only and KV cache<br/>quantization"]
B -->|"prefill: compute"| D["FP8 or lower-precision math"]
A --> E["Free first: continuous batching,<br/>paged KV, prefix cache,<br/>speculative decoding"]
C --> F{"Still above 400ms?"}
D --> F
E --> F
F -->|"yes"| G["Distil a student on your task,<br/>or route easy traffic to a small model"]
F -->|"no"| H["Stop. Run the tail<br/>regression eval"]
What a good answer covers
- Measure first, and establish whether you are compute-bound or memory-bandwidth-bound, because the answer…
- Autoregressive decode at small batch is bandwidth-bound (every token reads all the weights), so…
- As you raise batch size to hit the throughput target, decode drifts toward compute-bound and the KV…
- Prefill is compute-bound, so it wants lower-precision math, not just smaller weights
- Getting this backwards is how people quantize aggressively and see no latency win
Key terms: Post-training quantization · Distillation into a smaller model · route
In the glossary: Continuous batching · Prefix caching · Speculative decoding · GPTQ · FP8 / INT8 · FP4 (NVFP4 / MXFP4)
Interviewer follow-ups to expect
Your 4-bit model matches on aggregate benchmarks but users complain. How do you find what broke?
Why is speculative decoding lossless, and what determines whether it actually speeds you up?
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