Every time a large language model writes a word, it runs its full stack of billions of parameters — just to produce one token. That one-at-a-time loop is the main bottleneck of modern AI inference: the model is not limited by how fast it thinks, but by how many sequential steps it must take.
Speculative decoding, introduced independently by Chen et al. and Leviathan et al. in 2023, breaks the loop. The idea is almost embarrassingly simple:
- A small, fast draft model proposes a sequence of tokens — say, five at once.
- The large target model verifies all five in a single parallel forward pass.
- If the big model agrees with the draft, all five tokens are accepted for free. If it disagrees at some position, every token up to the first disagreement is still kept, and the sequence is corrected from there.
The output distribution is mathematically identical to running the big model alone — not an approximation, an exact match. Yet in practice you often need only one big-model step for every three to five tokens, giving speed-ups of 2–4× on hardware that can run the small model cheaply alongside the large one.
Comments
Loading comments...