A small draft model can propose the next few tokens while a larger target model checks them. That sounds like accepting a little error in exchange for speed. Speculative decoding has a more interesting possibility: reject and correct the draft in a way that preserves the target's output distribution.
Distribution is the crucial word. Two valid stochastic runs can produce different sentences. The claim is that the sampling procedure retains the probabilities specified by the target, under the algorithm's assumptions. It does not make the target factually correct or promise the same realized string under a particular implementation's random seed.
A draft is a proposal
Leviathan, Kalman and Matias' November 2022 paper specifies draft proposals, target verification and a corrected distribution after rejection. Its analysis separates distributional correctness from a wall-time model that assumes enough parallel capacity. The examples below are newly constructed arithmetic illustrations, not reproductions of its experimental results.
Work at one next-token position with a fixed prefix. Let p describe the target's probabilities and q the draft's, over the same token alphabet after the intended sampling adjustments. If a draft token has q no greater than p, accept it. If q exceeds p, accept with probability p/q. On rejection, sample from the positive part of p minus q, normalized to total probability one.
Two tokens with the correct total
For an original two-token case, give the target probabilities p(A) = 0.8 and p(B) = 0.2. Give the draft q(A) = 0.5 and q(B) = 0.5. Both distributions sum to one. These are hypothetical probabilities for one position, not estimates for actual model tokens.
The draft proposes A half the time. Every such A is accepted because 0.5 is no greater than 0.8. That contributes 0.5 probability mass to final A.
The draft proposes B half the time, but B is accepted only with probability 0.2/0.5 = 0.4. Accepted B therefore contributes 0.5 × 0.4 = 0.2. Rejection occurs with the remaining 0.3 probability.
The positive differences p − q are 0.3 for A and zero for B. After normalization, the rejection correction always chooses A. Final A has probability 0.5 + 0.3 = 0.8; final B has probability 0.2. Both match the target exactly.
Resampling from the unmodified target on rejection would be wrong for this procedure. It would produce final A probability 0.5 + 0.3 × 0.8 = 0.74 and final B probability 0.2 + 0.3 × 0.2 = 0.26. The correction is doing essential work; it is not a decorative second opinion.
Why the correction generalizes
For each token, accepted draft mass is min(p, q). The probability removed through rejection equals the total positive shortfall of q relative to p. Assigning that rejected mass in proportion to the positive differences fills exactly the missing mass for each token. Accepted mass plus corrected mass is p.
Consider a zero in the draft: q(A) = 1 and q(B) = 0, with the same target probabilities. A is accepted with probability 0.8. The remaining 0.2 is corrected to B. A token the draft never proposes can still appear through correction; there is no need to divide by q(B), because that token was not proposed.
If p and q are identical, every proposal is accepted and the rejection branch is never used. An implementation should not attempt to normalize an all-zero residual on a branch with zero probability. If the target assigns zero probability to a proposed token, its acceptance probability is zero. These boundary cases belong in a correctness check.
From one proposal to a round
The paper's full decoding step drafts several tokens in sequence, then evaluates the target on the corresponding prefixes in parallel. It retains the accepted prefix up to the first rejection and discards later guesses. A corrected token follows a rejection; if all guesses are accepted, an additional target token can be emitted. Keeping guesses beyond a rejection would use probabilities conditioned on a prefix that was not actually retained.
This requires compatible token/probability representations and the intended sampling distributions. Merely asking a smaller chatbot for a paragraph and accepting words that look reasonable does not implement the algorithm. Nor can a text-only answer substitute for the probabilities needed for the correction.
Correctness and speed have separate tests
For a separate original timing model, suppose a round drafts two tokens. Assume each successive draft proposal is accepted with independent probability 0.8, and each round also emits the corrected or extra target token. Expected emitted tokens per round are 1 + 0.8 + 0.8² = 2.44. Independence and the constant rate are explicit simplifying assumptions.
Measure time in units of one ordinary target-token step. Suppose each draft step takes 0.1 unit and one parallel target-verification round takes exactly one unit, including its final-token work. With no other changing overhead, the round costs 2 × 0.1 + 1 = 1.2 units. Its modeled long-run rate is 2.44/1.2, approximately 2.03 target-baseline tokens per unit time.
Keep those costs but lower acceptance to 0.2. Expected output becomes 1 + 0.2 + 0.2² = 1.24, giving only about 1.03 times the baseline rate. If instead acceptance stays 0.8 but each draft costs 0.3 unit, the rate is 2.44/1.6 = 1.525 times baseline. A better draft can be too expensive to justify its extra accepted tokens.
These are conditional steady-model ratios, not wall-clock measurements or a latency promise for a short response. They omit startup, contention and other changing overhead by assumption. The target's parallel verification may cost more than one ordinary step on actual hardware. Extra arithmetic can also consume resources that another request needed.
What to require from a performance claim
Check correctness against the precise algorithm and sampling configuration separately from speed. Then measure draft cost, verification cost, acceptance behavior, memory headroom and actual completion latency for the workload. A timing win cannot excuse an incorrect residual distribution, and a correct sampler can still be slower on an unsuitable machine.
The inference-capacity guide supplies the broader memory questions; the latency guide addresses what a measured percentile means. Speculation adds a different mechanism. It earns speed by arranging useful parallel work, not by granting the draft model permission to quietly change the target.
Explore Infinite Upside
For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.
Why does an AI model need more GPU memory than its file size?
Why does an AI model need more GPU memory than its file size?