Speculative Decoding: Accelerating LLM Inference Without Upgrading GPUs

    Speculative decoding can speed up LLM inference without changing hardware or model weights by changing how tokens are generated. This article explains the memory-bandwidth bottleneck in decoding, the draft-and-verify method, how acceptance length determines real gains, and practical deployment considerations.

    In LLM inference optimization, most approaches focus on compute: upgrading to more powerful GPUs, quantizing and compressing models, or reducing parameter count. Speculative decoding takes a different path. It does not change hardware or model weights; it changes how tokens are generated, and can increase single-request generation speed to multiple times the original. Many mainstream inference frameworks now include it as a native capability, making it a cost-effective optimization for local LLM deployment.

    1. Where the Bottleneck Is: Memory Access in Decoding

    To understand the value of speculative decoding, it helps to first see the real bottleneck in LLM inference. A complete inference run usually has two phases:

    1. Prefill phase: The model processes the user’s entire prompt at once, computes attention, and builds the KV cache. In this phase, many tokens are computed in parallel, the GPU’s matrix computation capacity is fully utilized, and performance is mainly constrained by compute.
    2. Decoding phase: The model starts generating output tokens one by one. Because sequence generation is autoregressive, each step can produce only one token, and generating the next token must wait for the previous step to finish.

    The problem lies in the decoding phase. For every generated token, the hardware must read the model weights and the existing KV cache from GPU memory in full, compute the result, write new key/value entries into the cache, and then repeat. When a model has tens or even hundreds of GB of weights, generating each token means moving massive amounts of data. At this point, GPU compute units are often waiting, and the real limiter is no longer compute but memory bandwidth.

    In other words, each forward pass in the decoding phase has very low arithmetic intensity but still pays the full memory-access cost of reading the weights. That is exactly the entry point for optimization.

    2. Core Idea: A Small Model Drafts, a Large Model Verifies

    The basic idea of speculative decoding is to let a small, fast draft model handle the “easy-to-predict” part, and then have the large target model verify candidates in batches.

    A simple example: after the user provides the preceding text, the draft model may predict several candidate tokens in one go. The target model then needs only one forward pass to check these candidates in parallel:

    • If a candidate token is consistent with the target model’s probability distribution, it is accepted directly. This means one target-model computation advances multiple positions.
    • If a candidate is rejected, that position and all following candidates are discarded. The target model supplies a corrected token, and a new draft round begins.

    The key point is that this verification method can mathematically guarantee that the final output distribution matches what the target model would produce when decoding alone. In other words, the speedup does not come at the cost of output quality. Content that would originally require three or four target-model rounds can now sometimes be completed in a single verification round. Because the draft model is small, the cost of generating candidates is much lower than the cost of the target model reading the full weights multiple times.

    An illustrative pseudocode example is shown below:

    1. while not finished:
    2. draft_tokens = draft_model.generate(k candidates)
    3. accepted = target_model.verify(draft_tokens) # single forward pass
    4. output += accepted
    5. if len(accepted) < k:
    6. output += target_model.correct() # correct rejected position

    3. More Draft Tokens Do Not Always Mean More Speed

    Speculative decoding is not a free lunch. The core metric that determines actual benefit is the average acceptance length: how many draft tokens the target model accepts per round on average.

    • If the draft model predicts four tokens at once and three are accepted, one target-model forward pass advances three positions, which is a significant gain.
    • If the draft model guesses wrong frequently, the target model must repeatedly reject and correct, and the extra computation in the draft phase can actually slow down overall generation.

    Therefore, choosing a draft model requires balancing two factors: first, its distributional correlation with the target model—the higher the correlation, the higher the acceptance rate; second, its own inference overhead—a larger draft model is more accurate but also more expensive to draft with. A common approach is to choose a smaller-parameter version from the same model family as the target model, or a model with a parameter count around one-tenth or less of the target model. Task type also affects results: highly patterned content such as code completion and formatted text usually has a higher acceptance rate, while highly random creative text sees a smaller benefit.

    4. Engineering Considerations

    In practical deployment, several points are worth noting:

    1. Benefit changes under concurrency: The speedup is most pronounced in single-request scenarios and can approach 4x in some tests. As concurrent requests increase, overall system throughput is more likely to be saturated by parallel use of compute and bandwidth, so the relative benefit of speculative decoding decreases, though it can still maintain roughly 2x throughput improvement. High-concurrency services should use stress testing to evaluate whether to enable it.
    2. Framework support: Mainstream inference frameworks generally provide this capability. It usually only requires specifying an additional draft model when loading the model, so integration cost is low.
    3. Parameter tuning: The number of draft tokens per round is a key hyperparameter. If it is set too low, verification benefit is limited; if it is set too high, waste after rejection is amplified. It is recommended to tune it based on measured acceptance rates for the target scenario.

    5. Conclusion

    The essence of speculative decoding is to rewrite the inefficient decoding pattern of “one memory access advances only one token” into “one memory access verifies multiple tokens.” It requires no new hardware, does not sacrifice output quality, and has almost zero deployment cost. It is an optimization worth trying first in both local deployment and LLM service scenarios. For developers constrained by GPU memory bandwidth, understanding and applying this technique well can often deliver results faster than upgrading hardware.