betaFeedback

WorksComputer Science

Look Back, Draft Ahead: Corrective Prefix Attention for Parallel Speculative Decoding

Abstract

Parallel speculative decoders propose an entire token block at once, yet one early inconsistency can cause the target to reject its remaining suffix. We introduce Corrective Prefix Attention (CPA), which combines prefix-aware selection with autoregressive supervision to improve these parallel drafts. CPA lets each candidate attend to earlier choices within the block. Fixed candidate shortlists allow all pairwise interactions to be computed before selection, reducing the sequential walk to table lookups, accumulation and lightweight scoring rather than repeated neural evaluations. An auxiliary autoregressive loss trains the shared backbone on clean prefixes without adding an inference pass. Across eight math, code and dialogue benchmarks with Qwen3-4B and Qwen3-8B targets on Ascend NPUs, CPA commits 13–15% more tokens per verification round than DSpark and 25–26% more than DFlash. Its mean speedups reach 3.35×3.35\times and 3.37×3.37\times under greedy decoding and 2.86×2.86\times under sampling for both targets. Ablations support both components, while capacity sweeps demonstrate that greater acceptance alone does not guarantee faster decoding. These results motivate correcting parallel proposals with causal information while keeping sequential computation inexpensive.

Introduction

Speculative decoding speeds up a large language model by letting a cheap drafter propose tokens that the target model then checks in a single forward pass [16, 2]. Autoregressive drafters such as EAGLE-3 run once per proposed token [17], so long drafts are expensive. Parallel drafters remove this cost. Building on blockwise parallel decoding [20], DFlash conditions a small block model on target features and predicts every position of a block in one pass [3].

Parallel drafting, however, is at odds with how drafts are verified. The target accepts proposals only up to the first token it disagrees with and discards the rest [16]. Speed is therefore governed by where the first error occurs, and an early error costs far more than a late one. Yet a parallel drafter scores every position before any position has been chosen.

Consider a block in which the candidates are they or she at one position, often at the next, and run or runs at the third. The correct verb depends on the subject two positions back. A position-wise argmax cannot react to the subject it actually chose. A correction that looks only at the previous token sees often on both paths and cannot tell them apart. An autoregressive drafter sees the whole prefix, but pays a backbone step for every token.

Recent work therefore adds a correction stage after the parallel pass. DFlash 2 rescores adjacent candidate pairs [12]; Domino and DSpark run a recurrent or Markov head through the block [10, 6]; D-Loop conditions another backbone pass on the selected prefix [4]. These designs trade context against sequential computation: local rescoring is cheap but sees one token, while recurrent heads and repeated passes see more of the prefix at the price of neural computation at every position.

We show that attention-style correction does not need this trade-off. After the parallel pass, each position has a fixed shortlist of candidates. The interaction between a candidate at position ii and a candidate at an earlier position jj then depends only on those two tokens and on block features that are already computed, not on which path is eventually chosen. All such interactions can be computed together in one batched step. Attention over the selected prefix then reduces exactly to gathering and accumulating table entries as choices are made, and the sequential walk contains no neural network evaluation. 910B2 NPUs, in which CPA has the highest mean speedup at both temperatures and commits 13–15% more tokens per round than DSpark. Attending to older choices raises acceptance and speed by about 5% over a local-only selector with similar inferred round cost, the autoregressive loss improves both on all eight benchmarks, and capacity sweeps show when more acceptance stops paying for its cost.

Corrective Prefix Attention (CPA) builds on this observation and uses prefix information once more during training (Figure 1). A parallel drafter only ever learns from masked blocks, so its backbone never practices predicting the next token from a correct prefix, which is exactly the situation that verification rewards. CPA runs the shared backbone a second time on clean, causally masked prefixes and adds a next-token loss over the full vocabulary. This pass exists only during training; inference still runs a single parallel pass.

Corrective Prefix Attention schematic

Figure 1. Corrective Prefix Attention (CPA). (a) A clean, causally masked training pass teaches the shared drafter to predict shifted reference tokens over the full vocabulary. The masked pass learns parallel proposals and their shortlist selection; both views use pre-anchor target features. (b) Only the parallel pass runs at inference; local and history pair scores are prepared before the causal selection walk. (c) Attention to an older subject can change the preferred verb even when the immediate predecessor is fixed. M denotes a mask token. The rank changes are schematic; the anchor and other candidates are omitted.

Our contributions are as follows:

  • A selector that attends over all earlier choices in a drafted block, compiled exactly into precomputed candidate-pair tables so that the sequential walk performs only lookups and additions (§ 3).

  • An auxiliary autoregressive objective that trains the shared parallel backbone on clean prefixes at no inference cost.

  • An evaluation on eight benchmarks with Qwen3-4B and Qwen3-8B targets on Ascend

Related Work

Drafting for speculative decoding. Speculative decoding verifies drafted tokens with the target model and, with rejection sampling, preserves its output distribution ([16, 2]). Autoregressive drafters such as EAGLE-3 reuse target features and produce one token per drafter step ([17]). Block-wise drafters instead predict a whole block at once ([20]). DFlash conditions a small block model on target hidden states ([3]), and DFlare changes how drafter layers access those features ([25]). CPA keeps the DFlash backbone and changes two things: how a path is selected from its proposals, and how the backbone is trained. Correcting parallel drafts. Kim et al. [14] show that independent per-position predictions can be improved by searching a top-kk lattice with a rescoring language model. DFlash 2 scores adjacent candidate pairs within top-16 shortlists and walks the precomputed scores (Inco AI, [12]); this corresponds to the local term of CPA. Domino corrects the parallel logits with a recurrent head trained under a curriculum (Huang et al., [10]), and DSpark combines a sequential correction head with confidence-based verification scheduling (Cheng et al., [6]). D-Loop reruns the backbone conditioned on a selected prefix (Chen et al., [4]), and DDTree verifies a tree of branches rather than a single path (Ringel and Romano, [19]). CPA sits between local rescoring and recurrent correction. It attends over all earlier choices, as a recurrent head can, but each attention interaction involves one pair of fixed candidates, so every interaction is computed before selection begins and the sequential walk only gathers results.

Training with clean prefixes. Domino feeds reference tokens to its correction head during training (Huang et al., [10]). Joint autoregressive and diffusion objectives have been used to train a model that drafts and verifies its own output (Fu et al., [9]). CPA applies a clean-prefix objective to the shared backbone of a separate drafter for a frozen target. The causal pass is a training signal only and does not run at inference.

Measuring speed. Acceptance length and wall-clock speed can disagree: a slower drafter can accept more tokens and still reduce throughput (Yan et al., 2025). Following CORAL and DFlash (Weng et al., [23]; Chen et al., [3]), we report both quantities at temperatures zero and one, and we relate them through the time a verification round takes.

Corrective Prefix Attention

CPA adds a selector to a parallel block drafter and an auxiliary loss to its training (Figure 1). We first describe the proposals the selector chooses from, then the selector, its exact compilation into tables, and finally training and verification.

Parallel Proposals and Shortlists

Let xx be the verified context, ending in an anchor token aa. The drafter proposes mm new tokens in a block of m+1m+1 positions that includes the anchor; we use m=15m = 15. A trainable backbone fθf_\theta maps target features, the anchor embedding and mm mask embeddings to states h1:mh_{1:m} in one parallel pass, and the frozen vocabulary head turns them into unary logits ui∈R∣V∣u_i \in\mathbb{R}^{|V|}. Each position keeps its top-KK candidates,

Ci=(ci,1,…,ci,K)=TopK⁡(ui),(1)C_i = (c_{i,1}, \ldots, c_{i,K}) = \operatorname{TopK}(u_i), \tag*{(1)}

with K=16K = 16 and the unary argmax in slot 1; we write C0=(a)C_0 = (a). DFlash proposes ci,1c_{i,1} at every position. CPA instead chooses one candidate per position, conditioning on the choices already made in the block. Shortlists are fixed once computed, and no reference or target token is ever inserted into them.

Scoring Candidates against the Chosen Prefix

Let y^0=a\hat{y}_0 = a, and let y^1:i−1\hat{y}_{1:i-1} be the candidates chosen so far in the block. Candidate v∈Civ \in C_i receives the score

Si(v)=ui(v)+Li(v,y^i−1)+Hi(v).(2)S_i(v) = u_i(v) + L_i(v,\hat{y}_{i-1}) + H_i(v). \tag*{(2)}

The local term measures compatibility with the immediate predecessor,

Li(v,u)=⟨ci⊙p(u),s(v)⟩r,(3)L_i(v,u) = \frac{\langle c_i \mathbin{\odot} p(u), s(v)\rangle}{\sqrt{r}}, \tag*{(3)}

where cic_i is a projection of the draft state hih_i and p(u),s(v)p(u),s(v) are projections of frozen token embeddings, all of rank r=256r = 256. This is the adjacent-pair correction of DFlash 2 (Inco AI, [12]).

Two paths that end in the same token receive the same local correction, even when their earlier choices differ. The history term separates them by letting each candidate attend to positions 0,…,i−20,\ldots,i-2:

Hi(v)=∑h=1Hωh∑j=0i−2aijh(v,y^j)dijh(v,y^j)1+∑j=0i−2aijh(v,y^j),(4)H_i(v) = \sum_{h=1}^{H} \omega_h \frac{\sum_{j=0}^{i-2} a_{ij}^{h}(v,\hat{y}_j)d_{ij}^{h}(v,\hat{y}_j)}{ 1+\sum_{j=0}^{i-2} a_{ij}^{h}(v,\hat{y}_j)}, \tag*{(4)}
aijh(v,u)=exp⁡(Ctanh⁡(eijh(v,u)C)).(5)a_{ij}^{h}(v,u) = \exp\left(C \tanh\left(\frac{e_{ij}^{h}(v,u)}{C}\right)\right). \tag*{(5)}

Here eijhe_{ij}^{h} is a query–key energy between candidate vv at position ii and token uu at position jj, with a relative-distance bias; dijhd_{ij}^{h} is a scalar value read out for that pair; and ωh\omega_h mixes H=4H = 4 heads of width r/H=64r/H = 64. The constant 11 in the denominator acts as a null slot, so a head can attend to nothing, and the bound C=8C = 8 keeps the weights finite. Appendix B gives the projections. In the example of the introduction, the chosen subject enters the score of run through HiH_i, even though the predecessor often is the same on both paths.

Exact Compilation into Pair Tables

The score in Eq. (4) depends on the chosen prefix, but each pair function depends only on block features and on one pair of (position, token) entries. Because every token that can be chosen is in a shortlist, every pair value can be computed before selection starts. We precompute local tables Ti[k,ℓ]=Li(ci,k,ci−1,ℓ)T_i[k,\ell] = L_i(c_{i,k},c_{i-1,\ell}) and, for 0≤j≤i−20 \le j \le i-2, history tables

Aijh[k,ℓ]=aijh(ci,k,cj,ℓ),A_{ij}^{h}[k,\ell] = a_{ij}^{h}(c_{i,k},c_{j,\ell}),
Bijh[k,ℓ]=Aijh[k,ℓ] dijh(ci,k,cj,ℓ).(6)B_{ij}^{h}[k,\ell] = A_{ij}^{h}[k,\ell]\,d_{ij}^{h}(c_{i,k},c_{j,\ell}). \tag*{(6)}

Selection keeps a numerator Ni,k,hN_{i,k,h}, initially 00, and a denominator Di,k,hD_{i,k,h}, initially 11, for every future position, candidate and head. When position jj selects slot zjz_j (with z0=1z_0 = 1 for the anchor), every position i≥j+2i \ge j + 2 is updated:

Ni,k,h+=Bijh[k,zj],Di,k,h+=Aijh[k,zj].(7)N_{i,k,h} {+}{=} B_{ij}^{h}[k,z_j],\qquad D_{i,k,h} {+}{=} A_{ij}^{h}[k,z_j]. \tag*{(7)}

Position ii then chooses

zi=arg max⁡1≤k≤K[ui(ci,k)+Ti[k,zi−1]+∑hωhNi,k,hDi,k,h].(8)z_i = \underset{1 \le k \le K}{\operatorname{arg\,max}}\left[u_i(c_{i,k}) + T_i[k,z_{i-1}] + \sum_h \omega_h \frac{N_{i,k,h}}{D_{i,k,h}}\right]. \tag*{(8)}

with ties broken toward the earliest slot. By induction, NN and DD hold exactly the numerator and denominator of Eq. (4) before each choice, so compiled and direct selection agree in exact arithmetic (Proposition 1 in Appendix A). Algorithm 1 summarizes the procedure.

Cost. Table construction costs O(m2K2Hrh)O(m^2K^2Hr_h), with rh=r/Hr_h = r/H, once per block. The walk makes mm sequential choices using KK-way argmax, gathers, additions and lightweight scoring, for O(m2KH)O(m^2KH) total work. Construction is quadratic in KK; the walk is linear. At m=15m = 15, K=16K = 16 and H=4H = 4, packed active history tables contain 188,160 values, under 0.8 MB in FP32; the implementation instead allocates dense masked tables. The one-layer selector itself is small: with input width dd and proposal capacity mmax⁡m_{\max}, it adds 5dr+4r2+H(mmax⁡+2)5dr + 4r^2 + H(m_{\max} + 2) parameters, or 3.5M for Qwen3-4B and 5.5M for Qwen3-8B at mmax⁡=15m_{\max} = 15,

Compiled greedy selection
1. Compute hh, uu and CC, the local tables TT and the history tables AA, BB once for the block, in parallel.
2. Set z0=1z_0 = 1, N=0N = 0, D=1D = 1, and apply Eq. (7) for the anchor (j=0j = 0) to all i≥2i \ge2.
3. For i=1,…,mi = 1,\ldots,m: choose ziz_i by Eq. (8); set y^i=ci,zi\hat{y}_i = c_{i,z_i}; apply Eq. (7) with j=ij = i to all q≥i+2q \ge i + 2.
4. Send y^1:m\hat{y}_{1:m} to the target for verification.

Table 1. Algorithm 1: Compiled selection. Only step 3 is sequential; its updates across future positions, candidates and heads run in parallel.

under 0.1% of either target (Appendix § 10). Despite this small parameter count, quadratic table construction can make larger shortlists slower (§ 5).

Training

CPA trains a drafter with three losses,

L=LDFlash+α(t)Lsel+λARLAR,(9)\mathcal{L} = \mathcal{L}_{\mathrm{DFlash}} + \alpha(t)\mathcal{L}_{\mathrm{sel}} + \lambda_{\mathrm{AR}}\mathcal{L}_{\mathrm{AR}}, \tag*{(9)}

where LDFlash\mathcal{L}_{\mathrm{DFlash}} is the original masked-block loss over the full vocabulary ([3]).

Clean-prefix supervision of the backbone. For an anchor bb with token rb,0r_{b,0} and recorded continuation rb,1:mr_{b,1:m}, we run the same backbone causally on the clean tokens, with access to the cached target features F<bF_{<b} that precede the anchor:

gb,j=fθcausal(rb,0:j−1,F<b),g_{b,j} = f_{\theta}^{\mathrm{causal}}\left(r_{b,0:j-1}, F_{<b}\right),
LAR=−∑b∑jVb,jlog⁡softmax⁡(Woutgb,j)rb,jmax⁡(1,∑b∑jVb,j).(10)\mathcal{L}_{\mathrm{AR}} = -\frac{\sum_b \sum_j V_{b,j}\log\operatorname{softmax}(W_{\mathrm{out}}g_{b,j})_{r_{b,j}}}{\max(1,\sum_b \sum_j V_{b,j})}. \tag*{(10)}

WoutW_{\mathrm{out}} is the frozen vocabulary head, and Vb,jV_{b,j} excludes padding, document boundaries and positions after the first invalid label. Causal masks in every layer prevent a position from reading its own label. The loss updates the shared backbone but not the selector. It supervises the backbone over the full vocabulary in the condition that verification rewards, predicting the next token from a correct prefix, including tokens the parallel pass leaves out of its shortlist. The clean activations never enter the masked pass, so inference is unchanged. We use λAR=0.2\lambda_{\mathrm{AR}} = 0.2.

Selector training. The selector learns to rank each shortlist given a prefix. For a recorded continuation, let yi∗=arg⁡max⁡vpT(v∣x,r<i)y_i^* = \arg\max_v p_T(v \mid x, r_{<i}) be the cached greedy target token and SirefS_i^{\mathrm{ref}} the score of Eq. (2) computed with the recorded prefix r<ir_{<i}. Where yi∗∈Ciy_i^* \in C_i, we apply shortlist cross-entropy,

ℓi=−Siref(yi∗)+log⁡∑v∈Ciexp⁡Siref(v),(11)\ell_i = -S_i^{\mathrm{ref}}(y_i^*) + \log\sum_{v \in C_i} \exp S_i^{\mathrm{ref}}(v), \tag*{(11)}

and normalize by the number of valid positions, including those whose target is missing from the shortlist. Once the recorded prefix leaves the greedy target path or the shortlists, its later labels no longer describe what verification would accept, so we gradually down-weight those positions to ρ=0.25\rho= 0.25. The selector-loss weight α(t)\alpha(t) is zero through step 2,000, then ramps linearly to 0.5 at step 4,000. Both corrections are initialized to zero, so training starts from the unary choices. A replay check rejects selector updates that would shorten correctly selected prefixes on stored training examples. Appendix C gives the schedules and replay details.

Verification

The target scores the proposed path in one causal forward pass. Under greedy decoding we commit the longest prefix that matches the target’s choices, plus the target’s token at the first mismatch, or a bonus token if all mm proposals match. This reproduces greedy target decoding exactly, whatever the draft quality (Proposition 4). At temperature one, the proposal is still a deterministic path: CPA returns the selected token IDs without draft probabilities. We verify it with the standard rejection sampler of vLLM, which treats each proposal as a point mass. Proposal y^i\hat{y}_i is accepted with its probability under the processed target distribution; on rejection, y^i\hat{y}_i is removed from that distribution and a token is sampled from the renormalized remainder. Approximate entropy-based verification and block verification are disabled. This preserves the target distribution [16, 2] (Appendix § 12).

Experimental Setup

Targets, benchmarks and baselines. We use Qwen3-4B and Qwen3-8B (Yang et al., [24]) as frozen targets with thinking mode disabled, and evaluate on eight benchmarks: GSM8K, MATH500 and AIME 2025 for mathematics; HumanEval, MBPP and LiveCodeBench for code; and MT-Bench and Alpaca for dialogue ([7, 8, 5, 1, 13, 26, 21] (Hugging Face H4 2024)). All methods use the same evaluation prompts and decoding settings; Appendix § 14 lists the shared dataset versions and splits. We decode at temperatures 0 and 1 with top-pp = 1 and no top-kk truncation, generating at most 2,048 new tokens per request. We compare with target-only autoregressive decoding, the parallel drafters DFlash (Chen et al., [3]) and DSpark (Cheng et al., [6]), and the autoregressive drafter EAGLE-3 (Li et al., [17]). Every drafter proposes 15 tokens per round, matching block size 16. DSpark’s confidence-based scheduling is disabled, so all methods use the same fixed proposal budget.

Training. We train all drafters, including EAGLE-3, from scratch for five epochs for each target on the same OpenPerfectBlend prompts with target-generated responses. The CPA drafter uses the DFlash backbone architecture with the target, token embeddings and vocabulary head frozen. The reference configuration uses K=16K = 16 candidates, rank r=256r = 256, four heads, one selector layer, αmax⁡=0.5\alpha_{\max} = 0.5 and λAR=0.2\lambda_{\mathrm{AR}} = 0.2; Appendix § 11 lists all settings. Training uses eight Ascend 910B2 NPUs: six data-parallel training workers and two that generate target hidden states. On Qwen3-4B, one epoch takes 17 hours for DFlash, 23 for DSpark, 28 for CPA and 34 for EAGLE-3. For the selector ablations, we switch off the history term (local only) or the whole selector (parallel argmax) at inference on the CPA checkpoint. For the AR-loss ablation, a drafter with the same architecture and selector is trained for five epochs with λAR=0\lambda_{\mathrm{AR}} = 0.

Hardware and metrics. Decoding runs on one Huawei Ascend 910B2 NPU (64 GB HBM), using vLLM-Ascend ((Kwon et al., 2023; vLLM Ascend Team, 2025)), CANN 9.1.0 and BF16 weights, with one request at a time. Appendix § 11 lists software versions. Target verification uses a captured graph; draft backbones run eagerly, and DSpark and CPA correction heads use separate graphs. Speedup SS divides output throughput by a fixed AR reference: 47.83 tokens/s for Qwen3-4B and 39.63 tokens/s for Qwen3-8B, at both temperatures. Committed length τ\tau includes the target correction or bonus token and excludes the anchor; EAGLE-3 pools tokens and rounds within each workload. Workload averages are unweighted, so mean speedup also equals mean throughput divided by the model-specific AR reference. We retain available input precision during aggregation and round final summaries half up to two decimals (Appendix § 11). Absolute speedups depend on the accelerator and kernels [10].

Timing methodology. We measure wall-clock stage times using custom instrumentation in the vLLM-Ascend execution path, synchronizing the NPU at each measured stage boundary. Within each workload, we average verification-round timings across all evaluation samples, excluding warmup, prefill and unused final drafts. Table 3 reports the unweighted arithmetic mean of the eight workload-level means, without rescaling. “Other” is the residual round time outside drafting, correction and verification. Throughput and speedup are measured separately with timing instrumentation disabled.

Table 3: Instrumented per-round timing breakdown. Greedy Qwen3-4B, one request; milliseconds. Custom wall-clock instrumentation synchronizes the NPU at stage boundaries. We average verification-round times across all evaluation samples within each workload, then average the eight workload means equally, without rescaling. Warmup, prefill and unused final drafts are excluded. Other is the residual round time. Throughput is measured separately with instrumentation disabled. The accompanying τ\tau values retain their reported precision.

MethodDraftCorrectionVerifyOtherTotalτ\tau
DFlash13.480–13.15813.08439.72225.70
DSpark13.7521.17713.20313.68241.8156.24
CPA14.1382.74813.40614.20744.4997.13

Table 3.

Results and Analysis

CPA is fastest on average in every setting. Table 1 reports all four combinations of target size and temperature. CPA has the highest mean speedup and the longest mean committed length in each: 3.35× and 3.37× with greedy decoding on Qwen3-4B and Qwen3-8B, and 2.86× at temperature one on both. Using unrounded computed workload means, its speedup exceeds DSpark’s by 3.9–7.3% and DFlash’s by 9.8–11.9%, and it commits 12.7–14.6% more tokens per round than DSpark and about 25% more than DFlash. The gains are similar for the two target sizes. EAGLE-3, which drafts one token per step, commits 2.1–2.3 tokens per round, with mean speedups of 1.25×, 1.16×, 1.38× and 1.21× in table order.

Per benchmark, CPA commits the most tokens in all 32 cases and is fastest in 28. The exceptions are MBPP in three settings, where its gain in τ\tau over DSpark falls to 1–6%, and GSM8K on Qwen3-8B at temperature one, where DFlash is fastest despite committing 14% fewer tokens. The largest gains in τ\tau appear on MT-Bench (27–44% over DSpark), but there the speed gain (5–14%) is in line with the other benchmarks.

Longer commits cost more per round. For a fixed AR reference tARt_{\mathrm{AR}}, S≈τtAR/troundS \approx\tau t_{\mathrm{AR}}/t_{\mathrm{round}}, so τ/S\tau/S is an inferred round-cost index in units of the reference token time. Averaging this index over

the 32 workload settings gives 1.92 for DFlash, 2.03 for DSpark and 2.20 for CPA. The CPA index is about 15% higher than DFlash’s and 8% higher than DSpark’s, alongside gains of about 25% and 14% in committed length. The indices reflect all overheads included in the throughput measurements and explain why acceptance gains need not translate proportionally into speed; they are not independently measured round latencies. Table 3 reports synchronized wall-clock stage timings from the instrumented runs. CPA spends 2.748 ms on correction, 6.18% of its 44.499 ms mean instrumented round time; drafting and target verification take 14.138 and 13.406 ms, respectively.

More acceptance does not always mean more speed. Table 2 varies the loss weights and the selector’s capacity around the reference configuration, and Figure 2 plots each variant’s committed length against its speed. A shortlist of 32 raises τ\tau from 7.14 to 7.19 but lowers speedup from 3.35× to 3.26×, consistent with table construction growing quadratically in KK. Rank 512 similarly raises τ\tau to 7.31 but gives only 3.26×, and the stacked two-layer variant gives τ=7.22\tau= 7.22 and 3.34× (Appendix § 10). Smaller settings lose on both metrics: K=8K = 8 and r=128r = 128 reach only 3.19×. These higher-acceptance variants sit on a higher-cost-index line in Figure 2: its extra acceptance is paid for in time per round. The reference configuration (K=16K = 16, r=256r = 256, one layer) is therefore the fastest of those tested, not the most accurate. Raisincreasing the selector-loss weight αmax⁡\alpha_{\max} from 0.125 to 0.5 increases τ\tau from 6.58 to 7.14 and speedup from 3.09× to 3.35×, while αmax⁡=1\alpha_{\max}=1 lowers both.

Scatter plot of committed tokens per round and speedup for baselines, CPA ablations, and configuration variants

Figure 2. Acceptance and speed are not the same. Greedy Qwen3-4B means from Tables 1, 2 and 4. Dashed lines show equal inferred cost index τ/S\tau/S. Orange points show configuration variants; the stacked variant is specified in Appendix § 10. Coordinates use unrounded computed means where workload values are available.

SettingSpeedup SSTokens/round τ\tauSettingSpeedup SSTokens/round τ\tau
Selector-loss weight, αmax⁡\alpha_{\max}Shortlist size, KK
0.1253.09×6.5883.19×6.98
0.2503.20×6.88163.35×7.14
0.5003.35×7.14323.26×7.19
1.0003.30×7.03
AR-loss weight, λAR\lambda_{\mathrm{AR}}Total selector rank, rr
0 (without AR loss)3.28×6.931283.19×6.88
0.13.34×7.092563.35×7.14
0.23.35×7.145123.26×7.31
0.43.35×7.11
Selector implementation
Compiled (1 layer)3.35×7.14
Stacked v2 (2 layers)3.34×7.22

Table 2. Loss weights and selector capacity. Greedy Qwen3-4B; SS and τ\tau are eight-benchmark means. Bold rows are the reference configuration (αmax⁡=0.5\alpha_{\max}=0.5, λAR=0.2\lambda_{\mathrm{AR}}=0.2, r=256r=256, K=16K=16, one selector layer), recomputed from the Table 1 workload values and repeated in each panel. Other aggregate-only observations retain their supplied precision. Larger KK or rr raises τ\tau but not speed. The stacked two-layer row uses local_prefix_v2 (Appendix § 10).

αmax⁡\alpha_{\max} is the final weight of the scheduled selector loss; it is distinct from λAR\lambda_{\mathrm{AR}}. Rank denotes the total projection width, split across four heads. KK is the number of candidates per position, not the number of proposed positions.

MethodGSM8K SSGSM8K τ\tauMATH-500 SSMATH-500 τ\tauAIME25 SSAIME25 τ\tauHumanEval SSHumanEval τ\tauMBPP SSMBPP τ\tauLCB SSLCB τ\tauMT-Bench SSMT-Bench τ\tauAlpaca SSAlpaca τ\tauAvg. SSAvg. τ\tau
Qwen3-4B, temperature = 0 (greedy)
EAGLE-31.31×2.521.32×2.421.30×2.371.30×2.401.21×2.271.24×2.301.17×2.171.18×2.201.25×2.33
DFlash3.95×7.764.27×7.723.49×6.573.11×5.912.77×5.313.02×5.791.66×3.331.69×3.193.00×5.70
DSpark4.04×8.284.34×8.193.67×7.203.31×6.583.00×6.023.09×6.181.76×3.781.77×3.663.12×6.24
CPA4.38×9.854.68×9.623.99×8.053.49×7.173.12×6.613.29×6.711.98×5.121.88×3.953.35×7.14
Qwen3-4B, temperature = 1 (sampling)
EAGLE-31.27×2.461.19×2.231.10×2.071.24×2.351.16×2.211.08×2.041.09×2.061.12×2.121.16×2.19
DFlash3.54×7.023.67×6.842.41×4.852.79×5.352.46×4.812.88×5.471.45×3.021.52×2.922.59×5.04
DSpark3.68×7.653.76×7.282.74×5.612.96×6.072.66×5.422.85×5.761.57×3.461.60×3.382.73×5.58
CPA3.79×8.744.04×8.602.91×6.223.14×6.582.60×5.733.07×6.361.65×4.411.70×3.682.86×6.29
Qwen3-8B, temperature = 0 (greedy)
EAGLE-31.51×2.471.47×2.371.41×2.281.52×2.481.33×2.181.32×2.141.26×2.051.19×1.961.38×2.24
DFlash4.25×7.934.28×7.593.31×6.383.37×6.142.69×5.243.24×6.021.79×3.411.60×3.093.07×5.73
DSpark4.09×8.144.68×8.473.57×7.033.45×6.723.05×6.273.06×6.031.76×3.661.85×3.873.19×6.27
CPA4.27×9.515.03×9.973.74×7.823.72×7.482.84×6.353.48×7.032.01×5.271.89×4.083.37×7.19
Qwen3-8B, temperature = 1 (sampling)
EAGLE-31.37×2.381.28×2.191.17×2.001.34×2.311.21×2.101.10×1.901.11×1.911.12×1.901.21×2.09
DFlash3.86×7.313.61×6.552.24×4.662.86×5.422.29×4.612.97×5.631.55×3.081.45×2.872.60×5.02
DSpark3.69×7.484.07×7.592.54×5.293.09×6.182.60×5.532.86×5.691.56×3.391.60×3.432.75×5.57
CPA3.69×8.474.34×8.832.69×6.013.26×6.792.42×5.663.14×6.461.66×4.571.67×3.732.86×6.32

Table 1 (PDF p. 7). Single-request decoding on Qwen3-4B and Qwen3-8B. Speedup SS uses a fixed AR reference of 47.83 tokens/s for 4B and 39.63 tokens/s for 8B at both temperatures. τ\tau includes the target correction or bonus token; EAGLE-3 uses pooled τ\tau. Avg. is an unweighted workload mean. We use full-precision EAGLE-3 logs and the supplied two-decimal workload values for other methods, retain precision during aggregation, and round once (half up). CPA includes prefix attention and AR supervision. LCB: LiveCodeBench.

Where the gain comes from. Table 4 decomposes the gain on Qwen3-4B with greedy decoding. Even with its selector switched off, the CPA

Table 4: Where the gain comes from. Greedy Qwen3-4B, eight-benchmark means derived from Table 8. Parallel argmax and Local only disable the selector or its history term at inference; No AR loss is trained with λAR=0\lambda_{\mathrm{AR}} = 0. The cost index is the ratio of unrounded workload means τˉ/Sˉ\bar{\tau}/\bar{S}, an inferred normalized cost rather than a measured mean round latency.

VariantSSτ\tauIndex
DFlash (reference)3.00×5.701.90
CPA, parallel argmax3.13×6.262.00
CPA, local term only3.20×6.792.12
CPA, local + history3.35×7.142.13
CPA without AR loss3.28×6.932.11

Table 4.

The checkpoint commits more tokens than DFlash (6.26 against 5.70), so part of the gain comes from training rather than selection. The local term raises τ\tau by a further 8.4% and speed by 2.1%; its inferred cost index rises from 2.00 to 2.12. Adding history raises τ\tau by 5.1% and speed by 4.8%, with a similar inferred cost index (2.13). These indices are ratios of workload means, not independently measured round latencies. History improves both metrics on all eight benchmarks, most on MT-Bench (14.8% in τ\tau) and least on LiveCodeBench and Alpaca (2.0–2.3%; Table 8). Dependencies beyond the previous token thus account for most of the selector’s speed gain.

Table 8: Per-benchmark ablation. Greedy Qwen3-4B; metrics and aggregation as in Table 1. Parallel argmax and Local only switch off the selector or its history term at inference on the CPA checkpoint; No AR loss is a drafter trained with λAR=0\lambda_{\mathrm{AR}} = 0. Means and derived percentages use the supplied workload values before rounding the aggregates.

MethodMathCodeChatOverall
MethodGSM8KMATH-500AIME25HumanEvalMBPPLCBMT-BenchAlpacaAvg.
SSτ\tauSSτ\tauSSτ\tauSSτ\tauSSτ\tauSSτ\tauSSτ\tauSSτ\tauSSτ\tau
Parallel argmax4.07×8.644.44×8.693.69×6.983.33×6.482.85×5.733.29×6.311.59×3.801.78×3.483.13×6.26
Local only4.11×9.244.49×9.223.77×7.603.40×6.983.00×6.363.23×6.581.73×4.461.84×3.863.20×6.79
No AR loss4.29×9.564.58×9.333.90×7.813.43×6.943.08×6.443.24×6.501.91×4.971.84×3.853.28×6.93
CPA4.38×9.854.68×9.623.99×8.053.49×7.173.12×6.613.29×6.711.98×5.121.88×3.953.35×7.14

Table 8.

Adding the AR loss raises mean speedup from 3.28× to 3.35× and mean τ\tau from 6.93 to 7.14: gains of 2.1% and 3.0%, respectively, using the unrounded computed means. Both metrics improve on every benchmark. The inference path is identical, so this gain costs nothing at decoding time. Speedup is flat for AR weights between 0.1 and

0.4 (3.34–3.35×; Table 2), so the method is not sensitive to the exact value of λAR\lambda_{\mathrm{AR}}.

Block size and concurrency. Block size 16 gives the highest τ\tau and speedup for all three parallel drafters (Table 5). Longer blocks offer more positions to accept, but late positions rarely survive while drafting and table construction cost more; at B=32B = 32 every method commits fewer tokens and runs more slowly than at B=16B = 16. The gain of CPA over DSpark in τ\tau is smallest at B=8B = 8 (4.5%), where there are fewer earlier choices to attend to, and larger at B=16B = 16 and 32 (14.4% and 10.3%). Under concurrent requests, speedup over target-only decoding shrinks as batching makes the target more efficient: CPA goes from 3.35× with one request to 1.52× with 32, compared with 1.42× for DSpark at 32 (Table 9 in Appendix E).

Table 5: Block size changes both acceptance and cost. Greedy Qwen3-4B. Each method reports committed tokens per round τ\tau and speedup SS. BB includes the anchor.

BBDFlash τ\tauDFlash SSDSpark τ\tauDSpark SSCPA τ\tauCPA SS
84.3322.37×5.0192.58×5.2472.61×
165.6983.00×6.2363.12×7.1353.35×
324.8711.69×5.6051.85×6.1821.92×

Table 5. Bˉ=8,16,32\bar{B} = 8, 16, 32 permit at most 7, 15, 31 proposed tokens; the anchor is excluded from τ\tau. Each block size uses separately trained drafters. The B=16B = 16 row is recomputed from Table 1; other rows retain the supplied aggregate values.

Table 9: Throughput under concurrent requests. Qwen3-4B, greedy, all evaluation prompts across the eight benchmarks, at most 2,048 new tokens, one Ascend 910B2 NPU. Each cell gives output tokens/s and, below it, speedup over target-only decoding at the same concurrency.

ConcurrencyTargetARDFlashDSparkCPA
147.83 (1.00×)143.49 (3.00×)149.23 (3.12×)160.23 (3.35×)
8248.17 (1.00×)564.88 (2.28×)586.26 (2.36×)631.22 (2.54×)
16452.78 (1.00×)805.54 (1.78×)836.60 (1.85×)895.11 (1.98×)
32649.57 (1.00×)883.01 (1.36×)921.46 (1.42×)986.39 (1.52×)

Table 9.

Conclusion

Parallel drafters are fast because they score every position at once, but verification rewards a block that is consistent from its first token onward. CPA reconciles the two. Its selector attends over every earlier choice in the block, and because the shortlists are fixed, all of that attention can be computed before selection begins, leaving a sequential walk of lookups and additions. An auxiliary autoregressive loss gives the shared backbone practice at predicting from correct prefixes at no inference cost. Attention to older choices accounts for most of the selector’s speed gain while keeping inferred round cost similar. Across eight benchmarks, two target sizes and two temperatures, CPA commits 13–15% more tokens per round than DSpark and has the highest mean speedup in every setting. The capacity sweeps carry a broader lesson for draft correction: added context helps only as long as it stays cheaper than the tokens it saves.

Limitations

Scope of the evaluation. We evaluate two targets from one model family, Qwen3-4B and Qwen3-8B, and run the ablations on Qwen3-4B only. The reported throughput results use one accelerator type, the Ascend 910B2, with vLLM-Ascend. The stage breakdown uses synchronization at each measured boundary and characterizes the instrumented execution; throughput and speedup use separate runs with instrumentation disabled. All methods use a fixed model-specific AR throughput reference, so individual workload ratios are relative to that reference rather than to a separately measured AR throughput for that workload. The relative cost of the sequential selection walk depends on kernel-launch overheads and may differ on GPUs or other serving stacks, so the speedups should not be transferred directly to other hardware. We report single training runs and do not give confidence intervals over retraining or repeated timing; sub-percent differences, such as 3.35× against 3.34×, do not establish a reliable ranking without repeated measurements. Appendix C documents the training recipe and seed roles; final resumption budgets, training-data revisions and evaluated checkpoint identifiers are not available in the accompanying run metadata.

Method. The selector can only choose among the top-KK candidates of the parallel pass, so a target token outside the shortlist ends the accepted prefix regardless of the selector. Table construction grows quadratically with the shortlist size and the block length, which limits how far either can be increased; our capacity sweeps show this cost overtaking the acceptance gain at K=32K = 32. The no-AR drafter was trained in a separate run, so factors other than λAR\lambda_{\mathrm{AR}} may contribute to the gap. The auxiliary causal pass and the selector make training more expensive: on Qwen3-4B, one CPA epoch takes 28 hours on our hardware, against 17 for DFlash and 23 for DSpark. The AR-loss ablation compares drafters at the same number of epochs, not the same compute budget. The selector is trained on recorded prefixes rather than its own choices, so some exposure mismatch remains.

Exactness. The equivalence of compiled and direct selection, and of greedy speculative and target decoding, holds in exact arithmetic. In BF16, changes in summation order can flip decisions near ties, so deployments should check output parity on their own kernels.

Ethical Considerations

CPA accelerates a fixed target model and does not change what it generates under greedy decoding or, with the sampler we use, its output distribution. It therefore neither mitigates nor adds to the target’s risks, such as factual errors or biased outputs. Faster decoding can lower the energy cost per generated token, but we did not measure training or serving energy. All benchmarks are public and used under their licenses.

Formal Properties and Numerical Scope

The statements below concern the one-layer mathematical selector on a fixed block. The fixed-pair compilation and walk-cost guarantees do not extend to the stacked local_prefix_v2 implementation, whose second-layer query depends on the selected prefix through its first layer (Appendix § 10). Let mm be the number of proposed positions, Ci={ci,1,…,ci,K}C_i = \{c_{i,1}, \ldots, c_{i,K}\}, and C0={a}C_0 = \{a\} for the committed anchor. Set k0=1k_0 = 1. All block features are held fixed during selection. We suppress dependence on backbone parameters θ\theta and selector parameters ϕ\phi.

Proposition 1: Exact table compilation. For j≤i−2j \le i - 2, suppose the positive pair weight Aijh[k,l]A_{ij}^{h}[k,l] and weighted readout Bijh[k,l]=Aijh[k,l]dijh(ci,k,cj,l)B_{ij}^{h}[k,l] = A_{ij}^{h}[k,l]d_{ij}^{h}(c_{i,k},c_{j,l}) depend only on fixed block features and the indicated token pair. Maintain a separate pair of accumulators for every destination, candidate, and head:

Nih[k]=∑j=0i−2Bijh[k,kj],(12)N_i^h[k] = \sum_{j=0}^{i-2} B_{ij}^h[k,k_j], \tag*{(12)}
Dih[k]=1+∑j=0i−2Aijh[k,kj].(13)D_i^h[k] = 1 + \sum_{j=0}^{i-2} A_{ij}^h[k,k_j]. \tag*{(13)}

Empty sums are zero. Initialize NN to zero and DD to one; process the anchor column for every i≥2i \ge2. Whenever position j≥1j \ge1 selects kjk_j, add Bijh[:,kj]B_{ij}^h[:,k_j] and Aijh[:,kj]A_{ij}^h[:,k_j] only to destinations i≥j+2i \ge j + 2. Then

Si(ci,k)=ui(ci,k)+Li(ci,k,ci−1,ki−1)+∑h=1HωhNih[k]Dih[k](14)S_i(c_{i,k}) = u_i(c_{i,k}) + L_i(c_{i,k},c_{i-1,k_{i-1}}) + \sum_{h=1}^{H} \omega_h \frac{N_i^h[k]}{D_i^h[k]} \tag*{(14)}

equals direct evaluation of the documented local and older-history terms in exact arithmetic.

Proof. After processing sources 0,…,j0,\ldots,j, each destination accumulator contains its initialization plus exactly the selected table columns with source index at most min⁡(j,i−2)\min(j,i-2). This invariant holds initially and is preserved by the stated additions. Immediately before choosing position ii, its included sources are therefore exactly 0,…,i−20,\ldots,i-2. Substituting the table definitions gives the direct attention numerator and denominator. The immediate predecessor appears only in LiL_i. Thus scores agree; a common deterministic tie rule gives the same choice at each step, by induction. In particular, the history term is zero at position one and uses only the anchor at position two. □

Packed table size. An implementation storing only needed entries uses

nL=K+(m−1)K2,(15)n_L = K + (m-1)K^2, \tag*{(15)}
nA=nB=HP,(16)n_A = n_B = HP, \tag*{(16)}
P=(m−1)K+(m−1)(m−2)2K2.(17)P = (m-1)K + \frac{(m-1)(m-2)}{2}K^2. \tag*{(17)}

For m=15m = 15, K=16K = 16, and H=4H = 4, these are 3,600 local entries and 94,080 entries in each history table. The combined 191,760 scalars occupy approximately 749.1 KiB in FP32 or 374.5 KiB in BF16. These are packed mathematical table sizes, excluding projections, embeddings, accumulators, padding, and execution workspaces; they are not measured device-memory allocations. Table storage is O(Hm2K2)O(Hm^2K^2), while incremental history gathering and accumulation require O(Hm2K)O(Hm^2K) work with mm sequential choices. The exact projection and table-construction costs depend on the specified pair-feature parameterization.

Proposition 2: Shortlist prefix ceiling. For a fixed verified context including anchor aa, let z1:mz_{1:m} be the target’s true greedy continuation, and let C1:mC_{1:m} be the fixed candidate sets produced for that block. Define

RC=min⁡({i:zi∉Ci}∪{m+1})−1.(18)R_C = \min\left(\{i : z_i \notin C_i\} \cup\{m+1\}\right) - 1. \tag*{(18)}

Any selector constrained to CiC_i has at most RCR_C accepted draft tokens before its first mismatch.

Proof. If RC<mR_C < m, then zRC+1∉CRC+1z_{R_C+1} \notin C_{R_C+1}, so no allowed proposal can match the target at that position after matching all earlier ones. The case RC=mR_C = m is immediate. For any distribution of blocks, the tail-sum identity therefore gives

E[A]≤E[RC]=∑ℓ=1mPr⁡(⋂i=1ℓ{zi∈Ci}).(19)\mathbb{E}[A] \le\mathbb{E}[R_C] = \sum_{\ell=1}^{m} \Pr\left(\bigcap_{i=1}^{\ell}\{z_i \in C_i\}\right). \tag*{(19)}

For sequences ending before mm positions, both quantities are truncated at the same EOS or remaining-output boundary. The joint coverage probabilities need not factor into marginal hit rates. Moreover, cached target labels conditioned on a different recorded continuation cannot substitute for z1:mz_{1:m} after that continuation diverges from the true greedy rollout.

Proposition 3: Unary preservation at initialization. Suppose both correction paths are identically zero, all intermediate quantities are finite, and the full-vocabulary unary winner vi⋆v_i^\star is retained as candidate slot one. If candidate score ties favor slot one, initialized selection chooses vi⋆v_i^\star at every position.

Proof. Every candidate score equals its unary logit, and no candidate exceeds the full-vocabulary maximum. Slot one achieves that maximum and wins any tie.

This statement requires compatible unary and selector tie rules. An unspecified top-KK ordering is insufficient when BF16 logits tie. It establishes initialization behavior only.

Proposition 4: Greedy verification preserves target output. Assume a deterministic target decision rule, including identical logits processors and tie handling, and verification logits that equal the corresponding target causal conditionals. Starting from a committed context, accept the longest proposed prefix matching those target decisions. If a mismatch occurs, append the target decision at that position; if the full block matches, append the target’s next decision as a bonus. Stop immediately at EOS and obey the remaining output budget. The committed output is identical to serial target greedy decoding.

Proof. The first verified position is evaluated under the committed context. Each accepted match extends that context by exactly the serial target decision, so induction establishes equality at every accepted position. The correction, or the bonus after a fully accepted block, is evaluated under the resulting matching prefix and is therefore also the serial target decision. Repeating this argument across cycles proves equality until stopping. The anchor is already part of the committed context and is not emitted a second time.

The proposition covers greedy decoding. An exact stochastic extension requires a separately specified proposal distribution and acceptance/correction sampler. In finite precision, batched verification and serial execution must be checked for target-decision parity; identical mathematical models alone do not ensure bitwise equal logits across kernels.

Proposition 5: Scope of the stabilized guard correction. Let gg be the protection-loss gradient with respect to ϕ\phi, let Δ\Delta be the proposed AdamW displacement, and let ϵ>0\epsilon> 0. The documented correction is

Δstab=Δ−max⁡(gTΔ,0)max⁡(∥g∥22,ϵ)g.(20)\Delta_{\mathrm{stab}} = \Delta- \frac{\max(g^{\mathsf{T}}\Delta, 0)}{\max(\lVert g\rVert_2^2,\epsilon)}g. \tag*{(20)}

If gTΔ≤0g^{\mathsf{T}}\Delta\le0, the displacement is unchanged. If a=gTΔ>0a = g^{\mathsf{T}}\Delta> 0 and n=∥g∥22n = \lVert g\rVert_2^2, then

gTΔstab=a(1−nmax⁡(n,ϵ)).(21)g^{\mathsf{T}}\Delta_{\mathrm{stab}} = a\left(1-\frac{n}{\max(n,\epsilon)}\right). \tag*{(21)}

Thus the first-order increasing component is removed when n≥ϵn \ge\epsilon, but remains positive when 0<n<ϵ0 < n < \epsilon. This follows directly by taking the inner product with gg. Consequently the stabilized formula is not universally the Euclidean projection onto the non-increasing halfspace. The exact nonzero-gradient projection uses nn in the denominator; any small-norm alternative must be specified as a distinct implementation choice.

For fixed detached replay features, candidate sets, and deterministic BF16 evaluation, the subsequent discrete test supplies a narrower guarantee: a trial accepted only when every replay example’s protected prefix length is at least its pre-update value preserves those tested lengths. All distributed ranks must satisfy the condition. The implementation takes one AdamW step before projecting and backtracking its parameter displacement. An accepted scaled trial retains that step’s updated moments and incremented counter unchanged; trials do not execute additional optimizer steps. Full rejection restores the previous selector parameters, moments and counter. The learning-rate schedule continues to follow training iterations (Appendix § 11). This statement does not extend to changed backbone features, new shortlists, unseen inputs, online acceptance, or latency.

Finite-precision compilation. Proposition 1 establishes algebraic equality, not bitwise equality after changed summation order, casts, or fused kernels. At a given step, suppose compiled and direct scores differ by at most δ\delta per candidate under the same preceding choices. A direct top-two margin strictly greater than 2δ2\delta preserves that step’s winner: the winner can decrease by at most δ\delta, while any competitor increases by at most δ\delta. Applying this argument inductively preserves the entire selected path if the condition holds at every reached step. Near ties require explicit token-level parity checks, including the deployed BF16 parameter values and captured-graph execution. Warmup parity is a finite implementation check, not a proof for all future blocks.

Selector Specification

Let dd be the common width of the draft states and frozen token embeddings, rr the total projection rank and rh=r/Hr_h = r/H the width of each head. For a vector xx, define ν(x)=x/mean⁡(x2)+10−6\nu(x) = x/\sqrt{\operatorname{mean}(x^2) + 10^{-6}}, an RMS normalization without learned parameters. The local score in Eq. (3) uses

F(v)=ν(E(v)),ci=ν(Whν(hi)),(22)F(v) = \nu(E(v)), \qquad c_i = \nu(W_h\nu(h_i)), \tag*{(22)}
p(u)=ν(WpF(u)),s(v)=WsF(v),(23)p(u) = \nu(W_pF(u)), \qquad s(v) = W_sF(v), \tag*{(23)}

where EE is the frozen embedding table. The candidate and memory features for the history term are

zi(v)=ν(ci+WcF(v)),(24)z_i(v) = \nu(c_i + W_cF(v)), \tag*{(24)}
m(u)=ν(WmF(u)).(25)m(u) = \nu(W_mF(u)). \tag*{(25)}

The hhth slices of Wqzi(v)W_qz_i(v) and Wtzi(v)W_tz_i(v) are qih(v)q_i^h(v) and tih(v)t_i^h(v); the corresponding slices of Wkm(u)W_km(u) and Wvm(u)W_vm(u) are kjh(u)k_j^h(u) and vjh(u)v_j^h(u). For j≤i−2j \le i - 2, the energy and readout are

eijh(v,u)=⟨qih(v),kjh(u)⟩rh+bi−jh,(26)e_{ij}^h(v,u) = \frac{\langle q_i^h(v), k_j^h(u)\rangle}{\sqrt{r_h}} + b_{i-j}^h, \tag*{(26)}
dijh(v,u)=⟨tih(v),vjh(u)⟩rh.(27)d_{ij}^h(v,u) = \frac{\langle t_i^h(v), v_j^h(u)\rangle}{\sqrt{r_h}}. \tag*{(27)}

The five input maps are d→rd \to r and the four history maps are r→rr \to r, all without bias. With maximum proposal length mmax⁡m_{\max}, the one-layer selector has 5dr+4r2+H(mmax⁡+2)5dr + 4r^2 + H(m_{\max} + 2) parameters, including the distance biases and the HH mixing weights. For the reference configuration r=256r = 256, H=4H = 4 and mmax⁡=m=15m_{\max} = m = 15, the exact counts are 3,539,012 for Qwen3-4B (d=2560d = 2560) and 5,505,092 for Qwen3-8B (d=4096d = 4096). These counts include only the added selector, excluding the draft backbone and frozen embeddings and vocabulary head. We use Xavier-uniform initialization and then set WsW_s, bb and ω\omega to zero, so that initial choices follow the unary logits (Proposition 3). Table 6 lists the per-block tensor shapes.

ObjectPer-block shape
Unary logitsm×∣V∣m \times|\mathcal{V}|
Candidate IDsm×Km \times K
Candidate embeddingsm×K×dm \times K \times d
Local table, i>1i > 1K×KK \times K
Local table, i=1i = 1K×1K \times1
History table, j>0j > 0H×K×KH \times K \times K
History table, j=0j = 0H×K×1H \times K \times1
Each accumulatorm×K×Hm \times K \times H
Selected proposal IDsmm

Table 6. Per-block tensor shapes. Our implementation stores dense FP32 history tables, masks pairs with j>i−2j > i - 2, and handles the anchor separately.

Stacked cross-attention implementation

The local_prefix_v2 implementation supports a stacked variant with two independently parameterized cross-attention blocks. At rank 256, each block uses pre-attention query LayerNorm and four 64-dimensional heads, with query, key, value and output projections followed by a residual connection. A pre-FFN LayerNorm and a 256→\to512→\to256 feed-forward network with SiLU form a second residual branch. Let q(0)q^{(0)} be the candidate query and MM the older selected-prefix memory. The blocks operate sequentially:

q(1)=F1(q(0),M),q(2)=F2(q(1),M).(28)q^{(1)} = F_1(q^{(0)}, M), \qquad q^{(2)} = F_2(q^{(1)}, M). \tag*{(28)}

Both blocks attend to the same memory, which is not updated between layers. The memory excludes the immediate predecessor, whose contribution remains in the separate local term. The history correction is

h=woutT(q(2)−q(0)),(29)h = w_{\mathrm{out}}^{\mathsf{T}}\left(q^{(2)} - q^{(0)}\right), \tag*{(29)}

and is added to the unary score and local correction. These architectural details apply to local_prefix_v2. The compiled_prefix_v3 implementation contains one history layer; setting its layer field to two does not instantiate this stack. The second block’s query depends on the selected prefix through the first block, so the fixed-pair compilation proof and lookup-walk cost bounds do not apply to this stacked variant. The reported two-layer result (τ=7.22\tau= 7.22, S=3.34×S = 3.34\times) uses local_prefix_v2. Its comparison with the compiled one-layer reference therefore changes the selector architecture and execution path as well as depth; it does not isolate depth alone.

Training Details

Run provenance and reporting scope. Table 7 documents the training recipe. Muon updates eligible trainable two-dimensional backbone matrices; a separate AdamW optimizer handles the remaining trainable backbone parameters, and another AdamW optimizer updates the selector. The packed budget is 6×3,072=18,4326 \times3{,}072 = 18{,}432 positions per distributed training step. This is a per-step capacity, not the cumulative number of training tokens. The recipe targets five epochs by default, but resumption settings can change the final budget. Exact training-data revisions, evaluated checkpoint identifiers and final resumed-run budgets are not recorded in the available run metadata. The saved train_config.yaml, joint_settings.json, experiment.json and checkpoint hashes identify any overrides and the checkpoints actually evaluated.

SettingValue
Reference configuration
Recipe epoch target5; resumption may override the final budget
Final selector-loss weight αmax⁡\alpha_{\max}0.5
AR-loss weight λAR\lambda_{\mathrm{AR}}0.2 (0 for the no-AR ablation)
Block size / proposed tokens / shortlist size16 / 15 / 16
Selector rank / heads / layers256 / 4 / 1
Schedules and implementation
Frozen componentsTarget, token embeddings, vocabulary head
Energy bound CC / local and history scales8 / 1 and 1
Selector-loss delay / ramp2,000 / 2,000 optimizer steps
Prefix-weight start / ramp / floor ρ\rho4,000 / 4,000 steps / 0.25
Replay guard start / buffer / additionsStep 4,000 / 32 / 4 anchors per worker
Guard trial scales11, 12\frac{1}{2}, 14\frac{1}{4}, 18\frac{1}{8}
AR anchors per worker / logit chunk64 / 128 positions
PrecisionFP32 trainable parameters; BF16 autocast and export
Gradient synchronization / clipping6 DDP ranks by default / global norm 1.0
Packed positions per rank / distributed step3,072 / 18,432 at 6 DDP ranks
Optimizers and learning-rate schedules
Eligible trainable backbone 2D matricesMuon; learning rate 6×10−36 \times10^{-3}
Muon momentum / weight decay0.95 / 0.1
Muon orthogonalization5 Newton–Schulz iterations
Muon adjust_lr_fnmatch_rms_adamw
Remaining trainable backbone parametersAdamW; learning rate 6×10−46 \times10^{-4}; decay 0.01
Backbone learning-rate scheduleCosine decay; warmup over 2% of planned steps
Selector optimizer / peak learning rateSeparate AdamW / 3×10−43 \times10^{-4}
Selector weight decay0.01 for parameters with ≥2\ge2 dimensions; 0 otherwise
Selector learning-rate schedule2,000-step delay, 2,000-step linear warmup, cosine decay
Hardware and software
Training hardware8 Ascend 910B2 (6 training, 2 target-feature)
Time per epoch, Qwen3-4BEAGLE-3 34 h; DFlash 17 h; DSpark 23 h; CPA 28 h
vLLM0.1.dev20548+g77b1d88c5
vLLM-Ascend0.1.dev5188+g276a5c840
Speculators / PyTorch / torch-npu0.8.0.dev0 / 2.10.0 / 2.10.0.post4
CANN9.1.0

Table 7. Reference configuration and training recipe. The selector-loss weight αmax⁡\alpha_{\max}, prefix-weight floor ρ\rho, and optimizer learning-rate schedules are distinct. Recipe defaults and remaining run provenance are specified below.

Random seeds. The launcher’s default initialization seed is 42. Distributed packing and shuffling use sampler seed 0, with epoch ee using 0+e0 + e. Saved-checkpoint validation uses seed 4242 inside an RNG-preserving context, so validation restores the surrounding training RNG state. The evaluation commands set both generation and prompt-selection seeds to 42. The launcher default describes the recipe; saved run configurations establish whether a particular training run overrides it.

Numerical aggregation. The accompanying calculation script recomputes unweighted means from the released benchmark-level entries, retaining all available precision until the final display step. EAGLE-3 speedups use the original throughput values and model-specific AR references; other methods are aggregated from their reported benchmark values. Decimal half-up rounding gives two decimal places for summary entries. Relative changes are calculated from the unrounded computed means, so they need not equal percentages obtained by dividing rounded table entries. Independently supplied sensitivity measurements and profiling results retain their reported precision.

Prefix weighting in the selector loss. The selector loss of Eq. (11) is computed on recorded prefixes. A recorded prefix is eligible at position ii if all earlier recorded tokens equal the cached greedy target tokens and appear in their shortlists:

Ri=∏j=1i−1I[rj=yj∗]I[rj∈Cj],R1=1.(30)R_i = \prod_{j=1}^{i-1} \mathbb{I}[r_j = y_j^*]\mathbb{I}[r_j \in C_j], \qquad R_1 = 1. \tag*{(30)}

Positions after the prefix becomes ineligible keep meaningful labels for their own recorded context, but those labels do not describe what verification would accept online. Their weight decays linearly to the floor ρ=0.25\rho= 0.25:

β(t)=clip⁡((t−4000)/4000,0,1),\beta(t) = \operatorname{clip}((t - 4000)/4000,0,1),
wi(t)=1−β(t)(1−ρ)(1−Ri),(31)w_i(t) = 1 - \beta(t)(1-\rho)(1-R_i), \tag*{(31)}

and each covered position contributes wi(t)ℓiw_i(t)\ell_i. The selector weight follows α(t)=0.5clip⁡((t−2000)/2000,0,1)\alpha(t) = 0.5\operatorname{clip}((t - 2000)/2000,0,1). The selector loss is computed per worker and its gradients are averaged across workers. Recorded predecessor tokens are embedded directly, even when they are absent from earlier shortlists; no shortlist is modified.

AR branch. Of the nn anchors sampled per worker, the AR pass uses c=min⁡(n,64)c = \min(n,64) evenly spaced anchors. Predictor states are projected to the full vocabulary in chunks of 128 positions, and cross-entropy is computed in FP32. The AR loss averages over valid tokens across all workers. The AR pass uses the same document-packing and valid-position restrictions as the selector.

Replay guard. Each worker keeps a first-in, first-out buffer of at most 32 detached training examples with their shortlists, adding up to four anchors per step. Before a selector update, a BF16 copy of the selector greedily selects paths on these examples and records the protected prefix, the leading choices that equal the cached greedy target. The guard saves the selector parameters ϕt\phi_t and optimizer state, then performs one AdamW step, updating the first and second moments and incrementing the optimizer step counter. Let Δ\Delta be the resulting parameter displacement and gg the gradient of the shortlist cross-entropy on the protected positions. The guard applies the stabilized projection

Δstab=Δ−max⁡(g⊤Δ,0)max⁡(∥g∥22,ϵ)g,(32)\Delta_{\mathrm{stab}} = \Delta- \frac{\max(g^\top\Delta,0)}{\max(\lVert g\rVert_2^2,\epsilon)}g, \tag*{(32)}

with ϵ=10−30\epsilon= 10^{-30}. It tests ϕt+sΔstab\phi_t + s\Delta_{\mathrm{stab}} at scales s∈{1,12,14,18}s \in\{1,\frac{1}{2},\frac{1}{4},\frac{1}{8}\} in that order and accepts the first scale at which no protected prefix becomes shorter on any worker. An accepted update sets ϕt+1=ϕt+sΔstab\phi_{t+1} = \phi_t + s\Delta_{\mathrm{stab}} and retains the updated AdamW moments and incremented step counter unchanged. Only the parameter displacement is scaled; moments are neither scaled nor recomputed. Backtracking trials perform no additional optimizer steps and do not increment the counter again. If every trial fails, the previous parameters, first and second moments, and step counter are restored. The learning-rate schedule follows training iterations, including iterations whose selector update is rejected. The guard starts at step 4,000, affects the selector only and adds no inference cost. Proposition 5 states what it guarantees.

Lossless Sampling at Temperature One

At temperature one, CPA still proposes one deterministic path. Speculative sampling with proposal distribution qiq_i accepts proposal y^i\hat{y}_i with probability min⁡(1,pi(y^i)/qi(y^i))\min(1,p_i(\hat{y}_i)/q_i(\hat{y}_i)) and, on rejection, samples from the normalized residual max⁡(0,pi−qi)\max(0,p_i-q_i), where pip_i is the target distribution after all logit processing, conditioned on the accepted prefix [16, 2]. For a deterministic proposal, qiq_i is a point mass on y^i\hat{y}_i. The acceptance probability is then pi(y^i)p_i(\hat{y}_i), and the residual is pip_i with y^i\hat{y}_i removed and renormalized. The probability of emitting yiy_i is pi(y^i)p_i(\hat{y}_i), and the probability of emitting any other token vv is (1−pi(y^i))pi(v)/(1−pi(y^i))=pi(v)(1-p_i(\hat{y}_i))p_i(v)/(1-p_i(\hat{y}_i)) = p_i(v). Each emitted token therefore follows the target distribution, and induction over positions and rounds gives the target’s sequence distribution. The argument does not depend on how the path was selected, as long as the selection does not use the target’s random draws.

Additional Results

Table 8 breaks down Table 4 by benchmark. The full CPA drafter is faster and commits more tokens than both the local-only selector and the drafter trained without the AR loss on every benchmark.

Concurrency. Table 9 reports output throughput and speedup with 1, 8, 16 and 32 concurrent requests. Each speedup is relative to target-only decoding at the same concurrency.

Evaluation Benchmarks

Table 10 lists the shared dataset versions and splits. EAGLE-3, DFlash, DSpark and CPA are evaluated on the same prompts, using every prompt in each split; for MT-Bench we use the first turn of each question, and for LiveCodeBench the release_v5 problems. MATH-500 is the 500-problem subset of MATH released with PRM800K ([18] (Hugging Face H4 2024)). Reported averages give equal weight to each workload. All methods use the target’s chat template, thinking mode disabled and the decoding settings in § 4.

BenchmarkHugging Face dataset; configuration / split
GSM8Kopenai/gsm8k; main / test
MATH-500HuggingFaceH4/MATH-500; test
AIME 2025MathArena/aime_2025; train
HumanEvalopenai/openai_humaneval; test
MBPPgoogle-research-datasets/mbpp; sanitized/test
LiveCodeBenchlivecodebench/code_generation_lite; release_v5
MT-BenchHuggingFaceH4/mt_bench_prompts; train, first turn
Alpacatatsu-lab/alpaca; train

Table 10. Benchmark sources shared by EAGLE-3, DFlash, DSpark and CPA. All methods use every prompt in the listed split with the same evaluation settings.

References

  1. [1]Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, and Charles Sutton. 2021. Program synthesis with large language models. Preprint, arXiv:2108.07732.arxiv.org/abs/2108.07732
  2. [2]Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper. 2023. Accelerating large language model decoding with speculative sampling. Preprint, arXiv:2302.01318.arxiv.org/abs/2302.01318
  3. [3]Jian Chen, Yesheng Liang, and Zhijian Liu. 2026a. DFlash: Block diffusion for flash speculative decoding. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 15343–15355. PMLR.arxiv.org/abs/2602.06036
  4. [4]Kecheng Chen, Yuyang He, Cheng Gong, Hui Liu, Guoping Long, Jiajun Li, Shi Wu, Suiyun Zhang, Haoliang Li, Ziru Liu, and Rui Liu. 2026b. D-Loop: Looped diffusion drafting for speculative decoding. Preprint, arXiv:2610.06011.arxiv.org/abs/2610.06011
  5. [5]Mark Chen, Jerry Tworek, Heewoo Jun, et al. 2021. Evaluating large language models trained on code. Preprint, arXiv:2107.03374.arxiv.org/abs/2107.03374
  6. [6]Xin Cheng, Xingkai Yu, Chenze Shao, Jiashi Li, Yunfan Xiong, Yi Qian, Jiaqi Zhu, Shirong Ma, Xiaokang Zhang, Jiasheng Ye, Qinyu Chen, Chengqi Deng, Jiping Yu, Damai Dai, Zhengyan Zhang, Yixuan Wei, Yixuan Tan, Wenkai Yang, Runxin Xu, and 14 others. 2026. DSpark: Confidence-scheduled speculative decoding with semi-autoregressive generation. Preprint, arXiv:2607.05147.arxiv.org/abs/2607.05147
  7. [7]Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. 2021. Training verifiers to solve math word problems. Preprint, arXiv:2110.14168.arxiv.org/abs/2110.14168
  8. [8]Jasper Dekoninck, Nikola Jovanović, Tim Gehrunger, Kári Rögnvaldsson, Ivo Petrov, Chenhao Sun, and Martin Vechev. 2026. Beyond conjectures: Math-Arena as an evaluation platform for mathematics with LLMs. Preprint, arXiv:2605.00674.arxiv.org/abs/2605.00674
  9. [9]Yonggan Fu, Lexington Whalen, Abhinav Garg, Chengyue Wu, Maksim Khadkevich, Nicolai Oswald, Enze Xie, Daniel Egert, Sharath Turukekere Sreenivas, Shizhe Diao, Chenhan Yu, Ye Yu, Weijia Chen, Sajad Norouzi, Jingyu Liu, Shiyi Lan, Ligeng Zhu, Jin Wang, Jindong Jiang, and 7 others. 2026. Nemotron-Labs-Diffusion: A tri-model language model unifying autoregressive, diffusion, and self-speculation decoding. arXiv preprint arXiv:2607.05722.arxiv.org/abs/2607.05722
  10. [10]Jianuo Huang, Yaojie Zhang, Qituan Zhang, Hao Lin, Hanlin Xu, and Linfeng Zhang. 2026. Domino: Decoupling causal modeling from autoregressive drafting in speculative decoding. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 23346–23356. Association for Computational Linguistics.arxiv.org/abs/2605.29707
  11. [12]Inco AI. 2026. DFlash 2: Keep drafting parallel. Technical blog, August 18, 2026. Accessed October 16, 2026.
  12. [13]Naman Jain, King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen, and Ion Stoica. 2025. LiveCodeBench: Holistic and contamination free evaluation of large language models for code. In International Conference on Learning Representations.arxiv.org/abs/2403.07974
  13. [14]Taehyeon Kim, Ananda Theertha Suresh, Kishore Papineni, Michael Riley, Sanjiv Kumar, and Adrian Benton. 2024. Accelerating blockwise parallel language models with draft refinement. In Advances in Neural Information Processing Systems, volume 37.DOI
  14. [16]Yaniv Leviathan, Matan Kalman, and Yossi Matias. 2023. Fast inference from transformers via speculative decoding. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 19274–19286. PMLR.arxiv.org/abs/2211.17192
  15. [17]Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang. 2025. EAGLE-3: Scaling up inference acceleration of large language models via training-time test. In Advances in Neural Information Processing Systems, volume 38.arxiv.org/abs/2503.01840
  16. [18]OpenAI. 2023. PRM800K: A process supervision dataset. GitHub repository. MATH splits documentation. Accessed October 16, 2026.
  17. [19]Liran Ringel and Yaniv Romano. 2026. Accelerating speculative decoding with block diffusion draft trees. Preprint, arXiv:2604.12989.arxiv.org/abs/2604.12989
  18. [20]Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. 2018. Blockwise parallel decoding for deep autoregressive models. In Advances in Neural Information Processing Systems, volume 31.arxiv.org/abs/1811.03115
  19. [21]Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. 2023. Stanford alpaca: An instruction-following LLaMA model. GitHub repository.
  20. [23]Yepeng Weng, Dianwen Mei, Huishi Qiu, Xujie Chen, Li Liu, Jiang Tian, and Zhongchao Shi. 2025. CORAL: Learning consistent representations across multi-step training with lighter speculative drafter. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5580–5593. Association for Computational Linguistics.
  21. [24]An Yang, Anfeng Li, Baosong Yang, et al. 2025. Qwen3 technical report. Preprint, arXiv:2505.09388.
  22. [25]Jiebin Zhang, Zhenghan Yu, Song Liu, Eugene J. Yu, Zheng Li, Dawei Zhu, Jiangshan Duo, Weimin Xiong, Yifan Song, Guanghua Zhu, Jianchen Zhu, and Sujian Li. 2026. DFLare: Scaling up draft capacity for block diffusion speculative decoding. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 34333–34346. Association for Computational Linguistics.arxiv.org/abs/2606.02091
  23. [26]Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric P. Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2023. Judging LLM-as-a-judge with MT-Bench and chatbot arena. In Advances in Neural Information Processing Systems, volume 36.arxiv.org/abs/2306.05685

Paper details

vlnc:W_yewm2adx
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents