Verifying many tokens for the price of one
Decoding is memory-bound, so a forward pass that scores one token and one that scores five cost almost the same.
A small model proposes a short continuation, and the large model checks the whole proposal at once.
Every accepted token was produced without its own pass through the large model, which is where the speedup comes from.
The acceptance rule preserves the distribution
- : the large model's probability for that token.
- : the draft model's.
If the target likes the token at least as much as the draft did, it is accepted outright. Otherwise it is accepted in proportion.
On a rejection, the token is resampled from the residual distribution, which is exactly what is left of after removing what already covered.
The output distribution is provably identical to sampling from the large model alone.
This is an exact method, not an approximation, which is why it can be switched on without evaluating quality.
The expected gain
- : the average acceptance rate.
- : the number of drafted tokens.
With and , that is about 3.4 tokens per verification pass.
- : the draft model's cost relative to the target's.
The draft is not free, so a draft model a tenth the size and a of four or five is the usual balance, giving two to three times the throughput.
One step, in order
- The draft model generates tokens autoregressively from the current context.
- The target model runs one forward pass over the context plus all tokens.
- Compare the two distributions at each position and accept by the rule, left to right.
- Stop at the first rejection and resample that position from the residual.
- Append the accepted tokens and the resampled one, then draft again.
Every rejection still yields one token, so a step never makes no progress.
What decides whether it pays
The acceptance rate depends on agreement, not on quality.
The draft model must be trained on similar data and share the tokeniser, or the acceptance rate collapses and the drafting is pure overhead.
Predictable text accepts well. Code, boilerplate and formatting are drafted almost perfectly, while genuinely uncertain continuations are rejected often.
The larger the batch, the smaller the gain.
At large batch sizes the target model is already compute-bound, so the spare capacity the method exploits no longer exists.
Speculative decoding is therefore mainly a low-latency, small-batch technique.
Variants remove the second model entirely, drafting with a subset of the target's own layers or with several extra prediction heads, which avoids maintaining two models in the serving stack.