Speculative decoding in depth: acceptance maths, draft length and adaptive verification
Speculative decoding lets a cheap drafter guess several tokens and a large model check them in one pass. This article derives the acceptance rule and the expected speed-up, works the numbers, and explains why servers now size the draft per request instead of fixing it.
- Reading time
- 16 min
- Sections
- 8
- Code examples
- 3
- Tables
- 2
- Sources
- 10
- Published
- 23 Nov 2026
- What changed
- vLLM 0.34.0 is published
- Why it matters
- Speculative decoding is a latency tool first.
- What to do
- Measure your baseline first
Large language models write one token at a time. Each new token needs a full pass through the model, and at small batch sizes that pass is limited by how fast the GPU can read the weights from memory, not by arithmetic. The GPU spends most of each step waiting for data while its compute units sit partly idle.
Speculative decoding uses that idle compute. A cheap drafter guesses the next few tokens, and the large target model checks all of them in one forward pass. When the guesses are right, several tokens come out of a single expensive step. A clever acceptance rule guarantees the output has exactly the same distribution as if the target model had generated alone.
The technique is now a standard part of serving stacks, and the engineering focus has shifted. The open question is no longer whether to speculate but how much, and the answer changes with load. This article derives the core maths, works through the numbers, and explains the adaptive approaches that recent serving releases document.
What happened
vLLM 0.34.0 is published (16 November 2026)
The vLLM project published version 0.34.0 on PyPI on 16 November 2026, two weeks after 0.33.0. The project's current speculative decoding documentation lists model-based methods (EAGLE, multi-token prediction or MTP, separate draft models, and newer parallel drafters such as DFlash and DSpine) alongside cheaper methods such as n-gram and suffix decoding. It states that model-based methods give the best latency reduction, while n-gram and suffix decoding give modest speed-ups without adding work during peak traffic.
Speculation becomes load-aware
The same documentation describes two load-aware features. Dynamic speculative decoding lets operators set the number of draft tokens per range of concurrent requests, down to zero at high concurrency. Adaptive verification, off by default, goes further: it decides at each step how many draft tokens to verify for each request, using estimated acceptance probabilities and a cost model profiled at startup. vLLM also documents experimental per-request acceptance metrics returned in the API response. These features are the practical answer to a problem the maths below makes clear.
How the acceptance rule keeps output exact
Let the target model's next-token distribution be p(x) and the drafter's be q(x). The drafter samples a token x from q. The verifier accepts it with probability
min(1, p(x) / q(x)).
If the token is rejected, the verifier samples a replacement from the residual distribution
r(x) = max(0, p(x) − q(x)) / Σ max(0, p(y) − q(y)).
This scheme, introduced by Leviathan, Kalman and Matias in a 2022 paper and independently by Chen and colleagues at DeepMind in 2023, produces tokens whose distribution is exactly p. Intuitively, where the drafter is over-confident (q above p) some of its tokens are thrown back, and the residual distribution adds probability exactly where the drafter was under-confident.
A small example makes it concrete. Take a three-token vocabulary with p = (0.5, 0.3, 0.2) and q = (0.3, 0.5, 0.2). The probability of accepting a draft is
α = Σ min(p(x), q(x)) = 0.3 + 0.3 + 0.2 = 0.8.
The residual distribution puts all its mass on the first token, because only there is p above q: r = (1, 0, 0). A simulation of 200,000 draws with this rule gives output frequencies of 0.500, 0.300 and 0.199, matching p. The quantity α is one minus the total variation distance between p and q, so the better the drafter imitates the target, the higher α.
Here is the check in Python:
import numpy as np
p = np.array([0.5, 0.3, 0.2]); q = np.array([0.3, 0.5, 0.2])
rng = np.random.default_rng(0); out = np.zeros(3)
for _ in range(200_000):
x = rng.choice(3, p=q)
if rng.random() < min(1, p[x] / q[x]):
out[x] += 1
else:
r = np.maximum(p - q, 0); out[rng.choice(3, p=r / r.sum())] += 1
print(np.minimum(p, q).sum(), out / out.sum()) # 0.8, about [0.5 0.3 0.2]
With greedy decoding the rule simplifies: a draft token is accepted only if it equals the target's top token. vLLM's configuration exposes this choice through draft_sample_method, where greedy uses target-only acceptance and probabilistic keeps the full draft distribution for probability-ratio acceptance.
How many tokens each step yields
The drafter proposes γ tokens in a row. The verifier checks them in order and stops at the first rejection. Even if all are rejected, the target's pass still yields one token (the replacement), and if all γ are accepted it yields a bonus token from its own distribution.
If every draft token is accepted independently with probability α, the expected number of tokens per target pass is
E[tokens] = (1 − α^(γ+1)) / (1 − α).
For α = 0.8 and γ = 4 this is (1 − 0.8^5) / 0.2 = (1 − 0.32768) / 0.2 = 3.36 tokens per step instead of one.
That is not the speed-up, because drafting costs time. If one drafter step costs c times a target step, a full speculative step costs γc + 1. The wall-clock speed-up is
S = (1 − α^(γ+1)) / ((1 − α)(γc + 1)).
With c = 0.05, a drafter one twentieth the cost of the target, the numbers look like this:
| Draft length γ | Tokens per step, α = 0.6 | Speed-up, α = 0.6 | Tokens per step, α = 0.8 | Speed-up, α = 0.8 |
|---|---|---|---|---|
| 1 | 1.60 | 1.52 | 1.80 | 1.71 |
| 2 | 1.96 | 1.78 | 2.44 | 2.22 |
| 4 | 2.31 | 1.92 | 3.36 | 2.80 |
| 6 | 2.43 | 1.87 | 3.95 | 3.04 |
| 8 | 2.47 | 1.77 | 4.33 | 3.09 |
| 10 | 2.49 | 1.66 | 4.57 | 3.05 |
Two lessons follow. First, the best draft length depends on α. At α = 0.6 the speed-up peaks at γ = 4 (1.92 times); at α = 0.8 it peaks at γ = 8 (3.09 times). Second, the curve is flat near the peak and then falls, because later draft positions rarely survive: the chance that position k is reached and accepted is α^k, which for α = 0.6 is under 8 percent at k = 5.
This model is a simplification. Real acceptance is not independent across positions, and it varies between prompts: code with repeated identifiers is easy to guess, open-ended prose is not. That variation is why measured acceptance per request matters.
Measuring acceptance in practice
The useful production metric is mean acceptance length: total tokens produced divided by the number of speculative steps. vLLM's per-request metrics documentation shows an example response, next to an n-gram configuration, with three speculative tokens per step: 43 steps, 129 draft tokens proposed, 10 accepted. The mean acceptance length is (43 + 10) / 43 = 1.23 tokens per step, and the draft acceptance rate is 10 / 129 = 7.8 percent. That request barely benefited, which is what happens when a drafter such as n-gram lookup finds few repeated patterns to copy.
Where the drafts come from
The drafter is the main design choice. Each option trades acceptance against cost and operational effort.
| Drafter | How it guesses | Strength | Cost |
|---|---|---|---|
| Separate draft model | A small model from the same family runs its own forward passes | Simple, reuses existing models | Needs its own weights and KV cache |
| EAGLE-style head | A light head predicts from the target's hidden states | High acceptance for little compute | Must be trained per target model |
| Multi-token prediction | Extra prediction modules trained with the model | Strong when the model ships them | Only for models with native MTP |
| N-gram lookup | Copies continuations found in the prompt | No extra model | Low acceptance outside repetitive text |
| Suffix decoding | Matches against the prompt and earlier responses | No extra model; learns repeated outputs | Gains depend on repetition across requests |
EAGLE, introduced in a 2024 paper, drafts at the feature level: rather than running a separate small language model, it predicts the target's next hidden state from its current one and reuses the target's output head. Its follow-up, EAGLE-2, drafts a dynamic tree of candidates instead of a single chain, so the verifier can check several branches in one pass. vLLM's documentation lists configuration for EAGLE and EAGLE-3 heads, MTP and parallel drafters, and points to a companion project for training custom draft models.
An everyday analogy helps here. A senior editor (the target) can check a paragraph almost as fast as a sentence, because reading is cheap compared with writing. A junior writer (the drafter) types quickly. If the junior knows the editor's style well, most of each paragraph survives review. If not, the editor spends the same review time and keeps only a few words.
Why load changes the answer
Everything above assumes spare compute. At batch size 1, decoding is memory-bound, so checking five tokens costs nearly the same as checking one. vLLM's adaptive verification documentation puts the problem directly: at batch size 1 the extra draft tokens are close to free, but at batch size 256 they compete with real tokens for the same compute, and every rejected token is wasted compute. Its dynamic speculative decoding page describes the same effect: with K draft tokens per sequence, the effective batch becomes batch size times K, and past a critical size speculation slows decoding.
Dynamic draft length by concurrency
The simple fix is a lookup table. vLLM's num_speculative_tokens_per_batch_size setting takes entries of the form [start_bs, end_bs, optimal_K]. The documented example uses K = 3 for 1 to 64 concurrent requests, K = 1 for 65 to 128, and K = 0, meaning no speculation, for 129 to 512. The documentation notes a reinforcement learning use: a rollout starts with a large batch, but the last few long responses run at a small batch, where a higher K helps finish the long tail.
vllm serve meta-llama/Llama-3.1-8B-Instruct \
--speculative-config '{
"method": "eagle3",
"model": "yuhuili/EAGLE3-LLaMA3.1-Instruct-8B",
"num_speculative_tokens": 3,
"num_speculative_tokens_per_batch_size": [[1, 64, 3], [65, 128, 1], [129, 512, 0]]
}'
Adaptive verification: spend the budget where it survives
Adaptive verification replaces the table with a per-step decision. Each draft slot, a pair of request and position, gets a survival score: the running product of that request's per-position acceptance estimates. The scheduler admits the highest-scoring slots until a global budget is spent, and the budget comes from a cost model that measures what a step costs at each shape and picks the token count that maximises expected accepted tokens per second. Acceptance estimates come from a confidence head when the checkpoint ships one, from an online logistic model on draft logits for other model-based drafters, or from past acceptance statistics for suffix decoding.
A worked example shows why ranking slots across requests helps. Request A has an estimated acceptance of 0.9 at every position; request B has 0.5. With four draft positions each, the survival scores are:
- A: 0.9, 0.81, 0.729, 0.656
- B: 0.5, 0.25, 0.125, 0.0625
Verifying all eight slots yields an expected 3.10 + 0.94 = 4.03 accepted draft tokens. If the budget allows only five slots, the scheduler takes all four of A's slots and B's first slot. Expected accepted tokens fall only to 3.60, which is 89 percent of the full value for 62.5 percent of the verification work. Position 4 of a confident request (0.656) outranks position 2 of a doubtful one (0.25), exactly as the vLLM documentation describes.
The documentation lists real limits. Adaptive verification needs full CUDA graphs because step costs are profiled from captured graphs, is not supported with LoRA or pipeline parallelism, and profiles against a synthetic context of 8,192 tokens by default, which long-context deployments may want to raise.
Continue learning
How this article connects
7 pages link to or from it. Drag to turn, click a dot to open it.
- vLLM
- The new LLM serving stack: cache-aware routing, continuous batching and
- Serving LLMs efficiently: quantization, batching, caching, routing and a
- Ant's Ling-3.2-air and LingSante-3.1: open hybrid-linear MoE models for
- Meta's Muse family for developers: Ember, Spark Open weights, Glimmer an
- Gemma 4 in late 2026: five sizes, Apache 2.0, EmbeddingGemma 2 and how t
- Clover-35B-A3B: a diffusion language model that reports 73.6 on SWE-benc
What it means in practice
Speculative decoding is a latency tool first. For chat, coding assistants and agents with few concurrent users per replica, it can cut time per output token substantially, because each target step yields several tokens. For high-throughput batch jobs it can hurt, because drafts take compute from real requests. The LLM serving stack article explains how continuous batching already fills the GPU at high load, which is exactly when speculation stops being free.
The quality of the drafter matters more than the draft length. Moving α from 0.6 to 0.8 raises the best speed-up in the table from 1.92 to 3.09 times. A drafter trained on your own traffic, or a model with native MTP, is often worth more than any tuning of γ. And since the acceptance rule is exact, none of this changes output quality when sampling is probabilistic; it only changes speed and cost.
The speculative decoding simulation lets you vary α and γ and watch the tokens per step change, and the KV cache simulation shows why each decode step is memory-bound in the first place.
What to do now
- Measure your baseline first. Record time per output token and throughput at your real concurrency before enabling any speculation, so you can see both gains and losses.
- Start with the drafter your model supports. Use native MTP if the model ships it, an EAGLE-style head if one exists for your model, and n-gram or suffix decoding for repetitive workloads such as code edits or document rewrites.
- Log acceptance per request. Turn on per-request acceptance metrics where available and track mean acceptance length by workload type, not just a global average.
- Fit γ to measured α. Use the formula above with your measured acceptance and drafter cost to find the peak, then confirm with a benchmark sweep.
- Make speculation load-aware. Configure draft length by concurrency, or try adaptive verification, so that speculation backs off when the GPU becomes compute-bound.
- Raise the profiling context for long prompts. If you serve long contexts with adaptive verification, set the profiling context length closer to your real traffic so the cost model is realistic.
- Check feature interactions. Confirm that your combination of LoRA adapters, pipeline parallelism, quantisation and drafter is supported before rolling out.
- Retrain drafters after fine-tuning. A drafter trained on the base model loses acceptance when the target is fine-tuned, so retrain or distil it on outputs from the deployed model.
Risks and open questions
Lossy verifiers trade exactness for speed. vLLM documents a lossy verifier called FLy alongside the exact rule. Lossy modes can change outputs, so they need the same evaluation as any model change.
Benchmarks overstate production gains. Speed-ups measured at batch size 1 on repetitive prompts do not carry over to busy servers with diverse traffic.
Drafters drift. When the target model or the traffic mix changes, acceptance falls quietly. Without per-request metrics, the only symptom is a slow rise in latency.
Energy and cost accounting is still young. Rejected tokens consume compute and power. Research on energy accounting of speculative decoding under latency targets is starting to measure this, but cost-per-accepted-token figures are rarely published.
Watch next: whether adaptive verification becomes the default in major serving engines, how parallel drafters such as DFlash compare with EAGLE heads across model families, and whether model releases increasingly ship native MTP modules or confidence heads.
Frequently asked questions
Does speculative decoding change the model's answers?
Not with the standard acceptance rule. Accepting with probability min(1, p/q) and resampling rejections from the residual distribution gives exactly the target distribution, and with greedy decoding the output matches the target's greedy output.
What acceptance rate do I need for it to help?
It depends on the drafter's cost. With a drafter costing 5 percent of the target, even α = 0.6 gives a best-case speed-up near 1.9 times in the simple model. A slower drafter needs a higher α to break even.
Why does speculation slow down busy servers?
At high batch sizes the GPU is compute-bound, so each draft token takes compute away from real tokens. Rejected drafts are pure waste, and past a critical batch size the waste outweighs the saved steps.
What is the difference between dynamic speculation and adaptive verification?
Dynamic speculation picks one draft length for all requests based on current concurrency, from a table you configure. Adaptive verification scores every request and position by estimated survival probability and admits the best slots up to a profiled compute budget each step.
Should I use n-gram drafting or a trained drafter?
N-gram and suffix methods need no extra model and do well on repetitive text such as code edits, but acceptance can be very low on open-ended text. Trained drafters such as EAGLE heads or native MTP usually accept more tokens across general traffic.
Summary
Speculative decoding turns spare GPU compute into fewer sequential steps. A drafter proposes γ tokens, the target verifies them in one pass, and the min(1, p/q) rule with residual resampling keeps the output distribution exact. The expected yield per step is (1 − α^(γ+1)) / (1 − α), and the speed-up divides that by the drafting cost, which makes acceptance rate α the variable that matters most. Because spare compute disappears as batches grow, current serving engines make speculation load-aware, either with draft length tables by concurrency or with per-request adaptive verification. Measure acceptance per request, fit the draft length to it, and let speculation back off under load. For more on the method, see the speculative decoding and vLLM pages and the serving and cost topic.
Sources
- Paper arXiv: Fast Inference from Transformers via Speculative Decoding (Leviathan, Kalman, Matias)
- Paper arXiv: Accelerating Large Language Model Decoding with Speculative Sampling (Chen et al.)
- Paper arXiv: EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty
- Paper arXiv: EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees
- Docs vLLM docs: Speculative Decoding
- Code vLLM on GitHub: Adaptive Verification
- Code vLLM on GitHub: Dynamic Speculative Decoding
- Code vLLM on GitHub: Per-Request Acceptance Metrics
- Code PyPI: vllm release history
- Paper arXiv: Only Accepted Tokens Count: An Energy Accounting of Speculative Decoding Under Latency Targets
Cite this article
Kelahmet, Ö. C. (2026, November 23). Speculative decoding in depth: acceptance maths, draft length and adaptive verification. Özer Cem KELAHMET. https://www.ozercemkelahmet.com/articles/speculative-decoding-acceptance-adaptive-verification
BibTeX
@online{kelahmet2026speculative,
author = {Kelahmet, {\"O}zer Cem},
title = {{Speculative decoding in depth: acceptance maths, draft length and adaptive verification}},
year = {2026},
month = {nov},
url = {https://www.ozercemkelahmet.com/articles/speculative-decoding-acceptance-adaptive-verification}
}Version historyfirst version
- Published
Factual corrections are listed here with what changed. Wording and formatting edits are not listed.