Explainer
Speculative decoding
A small, fast model drafts several tokens and the large model checks them all in one pass, so a reply can arrive sooner without changing what the model tends to write.
Ordinary decoding runs the large model once per token. Speculative decoding, also called draft-and-verify or assisted generation, adds a draft model, a much smaller one that guesses the next few tokens. The large model, the target, scores all the guesses in a single run. In the greedy case, where the target always picks its likeliest token, it keeps the guesses up to the first one it would not have picked, and puts its own token there.
Illustration, greedy case: the draft guesses four tokens and the target accepts the first three. That one run of the target yields four tokens, three guesses and one of its own, instead of one.
The acceptance rate is the share of drafted tokens the target keeps; vLLM reports accepted draft tokens divided by drafted tokens. A low rate means wasted drafting, and a slow draft model can make the reply slower overall (Hugging Face).
For sampled replies the check uses chances. A guess the target rates at least as likely as the draft did is kept. Otherwise it is kept only with a probability set by the two models' chances for it, and a rejected position is redrawn from a corrected distribution. The original paper shows this works “without changing the distribution”: every possible reply keeps its usual chance. Relaxed variants differ; vLLM warns that its FLy verifier “is not distribution preserving”. Test a relaxed variant like a new model.
Going deeper
It helps most at low load, when memory bandwidth limits each token: vLLM recommends it for “medium-to-low QPS”, few queries per second. Even the standard check is exact only up to hardware rounding.
In the long read: How fast does the rest arrive? Then read Mixture of experts.
Read next: Mixture of experts