How can speculative decoding preserve the target distribution?
Acceptance, rejection and correction all matter.
Content revision 4 · 2026-10-24
I03 · Revision 1 · 2026-10-21
- Draft q: propose k tokens
- Target p: parallel verification
- Accept prefix / first rejection
- Residual correction → continue
The bottleneck
Calling a large model token by token incurs sequential cost. A cheaper draft proposes several tokens and the target verifies their positions in one forward pass. Sufficient acceptance advances multiple tokens per expensive step.
The mechanism
With target p and draft q, accept a proposed token with min(1,p/q). On the first rejection sample from the normalized positive residual max(0,p−q), discarding later draft tokens. The complete algorithm preserves the target distribution under its assumptions; simply picking the target’s favorite draft does not.
α(x)=min(1,p(x)/q(x)); p_correct(x) ∝ max(0,p(x)−q(x))
Examples and evidence
Example: p=(0.6,0.4), q=(0.8,0.2). The first token is accepted with 0.75 and the second with 1. Rejected mass is corrected to the second token, recovering p. Google reports its use in AI Overviews, not uniform acceleration for every request.
New constraints
Gains depend on draft cost, acceptance, verification batch and server load. Temperature, truncation and numerical implementation must agree with the defined target distribution. High concurrency, low acceptance or costly drafts can erase the gain.
Primary sources
- Fast Inference from Transformers via Speculative Decoding · 2022-11-30 · Checked 2026-10-21
- Looking back at speculative decoding · 2024 · Checked 2026-10-21
Manual browser reading records and interactive calculators are available with JavaScript.
Keep exploring
I05 · Where should extra inference compute go?
S05 · How does continuous batching balance throughput and latency?