Speculative Decoding
Definition
Speculative decoding speeds up a large language model by having a small, fast model guess the next several tokens and the large model check them all at once, keeping the guesses it agrees with. The output is the same as the large model would have produced alone; it just arrives sooner.
Diagram
Small model drafts
- The
- order
- ships
- today
- and
Large model checks all five at once
- The
- order
- ships
- today → on
- and
Result of one large-model pass: The order ships on, four tokens instead of one.