
When an AI assistant is writing a long answer, the pause between words can matter more than the time it took to start. One technique for shortening that pause is to let a cheaper model guess ahead, then ask the main model to check several guesses together.
That is the idea behind speculative decoding. It sounds like a shortcut that would make the answer less reliable. In the original exact algorithm, the shortcut is in how the server computes the answer, not in which answers the main model is allowed to produce.
Why guessing ahead can help
A language model normally generates a response in order. It picks the next token, adds it to the text so far, then calculates what is likely to come next. The following token depends on the one just chosen. If you have already read how a language model predicts the next token, speculative decoding starts from that same dependency.
There is a useful loophole: if another model supplies a proposed continuation, the main model can score several positions in that proposed text in a single pass. At each position, it can use the earlier proposed tokens without seeing the proposed tokens that follow. Those earlier tokens are not final yet. Their job is to let the main model calculate ahead under a specific assumption.
Draft, verify, then continue
Take a toy example where the confirmed text is “Please save”. A small, fast draft model proposes three pieces: “the”, “file” and “now”. The pieces stand in for tokens; they are not a claim about a particular tokenizer.
The main model, called the target model, scores the three proposed positions together. Suppose its verification procedure accepts “the” and “file”, then rejects “now”. The system keeps the two accepted pieces, samples a replacement at the rejection point according to the algorithm, and starts the next round from the corrected text. If the replacement is a full stop, the confirmed text is now “Please save the file.”
Why stop at the first rejection? A later candidate would have been scored assuming the rejected token was part of the text. Once that assumption changes, the later guess cannot simply be carried forward. If all the draft tokens pass, the original algorithm can also sample one extra token from the target model for that round, provided generation has not already hit a stopping condition.

What “exact” means here
With random sampling, verification is not a check that each guess matches the target’s favourite token. The original speculative-decoding paper uses both models’ probabilities to decide what to accept. When a proposal is rejected, it samples the replacement from a corrected distribution. That correction is what keeps the draft model from biasing which tokens reach the final answer.
Under the exact algorithm, the probabilities of the possible continuations match those of sampling from the target model alone. Two runs can still produce different replies, just as two fair dice throws can land on different numbers. And matching the target model’s distribution does not make the target more factual. An error the target model could produce without speculation can still appear with it.
The guarantee belongs to the algorithm and its assumptions, not to every system that uses the word “speculative”. The vLLM documentation distinguishes standard rejection sampling from relaxed verification and notes that numerical precision can affect results in practice.
When the extra work pays off
Speculation trades some extra work for fewer rounds of expensive, sequential decoding. If the draft is cheap and several guesses regularly pass together, a single target-model round can move the reply forward by more than one token. If the draft is expensive or its first guesses are rejected often, the system pays for proposals without getting much further per round.
The server also matters. An interactive workload with only a few people generating at once can benefit more than a heavily batched service where the hardware is already busy. The vLLM Speculators guide shows why per-user speed and total server throughput need separate measurements. A faster stream for one user need not mean the server handles more work overall.
If you are testing it, compare the same target model and generation settings on representative prompts, at the request loads you expect. Measure time to first token separately from the pace of the rest of the answer, and track how many draft tokens are accepted per round. A short response offers little time to recover the additional work, while a longer response gives the optimisation more room to help.
Think of speculative decoding as asking a fast assistant to pencil in the next few pieces, then keeping only what survives the main model’s checks. The draft model buys a chance to move faster. It does not take over the answer.