The Lossless Acceptance Rule
The entire field rests on a two-line rule. A draft token was sampled from the wrong distribution , and we want output distributed as . The fix:
Accept where the draft under-proposes relative to (ratio ≥ 1 ⇒ always keep); thin out where it over-proposes; and patch the holes by resampling from exactly the part of the draft under-covers — the residual.
The Proof (four lines)
Section titled “The Proof (four lines)”For any token , the probability it ends up as output is accepted-as- plus resampled-as-:
The total rejection probability is , which is exactly the residual’s normalizer. It cancels:
No approximation, no temperature caveat. The draft’s quality appears nowhere in the result — it only sets how often we accept:
Draft quality is overlap with the target distribution — measured in total variation, not in accuracy.
Worked Example
Section titled “Worked Example”Vocabulary a, b, c, target , draft :
| token | kept mass | residual | |||
|---|---|---|---|---|---|
| a | 0.5 | 0.2 | 1 (accept always) | 0.20 | 0.30 → 0.75 |
| b | 0.3 | 0.2 | 1 (accept always) | 0.20 | 0.10 → 0.25 |
| c | 0.2 | 0.6 | 1/3 | 0.20 | 0 |
Acceptance rate . The draft loves “c” ( vs the target’s ), so two of every three drafted “c”s are rejected; every rejection resamples “a” or “b” at ratio 3:1 — precisely the mass the draft under-covered. Add it up per token and you recover exactly.
See It Converge
Section titled “See It Converge”What it models. Green bars are the target , gray bars the draft (the mismatch slider drags away from ), blue bars the empirical distribution of what the rule actually outputs. At 1× every draw is narrated: the ratio, the verdict, and the residual resample on rejection.
Knobs. Mismatch controls how wrong the draft is; the red toggle switches to naive mode, which keeps every draft sample.
Try this. Set mismatch to 1.0 (a terrible draft), run at 500×, and watch TV(empirical, p) fall toward zero anyway — only the acceptance chip suffers, converging to Σmin(p, q). Then flip to naive mode: TV plateaus at a visibly nonzero bias, because you are now just sampling from q. Correctness never depended on the draft; only speed did.
Multi-Token Drafts
Section titled “Multi-Token Drafts”For a -token draft the rule applies per position, in order: position is judged against — a distribution the single verify pass already produced for every . The first rejection invalidates everything after it (those drafts were conditioned on a token that no longer exists), which is why acceptance decays along the draft — the effect that drives draft-length tuning on the next page and, much later, DSpark’s variable-length verification.
References
Section titled “References”- Leviathan, Kalman, Matias. Fast Inference from Transformers via Speculative Decoding. ICML 2023. arXiv:2211.17192
- Chen et al. Accelerating Large Language Model Decoding with Speculative Sampling. arXiv:2302.01318