Speculative Decoding
What is Speculative Decoding?
In one sentence: Speculative decoding speeds up generation by letting a small fast model guess several tokens ahead, then having the big model check them all at once.
The big model can check many tokens in one pass almost as fast as writing one. If the small model's guesses are right, several tokens are accepted at once. If a guess is wrong, the big model corrects it. The final output is the same quality as the big model alone.
What does Speculative Decoding look like?
A tiny model guesses "the cat sat on the" and the big model confirms all five tokens in one step.
Why does Speculative Decoding matter?
It can make generation two to three times faster without changing quality.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/speculative-decoding/">Speculative Decoding, explained simply</a> (The AI Math Dictionary)