When a small model guesses several tokens ahead and a large model verifies them in a single pass, latency can decrease without changing the output distribution.
Idle compute units, starved bandwidth
Low-batch autoregressive decoding in large language models (LLMs) is often limited by memory bandwidth. Each token requires weight access while performing relatively little computation. Larger batches and longer contexts can introduce compute or KV-cache bottlenecks instead.
For example, a dense 70B model with two bytes per FP16 parameter has about 140GB of weights. Reading them every step at an assumed effective bandwidth of 2TB/s gives an estimated transfer time of about 70ms. Actual latency also includes parallel placement, kernel execution, and cache access costs.
A small draft model produces k tokens, and the target evaluates the candidates and the following position in one forward pass. Sharing weight reads across positions can help, but more candidates also require more computation and memory.
Two questions matter. Why does quality not degrade, and how much faster does it actually get?
Why the distribution does not change
The modified rejection sampling proposed by Leviathan et al. (ICML 2023) is what makes this lossless. Let q be the draft model distribution and p the target model distribution. The acceptance rule is simple.
| Condition | Acceptance probability |
|---|---|
| q(x) ≤ p(x), the draft undersamples | always accept |
| q(x) > p(x), the draft oversamples | accept with probability p(x) / q(x) |
On rejection, resample from the residual probability mass.
accept if: U(0,1) < min(1, p(x) / q(x))
on reject, sample from: normalize(max(0, p(x) - q(x)))The final output of this procedure is provably identical to the target model distribution p. This is mathematical equivalence, not an approximation. Acceptance and correction must use distributions that reflect the intended temperature and top-p. Distribution preservation does not guarantee a speedup, and floating-point implementation differences need separate evaluation.
Leviathan et al. reported a 2x to 3x improvement for T5-XXL against the standard T5X implementation. That result applies to the tested execution conditions.
The following speed model fixes mean acceptance probability and approximates target verification cost by the cost of one step. Measure cost changes from batch size and candidate length separately.
E[speedup] = (1 - α^(k+1)) / ((1 - α)(ck + 1))
α: mean per-token acceptance rate
k: draft length
c: cost of one draft step / cost of one target stepHigher α and lower c mean bigger gains. With α=0.8, k=5, and c=0.1 the result is 2.45952x. With the same k and c, α=0.4 still gives 1.10656x, so α alone does not determine the break-even point. The threshold depends on α, k, and c together.
The formula also explains why a bigger draft model is not automatically better. A larger model raises the acceptance rate α, but it also raises the cost ratio c, which inflates the denominator. Compare acceptance rates and actual execution costs on the same workload instead of fixing a parameter-count ratio.
Differences in draft structures
Medusa and EAGLE, published at ICML 2024, and LayerSkip, published at ACL 2024, study different draft structures. The table compares architecture and training requirements. Maximum speedups from different papers are not a ranking under matched conditions.
| Method | Draft source | Training and correctness conditions |
|---|---|---|
| Independent small model | Separate language model | Original algorithm can use existing models; acceptance and correction required |
| Medusa | Multiple heads added to the target | Head-only or joint backbone training; conditions vary by variant |
| EAGLE | Predictor using target features | Separate predictor training and target verification |
| LayerSkip | Earlier target layers | Early-exit training and verification with later layers |
Medusa creates candidates for future positions and verifies them with tree attention. Distinguish frozen-backbone Medusa-1 from jointly trained Medusa-2. Variants such as typical acceptance differ from exact rejection sampling, so preserved quality is not identical to preserved distribution.
EAGLE combines feature prediction with a token sequence advanced by one step. LayerSkip trains earlier model layers to draft. Neither supports a blanket claim that any checkpoint can use the method without additional training.
Measure drafting and verification together
flowchart LR
C["Committed context"] --> D["Draft candidates"]
D --> V["Target verification"]
V --> A["Accepted prefix and corrective token"]
A --> C
More candidates can increase committed tokens per round. They also increase drafting and verification computation and cache costs. Record stage time and committed tokens together because a higher acceptance rate can accompany worse latency.
At larger batches, target weight reads are already shared across requests. Additional drafting and verification work can reduce the benefit. This does not establish a fixed slowdown at every high load or a speedup at every low load.
| Comparison | Conditions to match |
|---|---|
| Output | Target, temperature, top-p, exact acceptance and correction |
| Latency | Request set and input and output lengths |
| Throughput | GPU budget, arrival rate, and batching policy |
| Extra cost | Draft memory, training and loading, rejected verification work |
Distribution preservation also does not mean identical token sequences for every execution using the same random seed. Evaluate numerical differences and sampling paths separately. This article does not reproduce the systems' performance.
Summary
Speculative decoding shares target execution cost across tokens by verifying candidates together. Correct acceptance and correction preserve the target distribution, but not every draft method or acceptance variant satisfies the same conditions. Speed depends on acceptance, drafting and verification costs, batching, and load. Compare latency, throughput, and memory using the same model and hardware budget.