Inference 101, lesson 9
Speculative decoding: a fast guesser and a careful checker
A junior drafts a few words ahead; a senior checks them all at once and keeps the ones it agrees with. This lesson shows how that makes a big model write faster without changing a word of its answer, and when it is worth having.
Every example below changes to fit what you pick. The businesses are made up for teaching.
The picture, one step at a time
Each box is one stage. The picture lights up as you scroll.
Speculative decoding, from a fast draft to the same answer sooner
1One token at a time
The big model reads its whole memory for every token, and its sums mostly sit idle.
2A fast guesser drafts
A small, quick model guesses the next few tokens ahead.
3Checked in one go
The big model looks at the whole draft at once, the way it reads a prompt.
4The right guesses kept
Guesses are kept up to the first wrong one. The big model writes the right token there itself.
5The same answer, sooner
The text is exactly what the big model would have written alone. Only the speed changes.
One token per full read of memory.
Step 1 of 7
The chip is waiting, not working
Lesson 2 showed that writing is slow for a strange reason: for every token, the big model reads its whole memory, and most of its sums sit idle while it does. That idle effort is the opening. If there were some way to put it to work on several tokens at once, writing would speed up.
Step 2 of 7
A junior drafts ahead
Picture an office where a junior drafts a letter quickly and a senior checks it. Speculative decoding works like that. A small, fast model, the junior, guesses the next few tokens, say five. Because it is small, guessing costs very little.
Step 3 of 7
The senior checks the whole draft at once
The big model, the senior, can check all five guesses in one go, because the words are already written down: checking is like reading a prompt, which happens all at once (lesson 1). It keeps every guess up to the first one it would not have written, then writes the right token there itself. Say the junior drafts "your order ships on Monday". The senior agrees with "your order ships on", rejects "Monday", and writes "Tuesday". Five tokens from one slow step instead of one.
The big model rejects the very first guess in a draft. How many tokens does that step still produce?
Step 4 of 7
The same answer, only sooner
Here the office picture breaks. A real senior keeps some of the junior's phrasing. This one keeps a guess only if it is exactly what it would have chosen anyway. So the finished text is the big model's own answer, word for word. The junior changes how fast it arrives, never what it says.
Leviathan and others at Google (2022) reported 2 to 3 times faster writing on a large T5 model "with identical outputs" and no retraining. Chen and others at DeepMind (2023) reported 2 to 2.5 times faster on the 70-billion-parameter Chinchilla, keeping the same answers "within hardware numerics".
Step 5 of 7
A guesser built in
Keeping a second model around is a chore: it has to be trained, matched and run beside the first. Newer methods build the guesser into the big model itself, as a small extra part that predicts a few tokens ahead from what the model is already thinking. Same idea, one model to run.
Medusa (Cai and others, 2024) adds extra prediction heads and reported over 2.2 times faster writing, and 2.3 to 3.6 times when the heads are trained together with the model. EAGLE (Li and others, 2024) guesses from the model's own inner workings and reported 2.7 to 3.5 times faster on a 70-billion-parameter Llama 2 chat model, with the same answers.
Step 6 of 7
When it helps, and when it does not
Three things decide the gain. The guesses must often be right, so predictable text gains far more than surprising text. The answer must be long enough for writing to be the slow part. And the chip needs spare effort: on a chip already packed with users, there is little idle capacity left to spend on checking.
vLLM, a widely used open serving engine, says in its documentation (read 29 November 2026) that speculative decoding is for cutting the wait between tokens "under medium-to-low QPS" (queries per second), where the work waits on memory, and rates the gains lower when traffic is high.
Which reply gains most from speculative decoding?
Step 7 of 7
Sometimes you can be the guesser
On an API this mostly happens out of sight: you notice faster answers, not different ones. But when you edit a long document or file for answering customers, you already know most of the answer, because it is the old version. Some providers let you send that as the guess, so the unchanged parts come back fast. Check how guesses that turn out wrong are billed before you rely on it.
OpenAI calls this Predicted Outputs. As of November 2026 its guide lists it for the GPT-4o and GPT-4.1 families, suggests it for "regenerating a text or code file with minor modifications", and says rejected tokens "are still billed".
Will it speed this up?
Here are four jobs in your business. Sort each one: is speculative decoding likely to make it much faster, or is there little to gain?
1On your own lightly used server, replies are mostly set phrases: "Thanks for your order. It will be sent within two working days."
2At the Black Friday peak, your own chip is packed with chats from end to end.
3The model reads a long product page and replies with one word: "yes" or "no".
4You are updating your 40-page terms with three small changes, through a service that takes the old text as a guess.
0 of 4 right so far, 4 to go.
The speculative decoding card
This is what you keep: how a fast guesser and a careful checker work together, and when it pays.
The speculative decoding card
- Writing is slow because each token waits on a full read of memory, while the chip's sums sit idle.
- A small, fast guesser drafts the next few tokens. The big model checks them all in one go, like reading a prompt.
- It keeps the guesses up to the first wrong one and writes that token itself, so every check gives at least one token.
- The answer is word for word what the big model would have written alone. Only the speed changes.
- It helps most on long, predictable answers on a chip with room to spare. On a packed chip or a one-word answer, it adds little.
- When you edit a long text, some APIs let you send the old version as the guess (November 2026). Check how wrong guesses are billed.
It buys speed, not better answers. Reach for it when the wait for the last word is the problem.
Next: Lesson 10: Routing: the right model for each job. How to send easy work to a small model and hard work to a big one, and check you got it right.