Module 2 · Smaller, faster, still correct · Lesson 6
Speculative decoding in practice
A cheap drafter proposes several tokens and the model verifies them in one memory-bound step; rejection sampling keeps the output distribution exactly the target's, the win is real at low concurrency, and it fades when the GPU is already busy.
By the end of this lesson you can
- Explain draft-then-verify and show why rejection sampling leaves the output distribution unchanged
- Compute expected accepted tokens per step from the acceptance rate and draft length, and read an engine's acceptance metrics correctly
- Choose among n-gram lookup, EAGLE-style heads, multi-token prediction and a separate draft model for a given model and traffic
- Configure speculative decoding in vLLM or SGLang and verify it with a benchmark rather than assume the gain
- Recognise when speculation hurts, and why structured JSON output is the case where n-gram drafting shines
