Before you start: words you need#
| Word | Plain meaning |
|---|---|
| Target model | The model whose output you actually want. It verifies the guesses. |
| Drafter | Whatever proposes the guesses: a small model, a trained head, the model’s own MTP layers, or a text search (12.n). |
| k | How many tokens are drafted per step (num_speculative_tokens in vLLM). |
| α (acceptance rate) | The fraction of drafted tokens the target accepts. |
| c (cost ratio) | How long one draft pass takes compared with one target pass. |
| Acceptance length | Tokens produced per verify step: accepted drafts plus the one “bonus” token the target always adds. The best single health number. |
| Rejection sampling | The rule that accepts or replaces each drafted token so the output distribution is exactly the target’s (12.n). |
| Rollback | Discarding the KV cache entries written for rejected tokens. |
12.n taught the algorithm and the theory. This lesson is about deployment: which drafter to pick, how to tune it, how it interacts with batching and the rest of the engine, and how to tell whether it is helping. 13.o compares the drafter families in depth.
Facts checked on 12 November 2026 (vLLM v0.32.0).
1. What is it? The deployment decision#
START: is your workload decode-bound at LOW to MODERATE batch?
├─ NO (prefill-heavy, or always at very high batch)
│ → speculation helps little or hurts. Skip it, or use a
│ confidence-scheduled drafter (13.o) that backs off under load.
│
└─ YES
├─ Does the model ship MTP layers? (DeepSeek-V3/V4, GLM-4.5+/5.x,
│ Qwen3-Next, many 2026 models)
│ → use them: "method": "mtp". Nothing to find or train.
│
├─ Is there a published EAGLE-3 or parallel drafter (DFlash, P-EAGLE,
│ DSpark) for your exact model?
│ → use it. The highest acceptance you can get without training.
│
├─ Does output often COPY from input? (summarization, editing, RAG,
│ code edits, agents re-reading files)
│ → n-gram or suffix decoding. Free, no extra model. Try it first
│ anyway — it may be all you need.
│
└─ Otherwise: a small model from the same family with the same tokenizer
→ "method": "draft_model". 1.5–2.5×, costs memory.
Or train an EAGLE-3 / parallel head with Speculators (13.o).Try the free options first. N-gram and suffix decoding cost nothing, and native MTP is already in the checkpoint. Many teams jump straight to training heads and never measure the free path.
2. Why does it matter?#
Decode at small batch is memory-bound (12.c): each step reads all the weights to produce one token per sequence, leaving most of the GPU’s arithmetic idle. Speculation spends that idle arithmetic on verifying several guessed tokens in one pass. When it works, per-user speed rises 2–3× with identical output — the rare optimization that changes nothing about quality.
The catch is that “idle arithmetic” disappears as batch grows (section 5). Speculation is a low-to-moderate-load optimization that must know when to step aside.
3. Simple analogy#
An assistant who drafts replies for a busy manager.
When the manager is idle, checking five drafted sentences takes no longer than writing one, so a good assistant triples the output. A bad assistant (low α) wastes the checking. A slow assistant (high c) makes the manager wait. And when the manager’s inbox is full (high batch), every minute spent checking drafts is a minute not spent on someone else’s letter.
4. Tiny example: turn it on and read the numbers#
# Native MTP (if the model has it)
vllm serve <model> --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}'
# A published parallel drafter (from the vLLM Speculators announcement)
vllm serve Qwen/Qwen3-30B-A3B --tensor-parallel-size 2 \
--speculative-config '{"model": "RedHatAI/Qwen3-30B-A3B-speculator.dflash",
"method": "dflash", "num_speculative_tokens": 7}'
# Free: prompt lookup
vllm serve <model> --speculative-config \
'{"method": "ngram", "num_speculative_tokens": 4, "prompt_lookup_max": 4, "prompt_lookup_min": 2}'Then read vLLM’s Prometheus counters (19.c) over a minute of traffic:
vllm:spec_decode_num_drafts 12,000 verify steps that had a draft
vllm:spec_decode_num_draft_tokens 84,000 = 12,000 × k (k = 7)
vllm:spec_decode_num_accepted_tokens 33,600
acceptance rate = 33,600 / 84,000 = 0.40
acceptance length = 1 + 33,600 / 12,000 = 3.8 tokens per verify stepAn acceptance length of 3.8 means each target pass produces 3.8 tokens instead of 1. Whether that is a speedup depends on what the drafting cost (section 6) — so the decisive check is always end-to-end tokens per second with and without speculation, at the same load.
5. Technical explanation#
Choosing and sizing a draft model#
Requirements:
1. SAME TOKENIZER as the target. Non-negotiable.
2. Same family, ideally distilled from the target → higher α.
3. c = draft_time / target_time well under 0.1.
Illustrative pairings (α and speedups vary with task):
Llama-3.1-70B ← Llama-3.2-1B c ≈ 0.02, α ≈ 0.65 ~2×
Llama-3.1-70B ← Llama-3.1-8B c ≈ 0.11, α ≈ 0.75 ~1.9×
Qwen2.5-72B ← Qwen2.5-0.5B c ≈ 0.01, α ≈ 0.60 ~1.9×
Bad pairings:
70B ← a 13B draft c too high; the draft eats the gain
Llama ← Mistral draft different tokenizers; does not workA smaller, less accurate draft often beats a larger, more accurate one, because c matters as much as α. Recompute 12.n’s formula for your candidates before choosing.
Tuning k#
Rule of thumb: k ≈ 1/(1−α) for sequential drafters — then measure.
α = 0.6 → k = 2–3; α = 0.75 → k = 4; α = 0.85 → k = 6–7
Parallel drafters (DFlash, P-EAGLE, DSpark) draft all k tokens in one pass,
so larger k is cheap — published configs use k = 7 or more. The limit
becomes verification cost at high batch, not drafting.
Adaptive k:
Code and structured output draft well → larger k.
Creative prose drafts poorly → smaller k or none.
vLLM v0.32.0 offers dynamic speculative decoding (adjusts to load) and
adaptive verification (verifies only the tokens the drafter is confident
in; currently with DSpark).The batch-size interaction (the critical caveat)#
Verification = k+1 tokens through the target, per sequence.
At batch B, one target pass processes B × (k+1) tokens instead of B.
B = 1, k = 4: 5 tokens. Still memory-bound. Verification ~free. ✓
B = 32, k = 4: 160 tokens. Approaching compute-bound. Costs something.
B = 128, k = 4: 640 tokens. Compute-bound. Verification COSTS REAL TIME. ✗Illustrative shape of the curve (70B target, 1B draft, α = 0.7, k = 4):
batch 1: ~2.1×
batch 16: ~1.6×
batch 64: ~1.2×
batch 128: ~0.95× ← now a LOSSA fixed configuration that helps at 3 a.m. can hurt at peak. Gate it: shorter k or no speculation as the running batch grows, or use the engine’s load-aware modes. A starting threshold is roughly the ridge point (6.a) divided by k+1, then measure.
Interaction with the rest of the engine#
FEATURE INTERACTION
Continuous batching ⚠ each sequence accepts a different number of tokens;
the scheduler books k+1 slots and returns the rest
CUDA graphs ✓ in vLLM, verify steps are "uniform decode" graphs
with 1+k tokens per request (13.k)
Paged KV cache ⚠ blocks for k+1 tokens are written, then rejected
entries must be rolled back
Prefix caching ✓ compatible
Quantization ✓ compatible; check acceptance after quantizing —
vLLM v0.32.0 fixed NVFP4 checkpoints with 0% acceptance
Pipeline parallelism ✓ supported for EAGLE-3, MTP and DSpark in recent releases
Structured output ⚠ the grammar must constrain drafts too, or they are
wasted on invalid tokensThe KV interaction is the one people underestimate. Drafted tokens write K and V into the cache. When they are rejected, the block manager must roll those entries back. Getting this wrong causes subtle corruption.
6. Under the hood: what to measure#
Per request type and in aggregate:
acceptance_rate = accepted_tokens / drafted_tokens
acceptance_length = 1 + accepted_tokens / drafts
per-position accept = how often position 1, 2, … k is accepted
(vllm:spec_decode_num_accepted_tokens_per_pos)
draft_time_fraction = drafting time / step time
effective_speedup = baseline inter-token latency / current inter-token latency
The decisive one:
tokens per second WITH vs WITHOUT speculation, at the same batch sizePer-position acceptance tells you where to set k: once position j is accepted less than ~30–40% of the time, drafting beyond j rarely pays for a sequential drafter.
Warning signs:
acceptance length < 1.5 → drafter poorly matched; reconsider
draft_time_fraction > 0.25 → drafter too expensive
speedup < 1.1 at batch 1 → something is wrong; check the setup
speedup < 1.0 at your p50 batch → gate it or switch it off
acceptance collapses after a quantization or model update → the head no
longer matches the target; retrain or replaceIf you cannot A/B it, you do not know whether it is helping.
7. Performance implications#
Method Best case Typical Extra memory Engineering
n-gram / suffix ~3× 1.3–2× none trivial
Draft model ~2.5× 1.5–2× draft weights moderate
EAGLE-3 head ~4–6× 2–3× small head none if published
Parallel drafter ~5–6× 2–3.5× small model none if published
MTP (native) ~2.5–3× 1.6–2.2× built in noneBest case = favourable content, batch 1, from the papers. Typical = realistic mixed traffic at moderate batch, and a much better guide. The gap is why published speedups disappoint in production: papers benchmark at batch 1 on favourable tasks.
8. Production implications#
- Use MTP if the model has it; otherwise a published EAGLE-3 or parallel drafter; n-gram for copy-heavy work.
- Gate on load. Non-negotiable for a system with varying traffic.
- Budget the drafter’s memory as KV cache you gave up. A 1B draft model is ~2 GB of weights plus its own KV.
- Monitor acceptance per workload type. It varies enormously and shows where speculation earns its keep.
- Re-validate after every target change. A new checkpoint, fine-tune or quantization can silently break a trained drafter.
- Verify distribution equivalence in tests: at temperature 0, speculative and normal decoding should produce the same output (allowing for rare last-bit differences from batch shape, 11.k). Systematic differences mean the rejection sampling is wrong.
- Treat it as a later optimization (13.a): batching and quantization first.
9. Common mistakes#
- Not gating on batch size. A regression at peak load.
- Choosing a draft that is too large. c matters as much as α.
- Mismatched tokenizers. Does not work; sometimes fails with garbage.
- Skipping the rejection-sampling correction. You are now serving the draft model.
- Not measuring acceptance. Flying blind.
- Forgetting KV rollback for rejected tokens. Subtle corruption.
- Using a drafter trained for a different version of the target. Acceptance collapses.
- Believing paper speedups. Benchmark your workload at your batch sizes.
10. Hands-on exercise#
A. Free first. Enable n-gram speculation in vLLM. Measure speedup on (i) summarization, (ii) code editing with the file in context, (iii) open-ended creative writing. Explain the differences with acceptance length.
B. Draft model selection. For a target you can run, evaluate two or three draft models. Measure α and c for each, predict the speedup with 12.n’s formula, then measure it.
C. Batch gating. Measure speedup at batch 1, 4, 16, 64 and 128. Find where speculation stops helping on your hardware.
D. Tune k. Plot per-position acceptance for k = 7. Choose k from the plot, then confirm with end-to-end tokens per second.
E. Verify equivalence. At temperature 0, compare speculative and normal decoding over 100 prompts. Investigate every difference.
F. KV rollback. Construct a test that would catch a block manager that forgets to discard rejected tokens’ KV.
11. Interview questions#
- Which drafter would you try first for a new model in 2026, and why?
- Why does a smaller, less accurate draft sometimes beat a larger, more accurate one?
- Why must speculation be gated on load? Where does it stop helping?
- What does speculative decoding do to the KV cache, and what must the block manager support?
- How would you choose k, and why does the answer differ for parallel drafters?
- Which metrics tell you whether speculation is working?
- Why do published speedups exceed what you see in production?
12. Further reading#
Checked on 12 November 2026.
- [ESTABLISHED] Leviathan et al., “Fast Inference from Transformers via Speculative Decoding” (2022); Chen et al., “Accelerating LLM Decoding with Speculative Sampling” (2023)
- [ESTABLISHED] Li et al., “EAGLE-3” (2025)
- [REFERENCE] vLLM speculative decoding documentation — methods, dynamic speculation, adaptive verification, metrics
- [REFERENCE] vLLM blog: parallel drafting in Speculators (July 2026)
- [ESTABLISHED] DeepSeek-AI, “DeepSeek-V3 Technical Report” — native multi-token prediction
- [REFERENCE] vLLM’s implementation — read it in 18.f