Speculative Decoding Draft Generation: Parallel and Sequential Co-Design

    Speculative decoding accelerates autoregressive LLM inference by using a low-cost draft model to propose candidate tokens that a target model verifies in a single forward pass. This article examines the tradeoff between sequential and parallel draft generation, presents semi-autoregressive drafting as a middle ground, and discusses load-aware verification for production serving. It also covers acceptance-length modeling, adaptive draft-length policies, and evaluation metrics such as TTFT, TPOT, throughput under concurrency, and output consistency.

    1. The Speed Bottleneck of Autoregressive Decoding

    When a large language model generates text, each step can predict only the next token. The computation for the next step depends on the output of the previous step, so generating N tokens requires at least N forward passes. Each forward pass must read a large number of model weights and the cached key-value tensors (KV Cache), and memory access overhead is often much higher than compute overhead. As a result, accelerator utilization is low, especially at small batch sizes.

    This serial dependency means that simply adding more compute cannot linearly improve generation speed for a single request. To break the bottleneck, a system must produce as many valid tokens as possible from one large-model forward pass without changing the output distribution.

    2. The Basic Workflow of Speculative Decoding

    Speculative decoding works by using a lower-cost draft model to quickly propose several candidate tokens, which the target large model then verifies in parallel in one pass.

    The workflow has three stages:

    1. Draft stage: the draft model proposes a candidate sequence of length k.
    2. Verification stage: the target model performs one forward pass over the entire candidate sequence and produces a probability distribution for each position.
    3. Acceptance stage: candidates are compared position by position from left to right, and candidates that match the target model’s result are accepted. The process stops at the first mismatched position, and the token produced by the target model at that position replaces the candidate.

    The following code is illustrative and omits probability correction details for rejection sampling.

    1. def speculative_step(target, draft, prefix, k):
    2. # 1. Draft: quickly propose k candidate tokens
    3. candidates = draft.propose(prefix, k)
    4. # 2. Verify: one target forward pass returns distributions for k+1 positions
    5. target_probs = target.score(prefix, candidates)
    6. # 3. Accept: compare position by position and keep the longest verified prefix
    7. accepted = []
    8. for i, tok in enumerate(candidates):
    9. if target_probs[i].accepts(tok):
    10. accepted.append(tok)
    11. else:
    12. accepted.append(target_probs[i].resample())
    13. break
    14. else:
    15. # If all pass, get one extra token
    16. accepted.append(target_probs[k].sample())
    17. return prefix + accepted

    Let α be the acceptance probability for each candidate token, with positions treated as independent, and let the draft length be k. Then the average number of tokens produced per verification round is (1 − α^(k+1)) / (1 − α). For α = 0.8 and k = 4, each round produces about 3.36 tokens on average. When α is close to 1, the value approaches k + 1. When α is low, increasing k further yields limited benefit and adds draft overhead. Therefore, the draft model’s own latency must be included in the total latency.

    3. Tradeoffs Between Two Draft Generation Approaches

    Sequential Drafting

    The draft model generates tokens one by one, and each token depends on the previous token. The advantage is contextual coherence and a higher acceptance rate. The disadvantage is that drafting itself requires k serial forward passes through a small model. As k grows, draft latency becomes a new bottleneck.

    Parallel Drafting

    The draft model outputs predictions for k positions in a single forward pass. Draft latency is essentially fixed and fast. However, each position can only predict independently from the same prefix, so adjacent tokens lack dependencies. The later the position, the larger the deviation between the draft and the true continuation, and the acceptance rate drops accordingly.

    The core tension between the two approaches can be summarized as follows: speed comes from parallelism, while quality comes from dependencies.

    4. Semi-Autoregressive Generation: Balancing Speed and Consistency

    One compromise is semi-autoregressive generation. The main structure keeps parallel computation to preserve overall speed. At the output side, a very lightweight sequential module is added to establish dependencies between adjacent draft positions.

    Key design points are as follows:

    • Parallel backbone: most parameters compute hidden states for all positions in one forward pass, so draft latency is close to that of the parallel approach.
    • Lightweight sequential head: the sequential module processes only the hidden states produced by the backbone. Its parameter count and compute are much smaller than the backbone, so the cost of per-position recurrence remains controllable.
    • Dependency propagation: the output at each position can use draft information from previous positions, mitigating the problem of “guessing from scratch” at distant positions.

    To evaluate whether such a design is effective, two metrics should be observed together: the decay curve of acceptance length as position increases, and the extra latency introduced by the additional module. If the sequential module’s latency cancels out the time saved by the parallel backbone, the overall benefit disappears.

    Draft models usually need to be distilled from the target model’s output distribution or real production data. The closer the training data is to the online traffic distribution, the higher the acceptance rate tends to be.

    5. Adjusting Draft Verification Based on System Load

    The value of a draft depends on whether it can be accepted. At low load, the accelerator has idle compute, and verifying more drafts has almost no extra cost. At high load, every request in a batch consumes the same compute. If a draft is destined to be rejected, it takes compute resources away from other requests, and overall throughput drops.

    Strategies include:

    1. Adaptive acceptance-rate control: for requests with low historical acceptance rates, shorten the draft length or pause drafting.
    2. Load-tiered control: when system pressure rises, reduce the global draft length and prioritize throughput.
    3. Batch budget control: include draft verification compute in the scheduler’s budget, and fall back to normal decoding when the budget is exceeded.

    Illustrative code:

    1. def choose_draft_len(load, recent_accept_rate, max_k=8):
    2. if load > 0.9:
    3. return 0 # Disable speculation at full load and fall back to normal decoding
    4. if recent_accept_rate < 0.4:
    5. return 1
    6. return min(max_k, max(1, round(recent_accept_rate * max_k)))

    The thresholds in the code are examples only and should be adjusted based on actual load-test results.

    6. Evaluation Methods for Production Deployment

    When evaluating a speculative decoding solution, it is advisable to track the following metrics together:

    • Time to first token (TTFT) and time per output token (TPOT): these reflect response startup speed and the smoothness of streaming output, respectively.
    • Average accepted length per round: this directly reflects draft quality.
    • Throughput curve as concurrency changes: performance differences under different loads often reveal more than single-request tests.
    • Output consistency: under identical sampling parameters, verify whether the output distribution matches that of the original decoding method.

    Tests should use request distributions close to real production traffic, not only a single fixed set of prompts.

    In addition, the draft model consumes GPU memory, so its memory footprint must be planned together with KV Cache capacity. In long-context scenarios, the draft model’s attention overhead also increases and should be evaluated separately.

    7. Summary

    The core of speculative decoding is to trade a low-cost draft for multiple tokens produced from one large-model forward pass. Semi-autoregressive design allows drafts to achieve a better balance between speed and quality. Load-aware verification prevents invalid drafts from slowing down the overall service. Only by combining the two can throughput and latency be improved reliably under different traffic conditions.