Speculative Decoding: Speed Up LLM Inference Several Times Without New GPUs

    Speculative decoding can speed up large language model inference by several times without new GPUs or further compressing the model—simply by changing how tokens are generated. This article explains how the technique works: the two stages of inference (prefill and decode) and why decoding is memory-bandwidth bound, the draft-model-plus-verification mechanism, the rejection-sampling guarantee that keeps output quality unchanged, the key metric of average acceptance length, the trade-offs around draft length and concurrency, the common forms of draft models, and practical engineering guidance for local and cloud deployments.

    1. Why Large Models Generate “One Word at a Time”

    To understand where the speedup comes from, first look at the two stages of large model inference.

    A complete inference run is usually split into Prefill and Decode:

    1. Prefill stage: After the user submits a prompt, the model processes the entire input at once, computing attention relationships and building the KV Cache in a single pass. This stage handles a large number of tokens at once, is compute-intensive, and is mainly constrained by GPU compute capacity.
    2. Decode stage: Once generation begins, the model enters autoregressive mode and can produce only one token per step. It generates the token, feeds it back as new input, and computes the next one, looping like this.

    The problem lies precisely in the decode stage. To produce the next token, the GPU must read all model weights and the growing KV Cache from VRAM; after computing, it must write the new key-value data back to the cache. A model with tens or even hundreds of gigabytes of weights means that every single token requires shuttling the vast majority of the weights between VRAM and the compute units again.

    The key insight here is: the decode stage is memory-bandwidth bound, not compute bound. In other words, what determines speed at this point is not how many compute units the GPU has, but how fast VRAM can feed data to those units. The compute units may sit idle waiting for data to arrive. This explains why a card with more compute does not necessarily make token-by-token generation noticeably faster—the bottleneck is data movement, not arithmetic.

    2. The Core Idea: Draft Model + Target Model Verification

    Since the bottleneck is “reading the full weights at every step,” the most direct optimization is: make each expensive weight read advance as many positions as possible in one go.

    Speculative decoding is built on exactly this insight. It introduces a small, faster draft model (also called an assistant model), with the basic idea of “the small model guesses first, the large model verifies in one pass”:

    • Draft stage: The draft model autoregressively and cheaply predicts several candidate tokens in sequence.
    • Verification stage: The target model performs a single forward pass over these candidate tokens, obtaining at once “what the probability distribution at each position would be if the model generated them itself,” and thereby deciding in one shot which candidates can be accepted.

    For an intuitive example: given the input “The cat,” the draft model might guess a whole run of follow-up tokens like “sat on my lap.” Once the target model receives it, a single forward pass is enough to check: if the first two tokens match the target model’s own probability distribution, they are accepted directly; once the third token is rejected, all subsequent candidates are discarded too, and the target model generates one corrected token at the rejection position and continues.

    This way, progress that the target model would originally need three or four autoregressive rounds to achieve can now be compressed into “one draft round + one verification.” Because the draft model is tiny, its generation cost is far lower than the cost of the target model repeatedly reading the full weights, so a large amount of redundant data movement is saved overall.

    3. Why It Gets Faster Without Losing Quality: The Unbiased Distribution Guarantee

    Some may worry: “What if the small model guesses wrong? Won’t that lower output quality?” This is exactly the elegant part of speculative decoding’s design—it does not change the target model’s final output distribution, making it a form of “lossless acceleration.”

    The standard approach borrows from rejection sampling. Let the target model’s probability distribution at some position be p and the draft model’s distribution be q. For a candidate token x produced by the draft:

    1. # Accept or reject each draft candidate one by one
    2. for x in draft_tokens:
    3. r = random_uniform(0, 1)
    4. if r < min(1, p(x) / q(x)):
    5. accept(x) # equivalent in probability to sampling from the target distribution
    6. else:
    7. # Rejection: resample a token from the corrected distribution, normalized as max(0, p - q)
    8. # The corrected distribution makes up for the probability mass at the rejected position, keeping the overall distribution as p
    9. sample_from(normalize(max(0, p - q)))
    10. break

    Intuitively: when the draft model guesses accurately (when p(x) is not less than q(x)), the token is adopted directly; when it guesses off, a token is resampled from a corrected “adjusted distribution.” It can be mathematically proven that the token sequence produced by this accept/reject mechanism has a statistical distribution exactly identical to sampling token by token directly from the target model. Therefore, while accelerating, the quality of the generated results is no different from the original model—which is the essential difference between this and simply switching to a smaller model.

    4. The Key Metric: Average Acceptance Length

    What really determines the speedup is not how large the draft model is, nor how many tokens it guesses at once, but the average acceptance length—the average number of draft tokens the target model accepts per round.

    • If the draft model predicts 4 tokens at once and 3 of them are accepted, a single expensive verification has advanced more than 3 positions, which is a significant gain;
    • If the acceptance rate is low and many candidates are rejected, the cost of the draft computation and verification instead becomes a burden.

    The speedup ratio is strongly correlated with the acceptance length, and the acceptance length in turn depends on the “alignment” between the draft model and the target model: ideally they come from the same model family, share a vocabulary, and have similar training objectives, so that the draft model’s guesses stay close to the target model’s true distribution. A draft model that has nothing to do with the target model will have a low acceptance rate and may even slow things down overall.

    5. Does Writing More Draft Tokens Make It Faster? Not Necessarily

    Speculative decoding may look like a “free lunch,” but the draft length (how many tokens to guess at once) needs to be balanced and is not always better when longer:

    • Draft too long: The further along, the less accurate the draft model’s predictions and the higher the probability of rejection, wasting more candidate computation and verification cost; at the same time, the VRAM and compute overhead of the verification stage also rises.
    • Draft too short: Even if every token is accepted, the gain is limited and cannot amortize the cost of one full weight read by the target model.

    In practice, the draft length needs to be set dynamically or empirically based on the acceptance length (a common approach is to pick a fixed small value, or adjust it dynamically via heuristic rules). The core principle remains: make each expensive forward pass of the target model correspond to as many accepted tokens as possible.

    6. Performance Differences in Concurrent Scenarios

    Speculative decoding does not deliver the same benefit in every scenario, and understanding its boundaries matters:

    • Low concurrency / single request: Here the GPU is in a typical memory-bandwidth-bound state, with compute units largely idle. Speculative decoding puts this idle compute to work on verification, yielding the greatest benefit—this is the typical scenario in which figures like “nearly 4x faster” appear.
    • High concurrency / large batch: When the batch is large enough, decoding gradually shifts from “bandwidth bound” to “compute bound,” and the GPU’s compute units become saturated. Doing extra draft verification at this point may crowd out already scarce compute, so the benefit drops and can even turn negative.

    Therefore, engineering practice often decides adaptively whether to enable speculative decoding, and how long the draft should be, based on batch size, sequence length, and available VRAM. The optimal strategy usually differs between online services that pursue throughput and local single-user scenarios that pursue low latency.

    7. Common Forms of Draft Models

    Besides “using a separate small model as the draft,” the industry has developed several approaches that don’t require an extra model (all are general technical ideas):

    • Independent small model draft: The most straightforward approach—choose a small model from the same source as the target model, sharing its vocabulary.
    • Self-speculation: Use the large model’s own shallow layers or early exit to approximate draft generation, avoiding the cost of maintaining a second model.
    • Multi-head prediction: Add lightweight extra prediction heads to the target model to produce candidates for multiple positions in parallel.
    • Tree/branch draft: Generate multiple candidate paths at once (forming a candidate tree) and verify them in parallel during verification through a specific attention mask, improving the acceptance length.

    The common goal of all these forms is: to produce candidate tokens that are as cheap as possible while being close to the target distribution and having a high acceptance rate.

    8. Engineering Considerations

    To use speculative decoding well in a local or cloud-based inference service, consider the following:

    1. Framework support: This technique is being progressively adopted by mainstream inference frameworks. When using it, prefer an inference runtime that already supports speculative decoding—it is usually enabled by configuring a draft model or draft strategy.
    2. Draft model matching: Prefer a draft model from the same source as the target model and sharing its vocabulary, as the acceptance rate is often higher.
    3. Combining with quantization and cache management: In VRAM-constrained local environments, speculative decoding can be combined with general techniques such as weight quantization and KV Cache optimization, but watch out for their combined impact on acceptance length and verification overhead.
    4. Benchmark-driven tuning: Don’t set the draft length by intuition; run benchmarks based on the real prompt distribution, observe the average acceptance length, time-to-first-token latency, and end-to-end throughput, then decide on a strategy.
    5. Cloud elasticity: If local resources are insufficient, inference workloads can be moved to a cloud platform offering elastic compute, using general cloud capabilities such as containerized deployment, monitoring and alerting, and logging to schedule speculative decoding strategies adaptively by concurrency.

    Conclusion

    The essence of speculative decoding is to transform the most expensive “step-by-step weight shuttling” step in large model inference into an efficient mode of “batch prediction + one verification.” Without new GPUs and without further compressing the model, it can deliver several-fold speedups simply by changing the way tokens are generated, while rejection sampling guarantees that the output distribution stays consistent with the original model—a genuine form of “lossless acceleration.” For developers who care about local deployment, low-latency responses, and inference cost, understanding and making good use of speculative decoding is already an unavoidable fundamental skill when optimizing large model inference.