Parallel Draft Speculative Sampling: Principles and Dynamic Scheduling

    Speculative sampling can accelerate autoregressive generation by proposing multiple draft tokens and verifying them with a target model, but generating more draft tokens does not automatically improve latency or throughput. This article presents a co-design view of parallel draft generation, low-rank Markov correction, position-level confidence estimation, probability calibration, and batch-level dynamic verification scheduling. It covers the correctness conditions for speculative sampling, the tradeoff between parallel drafting and local consistency, prefix-based marginal value estimation, and a practical incremental scheduling heuristic. It also outlines a four-layer evaluation method that separates model-level gains from end-to-end serving gains.

    1. Why Speculative Sampling Needs Co-Design Beyond Single-Point Optimization

    Autoregressive language models typically generate one token at a time. Each step requires model computation, weight access, and maintenance of historical state, so step-by-step decoding can become a bottleneck for latency and throughput when generating long responses.

    The basic idea of speculative sampling is to let a lower-cost draft model propose multiple candidate tokens first, and then have the target model verify them together. Verification can check multiple positions in one computation, creating an opportunity to reduce the number of target-model invocation rounds.

    However, generating more draft tokens at once does not mean faster final generation. At least three factors affect the payoff:

    • Draft generation cost: The draft model’s own computation and data access must not be too heavy.
    • Candidate acceptance length: Only some of the generated candidates will pass verification consecutively.
    • Target verification cost: Verifying more tokens expands computation and may also increase memory usage and scheduling overhead.

    A complete solution should therefore not optimize only the draft model. It should form a closed loop around “generate candidates — predict value — allocate verification resources.”

    The technical route discussed in this article can be abstracted into three main components: a parallel draft generator, a position-level confidence estimator, and a dynamic verification scheduler for an entire batch of requests.

    2. Correctness First: Speculative Sampling Does Not Mean Trusting the Draft

    The output distributions of the draft model and the target model are usually not identical. If draft outputs are treated directly as final results, generation behavior will deviate from the target model.

    Let the draft distribution at a position be (q(x)) and the target distribution be (p(x)). In standard stochastic speculative sampling, for a candidate (x) sampled from the draft distribution, the following acceptance probability can be used:

    [
    a(x)=\min\left(1,\frac{p(x)}{q(x)}\right)
    ]

    If the candidate is rejected, resampling should use an appropriate residual distribution rather than simply selecting the token with the highest probability under the target distribution.

    When these conditions hold, speculative sampling can preserve an output distribution consistent with sampling from the target model. There are two important prerequisites.

    First, the verification side must use the probabilities corresponding to the draft’s actual sampling process. If the draft undergoes additional dependency correction but acceptance is still judged using the pre-correction distribution, correctness may be broken.

    Second, sampling settings such as temperature and candidate truncation must be included in probability calculation. The implementation cannot use a truncated distribution on one side and untreated probabilities on the other.

    For deterministic decoding, the verification rule is different, and the stochastic acceptance formula cannot be treated as the entire implementation logic. An engineering implementation should first clarify which target decoding behavior it needs to preserve.

    3. Parallel Drafting: Concentrating Heavy Computation in One Forward Pass

    A traditional autoregressive draft model still generates tokens one by one. Although it is lighter than the target model, sequential dependencies within a block remain.

    Parallel drafting takes a different approach: it constructs multiple positions to be predicted at once and computes the entire block simultaneously through a shallower attention network.

    One implementation approach is to reuse part of the hidden states produced by the target model during the previous verification round. By fusing these states and projecting them into history key-value representations readable by the draft network, the cost of independently encoding the full history in the draft model can be reduced.

    The first position of the current draft block is filled with an already determined boundary token, while the remaining positions use placeholder representations. The draft network then computes representations and base output scores for multiple positions in one pass.

    This design concentrates a large amount of matrix computation, making it more suitable for parallel execution. But it also has a structural weakness:

    During recomputation, a later candidate position does not know what the previous position ultimately sampled.

    For example, the same prefix might continue with “connect to the database” or “connect to the message queue.” If later positions cannot perceive the actual choice at the previous position, they may generate candidate sequences that concatenate across branches.

    As block length increases, tail positions therefore do not necessarily retain a high acceptance probability. Simply extending the parallel block may only produce more candidates that are quickly rejected.

    4. Low-Rank Markov Correction: Lightweight Sequential Dependencies for Local Consistency

    One compromise for addressing this issue is to keep the parallel backbone and add local dependency correction at the output side.

    Let the base output score at position (k) be (zk), and let the previously sampled token be (x{k-1}). The corrected score can be written as:

    [
    \widetilde zk=z_k+T[x{k-1},:]
    ]

    Here, (T) represents the influence of the previous token on the current token distribution.

    Storing a full transition matrix would require roughly (V^2) parameters for a vocabulary size of (V), which is usually too expensive. A low-rank decomposition can therefore be used:

    [
    T\approx AB
    ]

    where:

    [
    A\in\mathbb{R}^{V\times r},\qquad
    B\in\mathbb{R}^{r\times V}
    ]

    The rank (r) should be significantly smaller than the vocabulary size. Its specific value needs to be determined through quality and cost experiments rather than treated as a universal constant.

    The processing flow at each position becomes:

    1. Look up a low-dimensional vector from matrix (A) based on the previous token.
    2. Multiply that vector by matrix (B) to obtain a vocabulary-sized correction term.
    3. Add the correction term to the base output score at the current position.
    4. Sample from the corrected distribution and pass the result to the next position.

    This does not completely eliminate sequential execution. Instead, it compresses the sequential part into the output side and avoids running the full draft backbone repeatedly for each position.

    At the same time, this overhead should not be treated as zero. The correction still involves vocabulary-sized operations, probability normalization, and sampling. When the vocabulary is large, the batch is small, or execution fusion is insufficient, its latency may be non-negligible.

    It is also important to note that first-order Markov correction explicitly captures only the influence between adjacent tokens. It cannot replace full long-range dependency modeling. Rather, it supplements the ability of parallel drafting to represent local coherence.

    5. Confidence Head: From Candidate Content to Verification Value Prediction

    After draft generation, the scheduler needs to decide which request deserves verification of more positions and which positions are likely to waste computation.

    A lightweight confidence head can be added for this purpose. It reads the draft hidden representation at the current position and the low-rank correction representation corresponding to the previous token, and outputs an estimate between zero and one.

    Define:

    [
    ck=\Pr(A_k\mid A_1,\ldots,A{k-1})
    ]

    Here, (A_k) means that the (k)-th candidate passes verification. That is, (c_k) is the conditional probability that the current position is accepted given that all previous positions have been accepted, not an independent success rate detached from the prefix.

    For standard stochastic speculative sampling, under a fixed prefix, the average acceptance probability of a draft candidate can be written as:

    [
    \sum_x\min(p(x),q(x))
    =
    1-\operatorname{TV}(p,q)
    ]

    where:

    [
    \operatorname{TV}(p,q)=\frac12\sum_x|p(x)-q(x)|
    ]

    This relationship provides a training objective: let the confidence head learn the degree of overlap between the draft distribution and the target distribution.

    However, (q) here must be the conditional distribution actually used for candidate sampling, including local correction and related sampling transformations. Otherwise, the training labels and online verification behavior may be inconsistent.

    Why Prefix Probabilities Matter

    Speculative verification usually accepts only contiguous prefixes. Once an earlier position is rejected, later candidates cannot directly count toward the accepted length for that round, even if they look reasonable in isolation.

    Therefore, the probability that the (j)-th position can actually be accepted and retained is:

    [
    Pj=\prod{k=1}^{j}c_k
    ]

    If a verification round checks the first (L) candidates, the expected number of accepted draft tokens is:

    [
    \mathbb{E}[NL]=\sum{j=1}^{L}P_j
    ]

    This expression directly reveals marginal value: verifying one more position adds an expected acceptance amount equal to that position’s (P_j).

    It also explains why resources should not be allocated only according to the current position’s (c_j). A position itself may be easy to pass, but if the prefix is difficult to accept, its contribution to actual throughput remains small.

    6. Probability Calibration: Good Ranking Does Not Guarantee Usable Values

    A confidence model may be good at distinguishing “easy to accept” from “hard to accept,” while its probability values may still be inaccurate.

    For scheduling, ranking ability and calibration ability serve different roles:

    • Ranking ability determines which candidates are considered first.
    • Calibration ability determines where verification should stop.

    Systematic overestimation causes the scheduler to verify too much and increases the target model’s burden. Systematic underestimation causes premature truncation and discards candidates that could have been accepted.

    Post-processing methods such as position-wise temperature scaling can calibrate outputs on independent validation data. For example, for an uncalibrated score (u_k), one can use:

    [
    c_k=\sigma(u_k/T_k)
    ]

    where (T_k) is a calibration parameter.

    However, temperature scaling does not guarantee removal of all types of bias. If there are clear global offsets, task differences, or distribution shifts, more flexible calibration methods may be needed.

    In engineering practice, per-position conditional probabilities and cumulative prefix probabilities should be observed separately. Because errors at multiple positions propagate through multiplication, checking only the average error of each confidence head may fail to reveal distortion in long-prefix estimates.

    7. Dynamic Scheduling: Optimizing Batch-Level Gain, Not Individual Request Length

    A fixed verification length is simple to implement, but candidate quality varies greatly across requests. Structurally stable text continuation may suit longer verification blocks, while open-ended generation or high-uncertainty content may suit shorter blocks.

    Let request (i) verify (L_i) candidates. The total candidate verification volume for the batch is:

    [
    B=\sum_i L_i
    ]

    The total expected number of accepted draft tokens is:

    [
    G=\sumi\sum{j=1}^{Li}P{i,j}
    ]

    If one full round takes time (T), the optimization objective can be described as:

    [
    \Theta\approx\frac{\mathbb{E}[\text{actual output tokens in this round}]}{T}
    ]

    The numerator may include not only accepted draft tokens but also correction tokens after rejection or additional target tokens after full acceptance. How these are counted depends on the implementation rules.

    The denominator should also include not only target verification time but also draft generation, local correction, scheduling, cache handling, and necessary data movement. Comparing schemes only by accepted length can easily overestimate actual gains.

    A Practical Incremental Scheduling Approach

    One can start from each request’s next verifiable position, select candidates according to expected marginal acceptance gain, and re-estimate batch throughput after each expansion.

    The basic steps are:

    1. Compute position-level prefix probabilities for each request.
    2. Among candidates that satisfy prefix constraints, prioritize positions with higher marginal gain.
    3. Estimate the impact of additional verification volume on full-round execution time.
    4. Stop expanding if the additional gain cannot offset the additional cost.
    5. Apply constraints such as memory usage, maximum block length, and request latency at the same time.

    Because (P_{i,j}) does not increase with position, sorting by prefix probability naturally helps preserve contiguous prefixes. In real systems, however, costs are often non-linear: batch filling, execution grouping, cache layout, and changes in computation scale can all alter marginal cost.

    This method should therefore be viewed as a practical heuristic, not a global optimum that holds in every environment. When necessary, multiple budget candidates can be compared to avoid missing a more suitable execution scale because of a single local decrease.

    8. Evaluation: Separating Model Gains from System Gains

    A complete evaluation should be divided into four layers.

    1. Correctness Verification

    Confirm that acceptance decisions use the true draft distribution, and check residual resampling after rejection as well as temperature and candidate truncation handling. Distribution preservation cannot be judged only by whether the text “looks similar.”

    2. Draft Quality Verification

    Observe per-position acceptance probabilities, consecutive acceptance length, and gain changes under different block lengths. Use controlled experiments that remove local correction to distinguish the effects of backbone improvements from dependency correction.

    3. Confidence and Scheduling Verification

    Compare predicted probabilities with actual acceptance frequencies, focusing on calibration for long prefixes, different tasks, and different sampling settings. Scheduling evaluation should also record the verification length distribution for each request so that averages do not hide extreme cases.

    4. End-to-End Serving Verification

    Measure total throughput, time to first token, inter-token latency, tail request latency, and memory usage together. Tests should cover different concurrency levels, input lengths, output lengths, and mixed workloads.

    In particular, optimal throughput does not necessarily mean optimal user experience. A serving system can include maximum waiting time, request fairness, and latency budgets in its optimization objective to prevent high-acceptance requests from receiving more resources for a long time.

    9. Conclusion: What Matters Is Effective Output per Unit Verification Cost

    The core of this type of speculative sampling scheme is not simply generating longer drafts. It is making three stages work together:

    The parallel backbone reduces candidate generation cost, low-rank local correction improves within-block consistency, confidence estimation turns candidate quality into a schedulable probability signal, and dynamic scheduling then decides verification length based on gain and cost.

    For developers, the most useful judgment criterion is: how much expected effective output does one additional candidate position bring, and how much actual execution cost does it add?

    Only after distribution correctness, probability calibration, and end-to-end cost measurement are all ensured can improvements in accepted length reliably translate into real serving throughput gains.