How a Small Model Helps a Big One Write Faster Without Changing the Answer (Speculative Decoding)
How a Small Model Helps a Big One Write Faster Without Changing the Answer (Speculative Decoding)
Speculative decoding makes a large language model, the kind of AI behind chatbots, generate text faster without changing what it writes. A small draft model guesses several tokens (chunks of text) ahead. The large model checks all the guesses in one pass, keeps the ones it agrees with, and fixes the first one it disagrees with. The output stays the same. The speed goes up.
New to these terms? Every word is explained in the series glossary.
The short version
Think of a junior writer and a senior editor. The junior drafts a paragraph quickly. The senior reads the whole paragraph once, approves most of it, and rewrites the first line that is wrong. That is speculative decoding. The small model drafts. The large model verifies in one read. Work that took five slow reads now takes one slow read plus five fast guesses.
Why decoding is slow in the first place
A language model writes one token per forward pass. A forward pass is one run of the model through its layers. A token is a chunk of text, roughly three quarters of a word in English.
Each pass reads the whole model from GPU memory (VRAM, the memory on the graphics chip that runs the model). For a large model, that read is the bottleneck. The math itself is quick. Moving the weights, the model's learned numbers, is slow.
That leaves spare compute (arithmetic capacity) sitting idle. Checking five tokens at once costs barely more than checking one, because the weights are already loaded. Speculative decoding spends that spare compute on verification.
The draft, verify, accept loop
Every round has three steps.
Step 1, draft. The small draft model generates K tokens, one after another, using its own cheap forward passes. K is the speculation length. It is how many tokens the draft guesses per round. The draft is often a hundred times smaller than the target, the big model whose answer you want, so these passes are fast.
Step 2, verify. The large target model runs one forward pass over all K draft tokens at once. It computes what it would have written at each position. This is the expensive step, but it happens once per round, not K times.
Step 3, accept. Walk through the draft tokens in order. Keep each token the target agrees with. Stop at the first token it disagrees with. Throw that token away and replace it with the token the target would have written.
Every round produces at least one new token. The target always supplies a token at the first disagreement. If it accepts everything, it adds a bonus token. So a round never comes back empty.
sequenceDiagram autonumber participant D as Draft model (small) participant T as Target model (large) participant O as Output Note over D,O: Prompt: "The capital of France is" D->>D: Guess K tokens, cheap passes D->>T: Paris , the city of T->>T: One forward pass over all K T->>O: Keep: Paris , the city T->>O: Reject "of", write its own: "and" Note over T,O: First disagreement: target token wins D->>T: Next round: K new guesses T->>T: One forward pass T->>O: All accepted, plus a bonus token Note over D,O: Bad round: draft says "London" T->>O: Reject at 1, write "Paris" Note over D,O: Every round adds at least one token
Diagram: Each round: the draft guesses K tokens, the target checks them in one pass and keeps them up to the first disagreement.
A worked trace: five draft tokens
Here is one round, with a speculation length of 5. The prompt, the text sent in, is "The capital of France is". The draft model guesses five tokens, and the target checks them all in one pass.
Animation: The draft proposes five tokens. The target accepts four, rejects "of" and writes "and" instead.
| Position | Draft token | Target agrees? | Result |
|---|---|---|---|
| 1 | Paris | Yes | Accepted |
| 2 | , | Yes | Accepted |
| 3 | the | Yes | Accepted |
| 4 | city | Yes | Accepted |
| 5 | of | No | Rejected, replaced by "and" |
| Bonus | none | none | Target adds "known" |
The round produced five tokens from the check: "Paris", ",", "the", "city", and "and". Then the target added the bonus token "known". That is six new tokens from one target pass. Without speculation, those tokens would have taken six target passes.
A bad round looks different. Suppose the draft guesses "London" at position 1. The target rejects it and supplies "Paris". The round produces one token, and the draft work is wasted. That is why the draft model matters so much. A draft that agrees often is worth far more than a draft that is merely fast.
Why the output does not change
Done correctly, speculative decoding returns the same output distribution, the odds of every possible answer, as running the large model alone. It is not an approximation. It is not a smaller model pretending to be a big one.
The reason is the acceptance rule. At each position, the target model decides. A draft token is kept only when the target would have produced it. When the target disagrees, its own token wins. The draft only proposes. The target disposes.
The original paper proved this. Leviathan, Kalman, and Matias at Google Research published "Fast Inference from Transformers via Speculative Decoding" on 30 November 2022, later an ICML 2023 oral, a paper chosen for a talk at a top AI conference. Their abstract states the result directly: faster sampling "without any changes to the outputs". DeepMind published an independent version, speculative sampling by Chen and colleagues, in February 2023, with the same guarantee.
On T5-XXL, an 11-billion-parameter model (11 billion learned numbers), at batch size 1 on one TPU-v4, the paper reported 2x to 3x acceleration against the standard T5X implementation, with identical outputs. A TPU is Google's AI chip. Batch size 1 means one request at a time.
The smallest draft, 77 million parameters, gave the biggest gain at 3.4x with greedy decoding. Greedy decoding means always picking the most likely token. A larger 800-million-parameter draft was accepted more often but cost more, and the speedup fell to 1.7x. DeepMind reported 2x to 2.5x on Chinchilla 70B, a 70-billion-parameter DeepMind model. These are paper numbers on specific hardware, not a promise for your setup.
How much speedup should you expect? The calculation
Here is the standard estimate, worked out in Python. Expected tokens per target pass, given acceptance rate alpha and speculation length gamma, is 1 minus alpha to the power of gamma plus 1, divided by 1 minus alpha. Speedup divides that by the draft cost, set here at 5 percent of a target pass per draft token. That 5 percent is an assumption, stated here. It is roughly right for a draft model about twenty times smaller than the target.
The acceptance rate is the share of draft tokens the target agrees with. If alpha is 0.7, the target accepts about 7 in 10 draft tokens.
Here is the output.
alpha=0.6 gamma=3: expected tokens=2.18, speedup ~1.89x
alpha=0.6 gamma=4: expected tokens=2.31, speedup ~1.92x
alpha=0.6 gamma=5: expected tokens=2.38, speedup ~1.91x
alpha=0.7 gamma=3: expected tokens=2.53, speedup ~2.20x
alpha=0.7 gamma=4: expected tokens=2.77, speedup ~2.31x
alpha=0.7 gamma=5: expected tokens=2.94, speedup ~2.35x
alpha=0.8 gamma=4: expected tokens=3.36, speedup ~2.80x
alpha=0.8 gamma=5: expected tokens=3.69, speedup ~2.95x
Two lessons sit in that table. First, acceptance rate matters more than speculation length. Going from 0.6 to 0.8 acceptance at gamma 4 lifts the speedup from 1.92x to 2.80x. Second, longer speculation has diminishing returns. At alpha 0.6, gamma 4 beats gamma 5, because the extra draft tokens are usually rejected. That is why, in this estimate, the gains flatten out around 4 to 5 tokens.
This is an estimate, not a benchmark. Real speedup depends on your draft model, your hardware, your batch size, and your text.
What decides the result in production
Three things decide whether the estimate turns into real speed.
First, the draft model. A draft that is too small guesses badly and wastes target passes. A draft that is too big costs too much per guess. The original paper showed this directly: the 77 million parameter draft beat the 800 million parameter one, because it was cheap enough that its lower acceptance did not matter. The right draft is the smallest model that still agrees with the target often on your actual traffic.
Second, the speculation length. The calculation above shows the gain flattening around 4 to 5 tokens. vLLM's own examples speculate 5 tokens at a time. Start there and measure.
Third, the trade offs. The draft must run before the first verified token appears, so time to first token, the delay before the user sees anything, does not get the same benefit. The draft model also needs its own memory and its own KV cache, its stored notes about earlier tokens, alongside the target. That memory could otherwise hold more requests, so concurrency, how many requests run at the same time, can drop. vLLM's documentation describes speculative decoding as a technique for reducing inter-token latency in memory-bound, medium to low traffic workloads, and warns that it does not speed up every prompt set or sampling setting.
When it helps and when it does not
Speculative decoding helps most when one request runs at a time and the GPU has idle compute. That is the classic chatbot case: one user, one stream of tokens, and a memory-bound decode step (decode is the phase where the model writes one token at a time). Memory bound means the speed limit is moving data, not doing arithmetic.
It helps less in three situations.
Low acceptance rate kills it. If the draft agrees only half the time, most draft work is thrown away. Repetitive text like code has high acceptance. Open-ended creative writing has lower acceptance. Measure acceptance on your own traffic before deciding.
Large batches kill it. At large batch sizes the GPU is already busy, so there is no idle compute left for verification. Speculative decoding is a latency technique for low-concurrency serving, not a throughput technique for saturated servers. Latency is delay. Throughput is how much work gets done per second.
Memory pressure kills it. The draft model needs weights and KV cache. On a full GPU the draft steals memory from the target's cache, which reduces concurrency. Throughput per request can go up while the number of requests that fit at once goes down.
flowchart TD A[Thinking of speculative decoding] --> B{Large batches, GPU already busy?} B -- Yes --> X[Little idle compute: small gain] B -- No --> C{Draft agrees often on your traffic?} C -- No --> Y[Low acceptance: draft work wasted] C -- Yes --> D{Spare memory for draft weights and KV cache?} D -- No --> Z[Draft steals cache: concurrency drops] D -- Yes --> E[Good fit: try 4 to 5 tokens, measure]
Diagram: Three things kill the gain: big batches, low acceptance and memory pressure.
The other ways to draft
A separate small model is the classic draft source, but it is not the only one. vLLM supports several methods through its speculative config, checked on 14 November 2026. vLLM is an open-source serving engine for large models.
The n-gram method needs no second model. An n-gram is a short sequence of tokens that already appeared. The method proposes tokens by matching recent context against text that already appeared, which works well when the output repeats the input, as in summarisation or code editing.
EAGLE is a small trained head that predicts the target's next tokens from its hidden states. Hidden states are the numbers inside the model between layers. EAGLE usually gives higher acceptance. Multi-token prediction builds the ability to predict several tokens at once into the model itself.
For a first try, n-gram costs nothing and needs no extra model. If it helps, a draft model is the next step. If neither helps, your workload probably has low acceptance or high batch sizes.
Copy-paste: try it in vLLM
This is the draft-model form. It starts vLLM as a server with vllm serve; each flag is an option added to the command. The command follows the vLLM documentation, checked 14 November 2026. Replace the model names with your own pair. Check the current vLLM docs before you run it, because the speculative decoding flags have changed across versions.
bashvllm serve meta-llama/Llama-3.1-70B-Instruct \ --tensor-parallel-size 4 \ --speculative-config '{"model": "meta-llama/Llama-3.2-1B-Instruct", "num_speculative_tokens": 5}'
Tensor parallel size 4 means the model is split across 4 GPUs. Start with 5 speculative tokens, measure acceptance and tokens per second, then try 4 and 3. The number that wins on your traffic is the right number.
Try this
Run the Python estimate with your numbers. Replace alpha with a guess about your draft, then change gamma from 3 to 6 and watch the curve. Then, if you serve a model in vLLM, enable n-gram speculation and measure tokens per second with it on and off on the same prompts. The gap between the estimate and the measurement tells you your acceptance rate.
What to read next
The cache decides how much fits on your GPU. Read the KV cache article to work out your memory budget first. Then read the temperature 0 article, the third in this cluster.
FAQs
What is speculative decoding in simple terms? A small model guesses several tokens ahead, and the large model checks them all in one pass.
Does speculative decoding change the output? No, when done correctly. The target model has the final say on every token, so the output distribution is the same as running the target alone.
How much faster is speculative decoding? The original paper reported 2x to 3x on T5-XXL at batch size 1 on one TPU-v4. Real results depend on acceptance rate, batch size, and hardware.
What is a good speculation length? In the estimate above, gains flatten around 4 to 5 tokens, and vLLM's own examples speculate 5 tokens at a time. Longer speculation adds rejected tokens faster than accepted ones. Measure on your own traffic.
Why does speculative decoding hurt concurrency? The draft model needs its own weights and KV cache, which take GPU memory that could otherwise hold more requests.
Sources
- Leviathan, Kalman, and Matias, "Fast Inference from Transformers via Speculative Decoding", ICML 2023. https://arxiv.org/abs/2211.17192
- Chen and colleagues, "Accelerating Large Language Model Decoding with Speculative Sampling", DeepMind, February 2023. https://arxiv.org/abs/2302.01318
- vLLM documentation, Speculative Decoding. Draft model, n-gram, EAGLE and multi-token prediction methods; examples speculating 5 tokens at a time; aimed at memory-bound, medium to low traffic workloads. https://docs.vllm.ai/en/v0.7.0/features/spec_decode.html
