Serving
Speculative decoding
A small draft model guesses several tokens; the big model checks them in one pass.
What it is and why it exists
Decode is memory-bound, so verifying k drafted tokens in one big-model forward pass costs about the same as generating one. When the draft is usually right, you get several tokens per big-model step with identical output distribution. Variants use extra heads (Medusa, EAGLE) or n-gram lookup instead of a separate draft model.
Quick prototype
—
In production, at scale
Enable in the serving engine with a matched draft model, measure acceptance rate on real traffic (gains shrink at large batch sizes), and tune the number of speculative tokens.
Vendors and tools
| vLLM / SGLang / TensorRT-LLM | Speculative decoding support |
|---|---|
| EAGLE / Medusa | Draft-head methods |
How it fails
- Low acceptance rate making it slower than plain decoding
What the interviewer asks next
Does speculative decoding change outputs?
No — with proper rejection sampling the output distribution matches the target model exactly; only speed changes.