Speculative decoding: draft models, EAGLE, MTP, n-gram, the batch-size crossover

How a large model emits several tokens per forward pass without changing what it would have said: why checking guesses is nearly free, the acceptance rule and why it is exact, tokens per step, the cost model and the batch-size crossover, every kind of drafter, trees. Real Qwen3 models measured on an Apple M1 Pro; published GPU results kept apart. A child of Topic: inference-and-serving. Data as of October 2026. Reading: 36 min, plus 8 in closed details.

The idea in one screen

While decode is memory-bound, a forward pass over a few tokens costs little more than over one, so a cheap drafter guesses the next k tokens and the large target model checks them all in one pass; an acceptance rule keeps exactly what the target would have sampled, so the output is unchanged and only the time per token falls, until the batch is large enough that checking stops being free.

Fig. 1 is one round on a real position: the code-edit answer at “Calculate the mean of”, with the distributions recorded from both models measured here (Qwen3-1.7B target and Qwen3-0.6B draft, 4-bit MLX), read greedily.

  1. Plain decoding. The target, its weights drawn as glass plates, writes “a list of numbers” in four passes, one token each, and every pass reads every weight from memory. That read, not the arithmetic, sets the time (section 1).
  2. Draft. The draft, from the same family so it shares the tokenizer, runs four small passes and guesses “ a”, “ list”, “ of”, “ floats”; q is its probability for each guess (0.59 for “ floats”).
  3. Verify in one pass. The target runs once over the last accepted token plus the four guesses. A transformer gives a next-token distribution at every input position, so one read of the weights yields five distributions: the target's p for each guess (1.00, 1.00, 1.00 and 0.003), and one more for a bonus token.
  4. Accept up to the first disagreement. Greedy, a guess is kept while it equals the target's own top token. “ a”, “ list” and “ of” are; at the fourth position the target wants “ numbers” (0.996), so “ floats” is rejected and the rest of the step is thrown away.
  5. Add the target's token. “ numbers” replaces the rejected guess, so this step yields 4 tokens from one target pass. Had all four guesses survived, the fifth distribution would have added a bonus token. The draft changes how fast the text comes, never which text.
  6. Time, in target passes. Plain decoding needs 4.00. On an H100 checking 5 positions costs 1.00 pass (derived, section 1) and a draft pass 0.1 (illustrative): 1.40. On this laptop the check costs 2.68x a one-token pass and each draft pass 0.26x (Qwen3-4B with its 0.6B draft, measured): 3.72, barely a gain even with 3 of 4 guesses kept, and a loss on average (section 5).

You need: prefill, decode and why a decode step is memory-bound (the parent Topic: inference-and-serving, sections 1 and 2; the roofline is on Performance math), and what a next-token distribution and temperature are (Sampling and decoding). How multi-token prediction modules are trained is on Families and objectives; this page is how any drafter is used at serving time.

Target, drafter
the model whose output we want, and the cheap proposer of guesses (a small model, extra heads, or a lookup).
Draft length k
guesses per step (Leviathan et al. call it γ).
Acceptance α
the probability that one guess is kept; with the exact rule α = Σ min(p, q).
Acceptance length
tokens produced per target pass, between 1 and k + 1; engines report it.
Bonus token
the extra token the target adds when every guess survives.
Residual
max(0, p − q): what the target wanted and the draft under-proposed; rejections draw from it.
Cost coefficient c
one draft pass as a fraction of one target pass.
Crossover
the batch size above which speculation makes throughput worse.

Running example: the parent page's chat assistant, here a Qwen3-4B (or 1.7B) target with a Qwen3-0.6B draft from the same family, so they share a tokenizer, on an Apple M1 Pro (16-core GPU, 16 GB) with llama.cpp and MLX. Results run here are marked measured here with what transfers to datacenter GPUs; published results are marked by who measured them.

1. Why checking guesses is nearly free: decode leaves the chip idle

A language model produces one token per forward pass, and each pass depends on the token before it. During decode each pass processes one new token per user, yet it reads every weight from memory. Qwen3-4B at 4-bit (Q4_K_M) is a 2.50 GB file: every token of the answer reads those bytes once. On the M1 Pro that pass took 23.8 ms, about 42 tokens per second measured here.

At about 2 operations per weight per token, that is roughly 8 billion operations per token, so under 0.4 trillion per second, on a GPU that did 3.4 trillion per second while processing a 512-token prompt (the same weights, read once, used for 512 tokens). The arithmetic units are mostly idle; the step waits for memory: the memory-bound regime. A pass over k + 1 tokens reads the same weights once, so checking k guesses should cost little extra.

Predict: one Qwen3-4B pass over 5 tokens (4 guesses plus one) against a pass over 1 token, on the M1 Pro GPU. How much longer?

On a datacenter GPU checking is nearly free: in the derived H100 curve a pass stays within 10% of the one-token time up to about 165 tokens (a 5-token check costs 1.00x a 1-token pass, Llama 3.1 8B FP8), because the H100 does about 590 FP8 operations per byte it reads (1,979 TFLOP/s over 3.35 TB/s) and a few extra tokens use a sliver of that. On the laptop the measured curve is a staircase: 2 tokens cost 1.74x one token, 5 tokens 2.68x, yet 16 to 32 tokens only about 4.0 to 4.4 times. The steps are kernels, not physics (closed block below); Qwen3-1.7B at Q8_0, which gets the small-batch kernel from 2 tokens, costs 1.46x for 5 tokens (toggle in the chart).

What transfers from the laptop
The shape transfers: a pass over a few tokens costs much less than that many passes, because the weights are read once. Where it bends does not; it depends on hardware, weight format and kernels as much as on the model. The M1 Pro's GPU does about 5 trillion operations per second on this workload against roughly 150 GB/s of effective bandwidth (the parent's Engine bench), about 35 operations per byte, so it runs out of idle arithmetic within tens of tokens even with ideal kernels; an H100 after a hundred or more. Before trusting any speed-up, measure t(k + 1)/t(1) on your own engine and weights.
Why the laptop curve is a staircase (llama.cpp's Metal kernels)

llama.cpp's Metal backend multiplies a quantized weight matrix by 1 token with a matrix-vector kernel; it has a small-batch kernel for 2 to 8 tokens, but for the Q4_K and Q6_K formats in this file only from 4 tokens; and above 8 tokens it switches to a matrix-matrix kernel (ggml-metal-ops.cpp L2442 to L2470, ggml-metal-common.cpp L28 to L35). So 2 and 3 tokens are handled almost one at a time, which is why 2 tokens cost 1.74x and not about 1x.

A pass over a few tokens costs far less than that many passes; where it bends depends on the chip

2. One step: draft, verify, accept

Fig. 1 was one step; in general: the drafter proposes the next k tokens (typically 2 to 8; here Qwen3-0.6B runs k times in a row), and the target runs once over the last accepted token plus the k guesses, which gives k + 1 distributions. Walk the guesses left to right and keep each one the target agrees with (section 3 says exactly what "agrees" means); at the first disagreement, replace that guess with a token drawn from the target and throw away the rest; if every guess survives, take one more bonus token from the target's last distribution.

One target pass therefore yields between 1 token (the first guess was wrong: no worse than plain decoding, apart from the drafting time) and k + 1. Both models' KV caches are rolled back past rejected guesses. Here is a real answer, step by step.

Code and lists run in long green stretches; free prose breaks every few tokens

guess acceptedtoken from the target (correction or bonus)| step boundary

measured here Draft Qwen3-0.6B, target Qwen3-1.7B, k = 4, greedy; written from scratch on MLX with KV caches (the same cache handling as mlx-lm); both models 4-bit. A step that ends in a blue token had a rejection or used its bonus. Acceptance is a property of the text as much as of the drafter.

Fig. 2 · The same 16 guesses, two exact rules: the paper's keeps more of them

measured here p and q are the real distributions at that position (top 50 tokens kept on both; the 8 tokens with the largest p + q shown, guesses can fall outside them). The 16 guesses and coin flips are drawn with a fixed seed and reused by both rules, so the only difference is the rule.

3. The acceptance rule, and why it is exact

When the target samples with temperature, "agree" cannot mean "the guess equals the target's top token": we want the kept text distributed exactly as if the target had sampled it alone. Write p for the target's next-token distribution and q for the draft's, at the same position. Overlay them: the overlap min(p, q) is what can be accepted cheaply; the part of p sticking out above q is what the draft under-proposed. Here is a real position from a story the target wrote (Qwen3-1.7B target, Qwen3-0.6B draft, temperature 1), and the same 16 draft guesses judged by two exact rules (Fig. 2).

  1. One real position. The target's p (blue) and the draft's q (orange) at one position of the story; the green outline is their overlap min(p, q), and its total is α, the chance that one guess is kept.
  2. Guesses 1 to 4. Each guess x is drawn from q. If p(x) ≥ q(x) it is kept outright; otherwise it is kept when a coin falls below p(x)/q(x).
  3. Guesses 5 to 8. A rejected guess is replaced by a draw from the residual max(0, p − q): the tokens the target wanted more than the draft proposed them.
  4. Guesses 9 to 12. Tokens the draft over-proposes (q above p) are the ones rejected; tokens it under-proposes come back through the residual, so the output follows p.
  5. Guesses 13 to 16. Over many guesses the kept share approaches α = Σ min(p, q).
  6. The tally. Guesses kept against the expected 16α, and how many the other rule keeps on the very same guesses.
accept x ~ q with probability min(1, p(x) / q(x)); otherwise draw from (p − q)+ / Σ(p − q)+
p, q
target and draft probabilities after the same prefix (after temperature, top-k and so on, the same settings on both)
(p − q)+
max(0, p(x) − q(x)): the residual

Why it is exact (Leviathan et al. 2023 and Chen et al. 2023, found independently). The chance of outputting x through acceptance is q(x) · min(1, p(x)/q(x)) = min(p(x), q(x)). The chance of a rejection is β = 1 − Σ min(p, q), and the residual's total mass is Σ(p − q)+ = Σ(p − min(p, q)) = β too, so the chance of outputting x through rejection is β · (p − q)+(x)/β = (p(x) − q(x))+. Add them: min(p, q)(x) + (p − q)+(x) = p(x). The draft only changes how often we get the token cheaply, never which token we get. A guess is kept with probability

α = Σx min(p(x), q(x)) = 1 − TV(p, q)
TV
total variation distance, half the summed absolute difference between p and q

The second rule is also exact, and slower. llama.cpp and mlx-lm sample the target's own token at each position and keep the guess only if the two are equal (llama.cpp common/sampling.cpp L678 to 705). Every output token is a genuine sample from p, so the distribution is exact, but a guess survives with probability Σ p(x) q(x), lower than Σ min(p, q) whenever the target is uncertain. With a greedy draft (q all on the draft's top token, what llama.cpp and vLLM's default do), both rules keep a guess with probability p(draft token). Over the target's own story text, mean per-guess acceptance was 0.49 under min(1, p/q) with a sampled draft, 0.47 with a greedy draft and 0.37 under sample-and-compare with a sampled draft measured here.

Your own p and q: exact rules reproduce p whatever q is

Five tokens. Set the target's p and the draft's q (each normalised to sum to 1), pick a rule, and compare its output distribution (green, or orange when it is wrong) with p (blue). Predict first: with "Draft far from target", which rules still output p?

tokentarget pdraft q

Rules: min(1, p/q) with residual (Leviathan et al., vLLM); sample and compare (draft samples from q, target samples from p, keep if equal: llama.cpp and mlx-lm at temperature > 0); greedy draft (draft proposes its top token, kept with probability p(token): llama.cpp's drafter and vLLM's default); bug: resample from p (on rejection draw from p instead of the residual); no verification (always keep the draft's token). Output distributions are computed exactly; the simulation draws with a fixed seed and runs a chi-square test against p.

Tested on real models. A proof is a proof, but implementations have bugs. For the story prompt, 20,000 four-token openings were drawn with each rule (k = 3, temperature 1, top-k 50, so steps include rejections, residual draws and bonus tokens) and compared with the target's exact probabilities for all 296 openings with an expected count of at least 5, plus one "other" bin (a chi-square goodness-of-fit test).

The control and the three exact rules give p-values of 0.26, 0.56, 0.47 and 0.37, indistinguishable from sampling the target directly; the bug (on rejection, draw from p instead of the residual) over-produces the tokens both models like and fails by a chi-square of 4,357. With 20,000 samples a rule that shifted the opening distribution by more than a few percent of total variation would fail.

The exactness test in full (method, a prediction, observed against expected counts)

For the story prompt, draw 20,000 sequences of the first 4 output tokens with each rule (draft Qwen3-0.6B, target Qwen3-1.7B, both 4-bit MLX; temperature 1 and top-k 50 on both; k = 3, so a step can end in a rejection, a residual draw or a bonus token, and a second step is needed when fewer than 3 guesses are kept). Every distribution was computed with a full forward pass over prompt plus prefix and cached by prefix, so each rule saw exactly the same p and q. The exact target probability of every 4-token opening with an expected count of at least 5 (296 openings, 86.6% of the probability) was computed from the same distributions, the rest pooled into one bin, and each rule's counts compared with a chi-square goodness-of-fit test. A rule that preserves the distribution gives a p-value spread uniformly between 0 and 1; a broken one gives a p-value near 0.

Predict: which of these fails the test? (a) min(1, p/q) with residual, (b) sample and compare, (c) greedy draft, (d) on rejection draw from p instead of the residual.

measured here Bars: observed count of each of the 12 most likely openings against the target's exact expected count (20,000 × probability). Acceptance per step counts guesses kept in the steps needed for 4 tokens, so it is lower than a full step's.

At temperature 0 the rule reduces to "keep the guess while it equals the target's top token", and the output should equal plain greedy decoding. In exact arithmetic it does; in floating point a batched verification pass rounds differently, and at near-ties the top token can flip (closed block). Neither output is wrong.

Greedy output can change with speculation: floating point at near-ties (measured)

The target's logits for a position depend slightly on how the computation was batched. Computing a sequence's logits in blocks of 7 tokens (as a k = 6 verifier does) instead of one token at a time moved individual logits by up to 2.94 on the 4-bit Qwen3-1.7B in MLX (which computes in bfloat16, about 3 significant digits), and changed the top token at 6 of 796 positions across four prompts, each one a near-tie where the top two logits were at most 0.50 apart measured here. That is why the parent's Engine bench saw mlx-lm's k = 6 output differ from its own plain output on two prompts. Where the k = 6 run left the plain run, the candidates were tied to within bfloat16 rounding, and different ways of computing the same position disagreed on the winner: on the summarize prompt at token 3 (after "Large language"), the plain run chose " models", the k = 6 run " model", and recomputing that position as one full pass, one token at a time and in blocks of 7 gave " model", " model" and " model", with the top two logits 0.000, 0.250 and 0.250 apart; on the story prompt at token 51 (after "rifted from the sea, its"), the plain run chose " cap", the k = 6 run " label", and recomputing that position as one full pass, one token at a time and in blocks of 7 gave " surface", " surface" and " surface", with the top two logits 0.125, 0.000 and 0.125 apart. Greedy decoding is only as deterministic as the arithmetic underneath it (the same holds for any change of batch size, with or without speculation). If greedy outputs change after enabling speculation, check that the first difference is at a near-tie (here the top two logits were at most 0.250 apart at each divergence), and compare against plain decoding with the same batch shapes.

4. How many tokens does a step give?

Say each guess is kept with probability α = 0.8, independently, and k = 4. The first guess survives with probability 0.8, the first two with 0.64, three with 0.512, all four with 0.4096, and the target always adds one token of its own. So a step yields on average 1 + 0.8 + 0.64 + 0.512 + 0.4096 = 3.36 tokens per target pass derived.

E[tokens per step] = 1 + α + α2 + … + αk = (1 − αk+1) / (1 − α)
α
acceptance probability of one guess, Σ min(p, q), averaged over positions
k
guesses per step

The yield is capped at 1/(1 − α) however long the draft: at α = 0.7 that is 3.33, and k = 4 already gets 2.77 of it. And it is very non-linear in α: at k = 4, α = 0.5 gives 1.94 tokens per step, α = 0.9 gives 4.10. "Acceptance rate 0.7" and "acceptance length 2.8" are different numbers; engines report one or the other (vLLM and SGLang acceptance length, llama.cpp drafted and accepted counts, from which a per-drafted-token rate follows but not α), and a per-drafted-token rate falls as k grows because tokens after the first rejection are wasted.

Tokens per pass saturate: long drafts stop paying, and α matters more than k

Real acceptance is anything but uniform: near 1 inside a word or a repeated pattern, near 0 where the text could go many ways. Click a token in the coloured text to see the two distributions there.

α follows the kind of token, not its position. A long chain of thought does not wear a drafter down. Over 1.78 million verification rounds on MATH-500, with DeepSeek-R1-Distill-Qwen-7B as target and two independent 1.5B drafters, acceptance did not fall with position out to 8K tokens under greedy decoding and 12K under sampling, once a greedy repetition pathology was removed; rejections clustered instead on reflection tokens such as "wait", "however" and "check" (Speculative Acceptance Does Not Decay with Position, arXiv 2610.30644). That is the pattern in the coloured text: α drops at choices, wherever they fall.

α at every position of real text: high inside words and patterns, low at choices

measured here Text written by Qwen3-1.7B at temperature 1; each token coloured by α = Σ min(p, q) for the Qwen3-0.6B draft at that position, dark green near 1, pale near 0.

Predict: on a story (the hardest text here), the 0.6B draft and the 1.7B target agree on about half the guesses at temperature 1 (mean α 0.48). With k = 4, does the formula with the mean α over- or under-predict the tokens per step actually measured?

With α measured as the mean over the guesses actually examined, the formula predicted the measured tokens per step with a median error of 3% (largest 17%) over all 72 combinations of prompt, temperature and k run here measured here. The catch is that α itself cannot be predicted: it was 0.98 on the list and 0.48 on the story with the same two models. Measure it on a sample of your own traffic; engines report it (section 8).

With the measured mean α, the simple formula predicts real runs well

Acceptance can be attacked (adversarial suffixes, 2026)

Because acceptance depends on the text, text can be written to lower it: an adversarial suffix appended to attacker-controlled content (a retrieved page, a shared document) makes drafter and target disagree more often, in some cases until speculative decoding is slower than plain decoding; the suffixes survive sampling and transfer across drafters, and regularising them to keep output quality gives up most of the slowdown (Speedbumps (arXiv 2610.10929)). Per-request acceptance is worth monitoring for that reason too.

5. What it costs, and the batch-size crossover

A step costs k draft passes plus one target pass over k + 1 tokens. Put the laptop's measured numbers in: the 0.6B draft costs c = 0.26 of a 4B target pass (it is 15% of the target's parameters, not tiny), and checking 5 tokens costs t(5)/t(1) = 2.68. On the story (α around 0.5, k = 4): the model predicts 0.52x at one user, a slow-down. On a list, where the draft is right most of the time: α around 0.98 gives 1.29x. That is why the parent page measured slow-downs on free text and a gain only on a predictable list.

speed-up = E[tokens per step] × t(1) / ( k · tdraft + t(k + 1) )
t(n)
time of one target pass over n tokens per sequence (section 1's curve)
tdraft
time of one draft pass; Leviathan et al. call tdraft/t(1) the cost coefficient c

Leviathan et al. assume t(k + 1) = t(1), which gives their speed-up (1 − αk+1) / ((1 − α)(kc + 1)), with c below 0.05 for their T5 drafts (though their own Table 4 gives 0.11 for T5-large). Neither assumption holds on the laptop.

The batch-size crossover. Serve B users at once (how an engine forms those batches is on Batching, KV cache and scheduling in depth) and the verification pass carries B × (k + 1) tokens. The weights are still read once per step, so plain decoding gets cheaper per token as B grows, but the flat part of section 1's curve is used up by the batch itself (Fig. 3): once B tokens fill the arithmetic, every extra guessed token costs real compute, and rejected guesses are pure waste. Speculation trades idle arithmetic for latency, and a full batch has no idle arithmetic.

  1. One user, plain decoding. On the H100 model a step reads Llama 3.1 8B's FP8 weights in 3.44 ms (the glass), while one token's arithmetic takes 0.02 ms (the blue sliver); with the fixed 2.5 ms per step (the grey base) the step takes 5.94 ms. The chip idles.
  2. One user, k = 4 guesses. Five tokens of arithmetic take 0.12 ms, still far inside the 3.44 ms read, so the check is free: the step costs 5.94 ms plus 1.19 ms of drafting (gold, 0.05 of a step per guess) and yields 3.36 tokens at α = 0.8: 2.80x.
  3. 16 users. The read grows to 4.19 ms (16 KV caches of 1,024 tokens join the weights); the arithmetic grows to 0.39 ms, and to 1.94 ms with the guesses, still inside: 2.80x.
  4. 64 users. Now the guesses' arithmetic (7.78 ms) is longer than the read (6.59 ms): the speculative step grows to 10.28 ms against 9.09 ms plain, and the speed-up starts to fall: 2.53x.
  5. 256 users. The plain step is still memory-bound (6.22 ms of arithmetic under a 16.21 ms read), but with the guesses the arithmetic takes 31.12 ms: every guessed token now costs real time and every rejected one is waste: 1.68x, and falling as B grows.
  6. Long context. At 8,192 tokens per sequence each step also reads far more KV cache (29.03 ms at 64 users), so the guesses fit under the read again: 2.80x at every batch shown. 256 sequences of 8,192 tokens would need 275 GB of KV cache, more than one H100 holds (80 GB, Memory technology).

derived Fig. 3 is the page's H100 cost model (the cost model below, H100 setting, with α 0.8, k 4, draft cost 0.05, context 1,024): Llama 3.1 8B FP8 on one H100, the parent's Capacity planner constants. Not run here. Read it for why the speed-up falls, not for the batch size where it falls: measured crossovers come much earlier (this laptop's runs and the published GPU results, next).

On the laptop the real 0.6B draft (k = 3, measured acceptance length 2.48 on this prompt mix) gave 0.70x the plain server's throughput at 1 user, 0.67x at 4 and 0.54x at 16 users. With llama-server's synthetic acceptance fixing the acceptance length at 4.5, better than any drafter here, the ratio was 0.95x at 1 user, at best 1.16x (8 users) and 0.89x at 16 measured here. This laptop is past the crossover from the first user: checking 4 guesses costs 2.68x a one-token step (section 1), so even 4.5 tokens per step barely repays the drafting. On an H100, where the check is nearly free, the same acceptance length would give a large gain at small batch (the cost model's H100 setting, below).

What the published GPU results say
The same crossover appears in every measured source, further out because an H100 stays memory-bound longer. EAGLE-3 in SGLang on one H100 (Llama 3.1 8B, MT-Bench): 1.81x throughput at batch 2, 1.48x at 16, 1.38x at 64; the older EAGLE fell below 1x from batch 24 (EAGLE-3, Table 3, measured by the SGLang team). DFlash on one B200 with Qwen3-4B: 4.8x at concurrency 1, 2.9x at 32 (DFlash, Table 3, authors). vLLM's own blog: 1.5x to 2.8x at QPS 1, but 1.4x to 1.8x slower at high QPS on Llama 3 70B, 4x H100 (2024-10-17, vendor). On an L40S at QPS 16, even k = 1 cost 14% (TurboSpec, vLLM authors). SGLang: up to 60% more output throughput for DeepSeek V3 with MTP at 2 concurrent requests per GPU, 14% at 128 (LMSYS, 2025-07-17, vendor). No benchmark across batch sizes by a party that is neither vendor nor author was found. Every headline number in section 6 is at batch 1 unless stated: measure at your real concurrency.

On the laptop the draft never pays, and its loss grows with users

Two things move the crossover out. Long contexts: every sequence's KV cache is also read each step, a read that grows with batch size times context length, so at long context a big batch is still memory-bound and verification is cheap again; MagicDec reports up to 2.51x for Llama 3.1 8B at batch 32 to 256 on 8x H100 with long contexts (Sadhukhan et al., ICLR 2025, authors). Cheaper drafts and adaptive length: a drafter whose cost does not grow with k (block diffusion), and choosing k per step from the load (TurboSpec, SGLang's adaptive table, vLLM's batch-size schedule, DSpark's per-request verification length) keep the gain at low load and avoid the loss at high load.

A sparse MoE target bends the model. Verifying k + 1 tokens routes them to more experts than one token, so counting activated-expert bytes predicts a speed-up that is poor at batch 1, peaks at a middle batch and then falls. Across 10 MoE models (30B to 1T parameters, 8 to 512 experts, each with its own EAGLE, EAGLE-3 or MTP drafter, k = 3, H100 and B200), coarse-expert models (Mixtral 8x7B, Qwen2-57B) followed that curve, but fine-grained ones (Qwen3-30B, Qwen3-235B, Kimi-K2.5) mostly did best at batch 1: their MoE layers take a smaller share of step time than of weights (MoE kernels use bandwidth better than attention, and L2 absorbs repeated reads of co-routed experts), and draft tokens share experts more than independent routing assumes (Ranjan et al., Cohere, NeurIPS 2026 (arXiv 2610.38981), authors; speed-ups shown only in figures and kernel-dependent). For an MoE target, estimate t(B, k + 1) from measured kernel time, not from expert bytes.

The crossover as a cost model: move α, k and the drafter's cost, then switch to an H100

Predict first: on the H100 setting, which moves the crossover further out, a longer context or a larger k?

speed-up(B) = E[tokens per step] × t(B, 1) / ( k · tdraft(B) + t(B, k + 1) )
B
sequences decoding together (users in the batch)
t(B, n)
one target pass over n tokens for each of B sequences

On the laptop setting the model gets the shape right and the absolute numbers wrong: it leaves out llama-server's per-step overhead (the note above says by how much), so read it for shape. The H100 setting is derived from the parent's Capacity planner constants, not run here.

The measured server runs behind both charts (setup, absolute throughput, load)

llama-server (llama.cpp b11146, Metal) serving Qwen3-4B Q4_K_M with 16 slots, and 1, 2, 4, 8 and then 16 closed-loop clients in turn, each sending a different prompt from a mixed pool of 16 (code, explanations, stories, lists), greedy, 192 tokens per answer. Three servers: no draft; the Qwen3-0.6B Q4_K_M draft (--spec-type draft-simple, k = 3, the default); and the same draft under llama-server's --spec-synth-len 4.5 benchmarking mode (k = 4), which runs the real draft but accepts guesses at random so the mean acceptance length is fixed at 4.5 (its output text is not valid). Idle slots do no work, so one 16-slot server serves every user count. The whole sweep ran twice per server; the machine was shared, so the load average is recorded with each run and the spread between the two sweeps is shown.

Does the drafter need a long context of its own? (2026 result)

No. A drafter that attends over the full prefix inherits the target's context cost and its speed-up erodes, then reverses, at ultra-long context, but target-conditioned drafters (EAGLE-style heads) already read the target's hidden states over the whole prefix. Frozen short-context drafters with a bounded attention cache and rotary positions re-based into their trained range kept their short-context speed-up flat from 4k to two million tokens across three target-drafter pairs and five corpora, at a cost of at most 0.16x of speed-up at short length (Long-Context Drafting Does Not Require Long-Context Drafters (arXiv 2610.20865), authors).

6. Drafters: where the guesses come from

Everything so far works with any drafter that proposes tokens and (for sampling) says how likely it thought each one was. It must share the target's tokenizer exactly (vocabulary and ids), or be mapped (EAGLE-3 drafts often use a reduced vocabulary mapped back with a table); same family and same chat template matter for acceptance. Drafters differ in three things: how well they guess (acceptance), what a guess costs (the cost ratio c), and what you have to train or ship. They form a ladder, from no model at all to heads trained into the target itself (Fig. 4; the numbers are acceptance lengths measured on this laptop in Drafters measured).

  1. n-gram and suffix decoding: no model. Copy what followed the last few tokens earlier in the prompt or the output. Free to propose: 4.59 tokens per target pass on the code-rename prompt here, 1.00 on a story; it pays only when the answer repeats its input. Suffix decoding does the same over many earlier requests.
  2. A separate small model. Qwen3-0.6B reads only the tokens and runs one full forward pass per guess, k passes in a row: 4.00 tokens per pass on code, 2.03 on the story (k = 3).
  3. Medusa heads. Extra output heads on the target's last hidden state; head i guesses the token i steps ahead, all in parallel, so later heads guess without seeing the earlier guesses. Not run here (no llama.cpp support).
  4. EAGLE-3. A one-layer head fed the target's own low, middle and top-layer features, drafting token by token: 2.64 on code, 1.65 on the story here (k = 3).
  5. MTP. A module trained with the model sits on its last layer and predicts the token after next; at serving time it is the draft, chained to draft more than one token. Not run here: Qwen3 checkpoints ship no MTP heads.
  6. Block diffusion. DFlash's few-layer drafter reads the target's features and fills a block of 16 positions in one pass, so drafting no longer costs k passes: 12.46 tokens per pass on code here, 1.89 on the story.

measured here Acceptance lengths from Drafters measured (llama-server, Qwen3-4B Q4_K_M target, greedy, one run per prompt). Fig. 4's layers and positions are schematic.

Why feature-level drafters guess better

A separate 0.6B model has to work out what the 4B model is thinking from the tokens alone. EAGLE's head is handed the 4B model's own hidden state (its summary of everything so far), so its job is much easier: predict what the next feature, and so the next token, will be. That is why a single extra layer can out-guess a separate model several times its size: on Qwen3-4B, the AngelSlim EAGLE-3 head (one layer) reports a mean accepted length of 2.08 with 2 draft tokens on one H20 in vLLM, where plain decoding gives 1 (model card, vendor). The cost: the head only works with the exact target it was trained for, and the engine must pass hidden states from the target to the drafter every step.

MTP takes this one step further: the prediction module is trained with the model, so the model's maker ships the draft (how the module is trained, and what it does to pre-training, is on Families and objectives). DeepSeek-V3 trained one MTP module (depth 1) to improve pre-training and noted it can be "repurposed ... for speculative decoding" (DeepSeek-V3 paper page has a calculator for what 85 to 90% acceptance implies). With one MTP token, a step yields at most 2 tokens; engines chain the module to draft 2 to 4. How the MTP loss is trained moves acceptance too: keeping only the part of each MTP head's gradient that pulls it toward the model's own next-token distribution lengthened acceptance over standard MTP, slightly, at every tested size (167M to 1.2B LLaMA-style models, 1.67 to 1.70 tokens at 1.2B; seeds not reported) (Soft-MTP, arXiv 2610.38331, author).

Block diffusion attacks the other term, the drafting cost. An autoregressive drafter needs k sequential passes for k tokens, so c grows with k; a diffusion drafter writes the block in one pass, so a 16-token draft costs about as much as a 1-token draft. Its weakness is that block positions are guessed without seeing each other (the "suffix decay" DSpark's Markov head tries to fix). The same idea used as the whole model rather than as a drafter is on the DiffusionGemma paper page.

The model as its own drafter, segment by segment. When an output splits into segments that rarely depend on each other, the target can draft them all at once and then check them. WorldTUI, a 358M model that plays a terminal, decodes each changed screen row as its own batch element from the same history and cache, so a frame takes as many steps as its longest row; rows that cannot see each other sometimes disagree, so the same model then verifies the drafted frame sequentially, keeping tokens up to the first disagreement and redrafting the rest. Under greedy decoding a fully verified frame equals sequential output; its optional per-frame time budget, which commits the rest of the draft unchecked when it runs out, gives that exactness up (one author's demo, decoding mode of its headline latency not stated: WorldTUI).

DrafterWhat proposes the tokensTraining neededTypical strengthPublished speed-up (who measured)
n-gram / prompt lookupCopy what followed the last few tokens earlier in the prompt or the outputNoneFree to propose; shines when the answer repeats the input (code edits, quoting, summaries)2.4x average on summarization and context QA, Mistral-7B, one A100, greedy (Saxena 2023, author); 2.8x on CNN/DailyMail, Llama 3 70B, 4x H100, QPS 1 (vLLM blog, 2024-10-17, vendor)
Suffix decodingA suffix tree over earlier prompts and outputs of many requests, kept in CPU memory; drafts more when its match is longNoneAgent loops that repeat long spans across callsUp to 5.3x on SWE-Bench and Text-to-SQL agent traces, Llama 3.1 8B, one H100, batch 1 (Oliaro et al., NeurIPS 2025, authors)
Separate small modelA smaller model with the same tokenizer (Qwen3-0.6B for Qwen3-4B here)None, or distil it towards the target (DistillSpec: 10 to 45% more speed-up)General text; costs a real model's forward passes per guess2 to 3x on T5-XXL, one TPU v4, batch 1 (Leviathan et al.); 1.92 to 2.46x on Chinchilla 70B (Chen et al.); 3.55x for Llama 3.3 70B with a 1B draft, one H200, batch 1 (NVIDIA, 2024-12-17, vendor)
Medusa headsExtra output heads on the target's last hidden state, head i guessing the token i steps ahead; candidates combined into a treeHeads (Medusa-1, target frozen) or heads plus target (Medusa-2)Cheap guesses with no second model; later heads guess blindly, so acceptance falls fast with depthOver 2.2x (Medusa-1), 2.3 to 2.8x (Medusa-2), Vicuna 7B to 33B, one A100, batch 1 (Cai et al. 2024, authors)
EAGLE, EAGLE-2, EAGLE-3A one-layer transformer that reads the target's own hidden features and drafts token by token; EAGLE-2 grows a draft tree shaped by the draft's confidence; EAGLE-3 fuses low, middle and top-layer features and trains on its own earlier guesses ("training-time test")A small head per target model (published for many open models)The common default for serving in 2025 and 2026EAGLE 2.7 to 3.5x latency on LLaMA2-Chat 70B; EAGLE-2 3.05 to 4.26x; EAGLE-3 up to 6.5x at batch 1, and 1.38x throughput at batch 64 in SGLang on one H100 (EAGLE, EAGLE-2, EAGLE-3, authors)
Multi-token prediction (MTP)Modules trained with the model itself to predict the token after next; at serving time they are the draftDone in pre-training by the model's makerShips inside the checkpoint (DeepSeek-V3, Qwen3-Next, GLM, MiMo, Gemma 4 and others)DeepSeek-V3: second-token acceptance 85 to 90%, "1.8 times TPS", hardware and batch not given (§5.4.3, authors); DeepSeek-R1 on 8x B200 at batch 1: 2.28x with 3 MTP tokens (TensorRT-LLM blog, vendor); GLM-5's three parameter-sharing MTP layers: acceptance length 2.76 against 2.55 for DeepSeek-V3.2, and with 7 draft steps on GLM-5.1's backbone GLM-5.2's changes raise it from 4.56 to 5.47 (Zhipu: GLM, authors)
Block-diffusion drafters (DFlash, DSpark)A few-layer drafter that reads the target's features and fills a whole block of 7 to 16 masked positions in one forward pass; DSpark adds a small "Markov head" so each position also sees the previous token, and schedules how much of the block to verify per requestA drafter per target modelDrafting cost no longer grows with k, so long drafts become affordableDFlash: over 6x lossless, up to 2.5x faster than EAGLE-3; Qwen3-4B on Math500 on one B200 4.8x at concurrency 1 falling to 2.9x at 32 (Chen, Liang, Liu, ICML 2026, authors). DSpark: 60 to 85% more per-user speed than MTP-1 at matched throughput in DeepSeek-V4 production (arXiv 2607.05147, authors)

Every speed-up in this table is the authors' or vendor's own measurement, mostly at batch 1 on datacenter accelerators, against their own baseline. They are not comparable with each other (different models, tasks, hardware and baselines), and none is an independent replication. Part of the published gaps between recipes is their training data: retraining six drafter recipes under shared training and inference conditions, across ten benchmarks and two targets, shrinks gaps "that appear large in published comparisons" substantially (When Does Better Acceptance Pay?, arXiv 2610.24993), and distillation objectives that help a lot when a drafter learns from external responses gain much less once the target regenerates those responses (Target Regeneration Shrinks the Gains of Draft-Training Objectives, arXiv 2610.29013). Compare a new drafter with one trained on target-regenerated data, not with its published number. The same drafters run on one 4B target on this laptop are in Drafters measured.

Not every acceleration in this family is exact
Medusa-2's typical acceptance accepts a guessed token when the target gives it probability above min(ε, δ·e−H) (H the entropy of the target's distribution); it is faster but no longer samples from the target (Cai et al. 2024). TensorRT-LLM's "relaxed acceptance" for DeepSeek-R1's thinking phase is lossy in the same way (accept if in the target's top 10 within a probability gap; TensorRT-LLM blog). Exactness is a property of the verification rule, not of the drafter.
A lossy rule's acceptance overstates its speed (2026 result)

Across twelve target-drafter pairs, at each training-free relaxed rule's most relaxed setting, verification accepted 1.34x as many tokens per round as the exact rule but completions came out 1.54x longer, mostly longer reasoning, which largely cancelled the gain; the rules that cut verifier rounds typically lost accuracy substantially (Acceptance Is Not Speed (arXiv 2610.23818)). Under a lossy rule, report completion length and verifier rounds beside acceptance length.

Choosing. If the model ships MTP heads, use them. Otherwise an EAGLE-3 head for that exact model if one exists; a same-family small model if not; n-gram or suffix decoding added on top for copy-heavy work (code edits, RAG, agents). Then measure acceptance length and throughput at your real concurrency.

7. Trees: checking several guesses in one pass

A chain draft dies at its first wrong token. If the draft was unsure between two words, it could propose both and let the target pick: a draft tree. All branches are checked in the same forward pass using a tree attention mask (each candidate token attends only to its own ancestors), introduced by SpecInfer and Medusa, and made adaptive in EAGLE-2, which grows the tree where the draft's confidence (the product of its probabilities along the path) is highest. The target keeps the longest root path it agrees with.

The trade: a tree spends its verification budget on breadth instead of depth. With a budget of M tokens checked per pass, a chain of M goes deep on one guess; a tree of M nodes covers the likely alternatives near the root, where most chains fail.

  1. The budget. The target will check 8 draft tokens in one pass. The context ends where the line above says; the draft must guess what the target writes next.
  2. A chain of 8. The draft extends its single best guess 8 tokens deep (front row).
  3. A tree of 8 nodes, EAGLE-2 style. The draft expands the 4 most likely children of the 4 best nodes at each depth and keeps the 8 nodes with the highest cumulative draft probability (cp, the product of its probabilities along the path), so the tree branches where the draft is unsure.
  4. One pass with a tree attention mask. All 8 nodes go through the target together; in the mask, a lit cell means the row's node may attend to the column's node, which happens only for itself and its ancestors, so each branch is scored as if it were alone.
  5. Verify. The target keeps the longest root path equal to its own continuation (green), then adds one token of its own.
  6. Over all 171 positions. Mean tokens kept per pass: chain of 4 2.23, chain of 8 3.64, tree of 8 3.36, tree of 16 3.80, tree of 32 4.01.

measured here Real models at temperature 0: draft Qwen3-0.6B (4-bit MLX), target Qwen3-1.7B (4-bit MLX), greedy. Accepted length = the longest root path equal to the target's own greedy continuation; trees capped at depth 6.

Over every 4th position of four prompts (171 positions; trees capped at depth 6), the chain of 8 accepted 3.64 tokens on average and a tree of 8 nodes 3.36; a tree of 16 nodes 3.80 and of 32 nodes 4.01, against 2.23 for a chain of 4 measured here. By prompt (chain of 8 against tree of 8): code edit 3.69 against 3.62; summary 1.69 against 2.10; story 0.89 against 1.39; list 7.42 against 5.75. The tree wins where the draft is unsure (summary, story), because its second and third guesses near the root often hold the target's choice; it loses on the list, where the draft's single chain is almost always right and the tree, capped here at depth 6 and spending nodes on alternatives, cannot reach as deep. The extra nodes are not free: on a GPU at batch 1 they ride in the idle compute, but each node is one more token in the verification pass, which is exactly what a large batch cannot afford (section 5). That is why engines use trees at low concurrency and short chains, or none, at high concurrency.

8. In production: the knobs, and what to watch

Draft length kThe main knob. vLLM's num_speculative_tokens has no default for a draft model (it must be set); llama.cpp's --spec-draft-n-max defaults to 3. Raise it while acceptance is high and verification is cheap; lower it as the batch grows.
Draft samplingvLLM drafts greedily by default (draft_sample_method="greedy"), so q is one-hot and a draft token is kept with probability p(token). llama.cpp also drafts greedily and can stop a draft early when the draft's top probability falls below --spec-draft-p-min (default 0).
Batch-size scheduleAll three datacenter engines can now shorten or switch off speculation as the batch grows (engine table below). SGLang's default adaptive table goes from candidate k of 1 to 7 at batch 1 down to 0 at batch 64.
What to watchAcceptance length (tokens per verification step) and draft acceptance rate per request, and TPOT and throughput against the same server without speculation, at your real concurrency. vLLM exports vllm:spec_decode_num_drafts_total, ..._num_draft_tokens_total, ..._num_accepted_tokens_total and accepted tokens per position on /metrics (acceptance length = 1 + accepted / drafts; v1/spec_decode/metrics.py); llama-server returns draft_n and draft_n_accepted per request.

How vLLM's scheduler counts draft tokens as ordinary tokens to compute (num_tokens_with_spec), which speculative methods its Model Runner V2 does not support yet, and its per-request acceptance metrics are on vLLM: inside the default engine. SGLang's scheduler, including the overlap scheduler its speculative workers run inside, is explained on SGLang: radix cache, cache-aware scheduling, large-scale serving.

What each engine supports, read from source (vLLM v0.31.0, SGLang v0.5.21, TensorRT-LLM v1.2.1, llama.cpp b11146, mlx-lm 0.32.0)

Y = in the serving path; legacy = only in an older backend; example = a separate example program, not the server.

MethodvLLM v0.31.0SGLang v0.5.21TensorRT-LLM v1.2.1llama.cpp b11146mlx-lm 0.32.0
Separate draft modelY draft_modelY STANDALONEY draft/targetY draft-simpleY (server stops batching)
EAGLE / EAGLE-3Y eagle, eagle3YY EAGLE 3Y draft-eagle3no
MedusaY (removed, with the MLP speculator, in v0.33.0 on 2 November 2026)nolegacynono
MTPY (27 model types)Y (NEXTN is an alias of EAGLE)Y (DeepSeek only)Y draft-mtpno (MTP weights dropped on load)
n-gram / prompt lookupY ngram, ngram_gpuYYY (5 variants)no
Suffix decodingY (imports Arctic Inference)nononono
DFlashYYnoY draft-dflashno
DSparkYYnoY draft-dsparkno
Lookahead (Jacobi)nonolegacyexampleno
Verification rule at T > 0min(1, p/q) with residualtree verification in an sgl-kernel sampling kernel, tree_speculative_sampling_target_only (kernel not read here)docs say greedy only; code adds non-greedy for two-model pathssample target, accept if equalsample target, accept if equal
Turn off at large batchopt-in schedule num_speculative_tokens_per_batch_size (k may be 0)opt-in adaptive config: k = 0 at batch 64max_concurrency, draft_len_scheduleno (per slot)no

Sources: vLLM config/speculative.py (methods L39 to L84; greedy draft sampling default L601; batch-size schedule L492) and v1/sample/rejection_sampler.py (accept test L884, residual L1061); SGLang speculative/spec_info.py and adaptive_spec_params.py; TensorRT-LLM speculative-decoding.md and llmapi/llm_args.py (the doc and the code disagree at the same tag; both shown); llama.cpp common/sampling.cpp and common/speculative.cpp; mlx-lm 0.32.0 generate.py (speculative_generate_step) and server.py (is_batchable = draft_model is None). All read 2026-10-08.

Recent developments, dated (2025 to 2026; volatile)
  • 2025-03: EAGLE-3 (training-time test, fused features) became the drafter most engines ship; drafts for Llama 4, gpt-oss, Qwen3 and Gemma 4 followed from NVIDIA, Red Hat, Tencent's AngelSlim and LMSYS (arXiv 2503.01840).
  • 2025-03 to 2025-04: Snowflake's Arctic Inference (suffix decoding, now imported by vLLM) and vLLM's speculators library for training and packaging drafts (speculators).
  • 2025-07 to 2026: MTP heads shipped inside open checkpoints became common (Qwen3-Next, GLM, MiMo, Gemma 4 among the 27 MTP model types in vLLM v0.31.0; the SGLang throughput result is in section 5).
  • 2026-01 to 2026-05: DFlash, block-diffusion drafting, published drafters for many open models and was accepted at ICML 2026 (arXiv 2602.06036).
  • 2026-03: vLLM's P-EAGLE drafts up to 10 tokens in one pass: 1.55x over EAGLE-3 at concurrency 1, 1.05x at 64, GPT-OSS 20B on one B200 (vLLM blog, vendor).
  • 2026-07: DeepSeek open-sourced DeepSpec and DSpark, which it runs in DeepSeek-V4 production; its argument is the batch-size crossover itself: verifying long blocks "wastes critical batch capacity", so it chooses per request how much of the block to verify (arXiv 2607.05147).
  • 2026-08: the DFlash 2 drafter for Qwen3.8-27B reports 3.43x at concurrency 1 on GSM8K on one H200, 1.45x at 32, where the model's own seven-token MTP falls to between 0.77x and 1.04x (model card, drafter's publisher). The parent page cites the 3.43x; the other two numbers are the more useful ones.
  • 2026-10: DeepSeek's open engine, DeepInfer, the offline release of the engine behind its production service, ships DSpark with confidence-scheduled verification (default maximum draft length 5) as its speculative decoder (DeepInfer; the engine is on Distributed and disaggregated serving, section 5).
  • 2026-10: Mistral Large 4 ships a DSpark drafter inside its checkpoint (3 sliding-window MLA layers, draft depth 3, conditioned on five of the target's layers); vLLM measured about 2.9 accepted tokens per step and 1.9x to 2.1x output throughput at matched concurrency 1 to 32 on 8-GPU tensor parallelism, FP8, greedy (vLLM blog, 29 October 2026, vendor).