Speculative Decoding with Draft Models: An Acceleration Approach for LLM Inference

    This article explains how speculative decoding accelerates large language model (LLM) inference by pairing a small draft model with the target model. It covers the core "draft-and-verify" mechanism, practical engineering considerations for production deployment, measured performance gains in low-entropy long-context scenarios, and actionable recommendations for adopting the technique in real-world serving systems.

    Why LLM Inference Needs an Acceleration Engine

    As large language models continue to evolve, training and inference are no longer isolated phases. Training requires large volumes of high-quality generated data, while inference-side feedback flows back into data management and parameter updates, forming a closed loop. In this loop, inference performance directly affects the efficiency of data generation, the cost of online services, and the end-user experience.

    In this context, resource scheduling, data management, computational consistency, and inference performance have become interconnected engineering challenges rather than independent metrics to be optimized in isolation. Among these, decoding speed remains one of the key bottlenecks limiting inference throughput. In traditional autoregressive decoding, the model performs a full forward pass for every generated token. However, the memory-access cost in each forward pass often far exceeds the compute cost, leaving GPU utilization low and making the per-token latency difficult to compress.

    Reproducing verified performance in real runtime environments and identifying bottlenecks across model architecture, runtime, software stack, and hardware is a critical part of the AI engineering pipeline. Speculative decoding has emerged as a widely adopted inference acceleration technique precisely to address these constraints.

    Core Principle of Speculative Decoding

    The fundamental idea behind speculative decoding can be summarized as a two-stage “draft-and-verify” collaboration:

    1. Draft generation: A small model (the draft model), with far fewer parameters than the target model, quickly generates a sequence of candidate tokens autoregressively. Because the draft model is compact, its per-step generation cost is extremely low.
    2. Parallel verification: The target model takes the entire candidate token sequence produced by the draft model and verifies all candidate tokens in a single forward pass, checking whether they align with the target model’s output distribution. Accepted tokens are kept directly; at the first rejected position, the process rolls back, and the target model resamples.

    Because verification is performed in parallel, one forward pass can “confirm” multiple tokens at once, drastically reducing the serial waiting time of token-by-token generation. Mathematically, with an appropriate acceptance strategy, the output distribution of speculative decoding exactly matches that of direct sampling from the target model—meaning acceleration does not compromise generation quality.

    This division of labor—“a small model paves the way, a large model makes the final decision”—essentially trades the draft model’s low-cost computation for valuable parallel verification opportunities on the target model.

    Engineering Design of the Draft Model

    From “Works in Principle” to “Production-Ready”: One-Click Reuse

    A bare speculative decoding scheme often exists only as an algorithm in a research paper, far from production readiness. The key to engineering adoption lies in two aspects:

    • Dynamic path selection: During candidate token generation, the draft model adjusts its draft length and generation path based on features of the current context, such as entropy or historical acceptance-rate statistics. In high-confidence scenarios, it generates more candidate tokens to increase the “yield” of each verification round; in low-confidence scenarios, it shortens the draft to avoid wasteful computation.
    • One-click inference integration: The draft model, target model loading, KV cache management, verification logic, and rollback strategy are encapsulated into a unified inference component. Users can enable speculative decoding in existing deployments without needing to understand the underlying details.

    Key Coordination Points Between Draft and Target Models

    In real-world engineering, the collaboration between draft and target models requires careful handling of the following issues:

    • Vocabulary and distribution alignment: The draft and target models must share the same vocabulary space, and the acceptance strategy must preserve output distribution consistency.
    • KV cache management: After a rejection, the KV caches of both the draft and target models must be rolled back precisely to avoid state contamination.
    • Scheduling under concurrent requests: In batched, concurrent request scenarios, the interleaving of draft generation and verification significantly affects overall throughput, requiring fine-grained scheduling at the runtime level.

    Measured Performance: Acceleration in Low-Entropy, Long-Context Scenarios

    In a typical large-model deployment configuration (8 high-end GPUs, tensor parallelism TP=8), for a context length of 32k tokens with low-entropy characteristics, the measured results using the described draft-model scheme are as follows:

    • Single-concurrency decoding speed reaches 288.2 tokens/s, approximately 3.41× the native autoregressive decoding speed.
    • At 64 concurrent requests, total throughput reaches 608.71 tokens/s, a 44.9% improvement over the native scheme.

    Two important observations can be drawn from these numbers:

    1. The single-concurrency scenario benefits the most. Under single concurrency, the memory-access bottleneck of autoregressive decoding is most severe. Speculative decoding compresses the confirmation of multiple tokens into one forward pass, so the speedup is closest to the theoretical upper bound.
    2. Under high concurrency, the gain narrows but remains significant. As concurrency increases, the natural parallelism of batched computation already amortizes memory-access overhead, reducing the marginal benefit of speculative decoding. Additionally, the extra computation from the draft model consumes some compute capacity. The 44.9% throughput improvement therefore indicates that scheduling is well optimized, keeping the draft overhead within a reasonable range.

    The “low-entropy context” precondition is also critical: when the generated content has a more predictable distribution, the draft model’s candidate tokens are more likely to be accepted by the target model, leading to higher verification acceptance rates and thus better acceleration. Conversely, in high-entropy, highly divergent creative tasks, the draft length should be adaptively shortened via dynamic path selection to maintain overall efficiency.

    Practical Recommendations

    Based on the described scheme and measured data, the following deployment recommendations can be made:

    • Prioritize low-entropy scenarios: Code completion, structured output generation, summarization, and rewriting tasks have relatively low entropy and offer the most obvious benefits from speculative decoding. These should be prioritized for integration.
    • Focus on end-to-end metrics rather than isolated speedup ratios: Throughput behavior varies significantly across concurrency levels, so the value of the scheme should be evaluated against real traffic profiles.
    • Integrate speculative decoding into the engineering loop: Combine it with resource scheduling, monitoring and alerting, and performance profiling infrastructure. Continuously track metrics such as acceptance rate and rollback rate to build an iterative, optimizable inference acceleration system.

    Conclusion

    Speculative decoding represents an important direction in LLM inference optimization: instead of modifying the model itself, it restructures the computational pattern of the decoding process through collaboration between a draft model and the target model. Combined with dynamic path selection and one-click engineering wrappers, this approach is now mature enough for large-scale production deployment. For inference services aiming for lower latency and higher throughput, mastering the principles and tuning methods of speculative decoding will become an indispensable part of the AI engineering skill set.