Explain speculative decoding. Why doesn't it change the model's output distribution?
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
A small draft model autoregressively proposes k tokens. The large target model then scores all k+1 positions in a single forward pass. An acceptance rule walks the proposals left to right, accepting each with probability min(1, p_target(x)/p_draft(x)); on the first rejection you resample that token from a corrected residual distribution and discard the rest. It is a rejection-sampling scheme, and the proof is that the resulting samples are distributed exactly as if you had sampled from the target model directly. This is the crucial point: it is lossless, not an approximation. If someone tells you speculative decoding trades quality for speed, they have it confused with a smaller model.
Full worked answer with diagram
A small draft model autoregressively proposes k tokens. The large target model then scores all k+1 positions in a single forward pass. An acceptance rule walks the proposals left to right, accepting each with probability min(1, p_target(x)/p_draft(x)); on the first rejection you resample that token from a corrected residual distribution and discard the rest. It is a rejection-sampling scheme, and the proof is that the resulting samples are distributed exactly as if you had sampled from the target model directly. This is the crucial point: it is lossless, not an approximation. If someone tells you speculative decoding trades quality for speed, they have it confused with a smaller model.
Why it is faster comes down to arithmetic intensity. Decode is memory-bandwidth-bound: to produce one token you stream every weight from HBM and do almost no arithmetic with them. Scoring 5 positions costs nearly the same wall clock as scoring 1, because the weight-loading cost dominates and is amortised. You are spending idle FLOPs to buy back time. Typical wins are ~1.5-3x, governed by the acceptance rate and how cheap the draft is.
Going further: follow-up territory
What a strong answer adds:
- It stops helping when the batch is large. At high batch you are already compute-bound and there are no spare FLOPs to spend, so the speculative overhead can make things worse. It is a low-latency, low-batch technique.
- Acceptance rate is everything, and it depends on distribution match, not draft quality in the abstract. The best drafts are distilled from the specific target model, so the KL between them is small. A generically good 1B model drafting for an unrelated 70B can accept badly.
- Variants avoid the second model entirely: Medusa and EAGLE add draft heads on the target's own trunk, n-gram or prompt-lookup drafting works well for copy-heavy work like RAG and code edits, and DeepSeek-V3 reuses its multi-token-prediction module as the draft. The newer family is parallel drafters: block-diffusion drafters such as DFlash produce a whole block of draft tokens in one forward pass conditioned on target-model features, and DeepSeek's DSpark pairs a parallel backbone with a small sequential module and picks each request's verification length from estimated acceptance. Draft cost then barely grows with block length, so the limit becomes how quickly acceptance decays along the block. vLLM, SGLang and TensorRT-LLM support both, and vLLM dropped Medusa in late 2026.
Worth sketching. The branch at the acceptance test is what proves you understand this is rejection sampling, not an approximation.
flowchart LR
DR["draft model proposes k tokens"] --> V["target scores all k+1 positions<br/>in one forward pass"]
V --> C{"accept token with<br/>prob min(1, p_target / p_draft)"}
C -->|"accepted"| K["keep it, test the next one"]
C -->|"first rejection"| RS["resample from corrected residual,<br/>discard the remaining drafts"]
K --> DR
RS --> DR
What a good answer covers
- A small draft model autoregressively proposes k tokens
- The large target model then scores all k+1 positions in a single forward pass
- An acceptance rule walks the proposals left to right, accepting each with probability min(1,…
- It is a rejection-sampling scheme, and the proof is that the resulting samples are distributed exactly…
- This is the crucial point: it is lossless, not an approximation
In the glossary: Speculative decoding · Arithmetic intensity · Decode · HBM · vLLM · SGLang
Interviewer follow-ups to expect
How would you measure whether speculative decoding is actually helping in a live serving deployment?
What acceptance rate do you need for it to break even?
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