Speculative decoding
The conceptWhy a giant AI model is slow at writing but fast at checking
A large language model writes one token (a word or part of a word) at a time. Each token needs a full pass through billions of numbers, and most of that time goes on loading them from memory.
Speculative decoding adds a small, fast draft model. It guesses the next few tokens, and the big model checks all of them in a single pass, keeping each one it would have written itself.
At the first guess it disagrees with, the big model puts in its own token and drops the rest. Then the small model starts guessing again from there.