Speeding Up LLM Decoding with Speculative Decoding: Draft-Target Collaboration in Practice

    This article explains how speculative decoding reduces the serial bottleneck of autoregressive LLM inference. It covers the draft-and-verify workflow, dynamic draft path selection, benchmark results for single-stream and high-concurrency serving, and practical considerations for deploying speculative decoding in production.

    1. Introduction: The Performance Bottleneck of Autoregressive Decoding

    LLM inference generates text one token at a time. Each new token requires a full forward pass, and the result is written to the KV cache so the next step can use it. Generating a sequence of N tokens therefore means running N complete forward passes in sequence. In low-concurrency, low-latency scenarios, this serial wait is the main limit on decoding speed. In high-concurrency scenarios, frequent small-batch forward passes often fail to use accelerator compute fully, which leaves hardware utilization low.

    As LLMs move into continuous iteration, training and inference form a loop through data generation, environment feedback, and parameter updates. Inference performance is no longer an isolated problem. It depends on resource scheduling, data management, and computational consistency across the system. Reproducing validated performance in a real production environment, and locating bottlenecks across the model, runtime, software framework, and hardware, has become a key step in the AI engineering workflow. Speculative decoding is an important class of optimization techniques designed to address the serial decoding bottleneck.

    2. Core Principles of Speculative Decoding

    2.1 The Draft-and-Verify Two-Stage Paradigm

    The core idea of speculative decoding is to trade cheap computation for parallel verification:

    1. Draft generation: A draft model, with far fewer parameters than the target model, generates k candidate tokens autoregressively and quickly. Because the draft model is inexpensive to run, this stage takes much less time than generating the same tokens one by one with the target model.
    2. Parallel verification: The k candidate tokens are concatenated and fed into the target model in a single parallel forward pass. This produces a probability distribution at each position. A sampling consistency rule then determines how many candidate tokens to accept.

    If the verification strategy is designed correctly, the final output distribution matches the output of native autoregressive decoding from the target model exactly. The speedup does not come at the cost of generation quality. In the worst case, every candidate is rejected. The process then reduces to normal decoding plus one extra token, so quality does not regress.

    2.2 Sources of the Speedup

    One target model forward pass can verify k candidate positions. If the average accepted length is m, the process uses one target model forward pass and k draft model forward passes to produce m tokens. When the draft model’s per-pass cost is much lower than the target model’s, and the acceptance rate is high, overall decoding speed improves substantially. Engineering optimization therefore focuses on two goals: raising the acceptance rate of candidate tokens and reducing the relative cost of draft generation.

    3. Dynamic Path Selection: More Efficient Draft Generation

    Traditional draft models generate candidates with a fixed depth and fixed length. However, the predictability of different contexts varies widely. In low-entropy settings, such as code completion, formatted output, and repetitive text, the draft model can often guess the following tokens correctly. In high-entropy settings, generating long candidates without discrimination wastes verification compute.

    Dynamic path selection addresses this difference. The draft model adjusts the depth and length of its draft based on the uncertainty of the current context. It extends candidate chains on high-confidence paths and stops early on low-confidence paths. This reduces wasted draft computation while maintaining the acceptance rate. Draft schemes built on this approach can also be packaged as one-click reusable inference configurations. This lowers the cost of deployment and tuning and helps speculative decoding move from a research prototype to a standard inference component.

    4. Measured Performance

    The verification target was a flagship large language model. Testing used 8 high-performance accelerator cards with tensor parallelism set to TP=8, on a 32k low-entropy context. With the dynamic path selection draft scheme, the results were as follows:

    • Single-concurrency scenario: Decoding speed reached 288.2 Token/s, about 3.41 times the speed of native autoregressive decoding. In low-entropy contexts, the acceptance rate of candidates is high, so the parallel verification advantage of speculative decoding is fully realized. This significantly reduces the wait time per token.
    • High-concurrency scenario: At 64 concurrent requests, total throughput reached 608.71 Token/s, a 44.9% increase over the native approach. At high concurrency, verification batches grow and the cost per unit of compute rises, so the speedup ratio declines. This is expected, but the throughput gain remains substantial.

    These results show that speculative decoding delivers the greatest benefit in latency-sensitive single-stream scenarios. It also provides steady gains in throughput-oriented multi-concurrency scenarios. The size of the gain, however, depends on the balance among acceptance rate, batch size, and hardware bandwidth.

    5. Key Considerations for Production Deployment

    5.1 Matching the Draft Model to the Target Model

    The draft model’s vocabulary and tokenization must match the target model exactly. Otherwise, the verification stage cannot align the two outputs. Draft models are usually obtained by distilling the target model or by lightweight fine-tuning. The closer the draft model’s distribution is to the target model’s, the higher the acceptance rate.

    5.2 Context Characteristics and Scenario Fit

    Low-entropy scenarios, such as code generation, templated text, and AI agent tool calls, are naturally suited to speculative decoding. Open-ended creative writing and other high-entropy scenarios offer limited gains. In practice, teams can enable or disable speculative decoding, or adjust the candidate length, based on the traffic characteristics of their business.

    5.3 System-Level Co-Optimization

    Speculative decoding adds the memory footprint of two models, a draft model and a target model. In multi-card deployments, tensor parallel partitioning and the KV cache budget must be planned carefully. The scheduling strategy for verification batches also affects GPU utilization. Teams should combine container platform capabilities with monitoring and alerting to observe and tune key metrics continuously, including acceptance rate, per-step latency, and throughput.

    6. Conclusion

    Speculative decoding follows the pattern of “the draft model proposes quickly, the target model verifies in parallel.” This pattern breaks the serial bottleneck of autoregressive decoding while keeping the output distribution unchanged. Dynamic path selection further improves the adaptability of draft generation. In the tested configuration, single-concurrency decoding speed improved by more than 3 times, and high-concurrency throughput also improved significantly. For teams looking to reduce cost and improve efficiency on the LLM inference side, speculative decoding is a general acceleration approach worth evaluating early.