arXiv is now an independent nonprofit! Learn more
License: CC BY-NC-ND 4.0
arXiv:2608.00531v1 [cs.AI] 01 Aug 2026

CURE: Local Uncertainty Repair for Block-Parallel Speculative Decoding

Aofan Liu*    Jingxiang Meng*    Fangxin Liu    Yongbiao Chen
Abstract

Speculative decoding mitigates the latency of sequential generation in autoregressive Large Language Models (LLMs) by interleaving draft generation with target verification. However, existing parallel drafting backends often suffer from rapid accuracy degradation over long horizons, leading to high rejection rates during verification and suboptimal wall-clock speedups. We observe that drafting errors are not uniformly distributed but typically stem from localized high-uncertainty tokens that destabilize downstream generation trajectories. Motivated by this token error pattern, we propose CURE, a budget-aware dynamic repair tree designed to repair errors at uncertainty focal points without incurring prohibitive tree-verification overheads. Specifically, our method uses predictive confidence margins to dynamically locate candidate error tokens within a block-parallel draft, expands bounded repair paths only at these fragile nodes, and employs a novel repair resynchronization mechanism to realign draft states post-verification. Evaluations on code-generation benchmarks (HumanEval, MBPP, and LiveCodeBench-lite) and mathematical reasoning benchmark (GSM8K) demonstrate that CURE increases the average accepted length by 4.2–7.5% over parallel baselines without repair, translating to an end-to-end speedup of 2.66–3.49× over target-only decoding. Furthermore, we provide a plug-and-play repair module compatible with standard parallel drafting frameworks. We also characterize the trade-off between draft compute and verification efficiency.

* These authors contributed equally.  Corresponding authors.

Introduction

Autoregressive inference in Large Language Models (LLMs) suffers from high latency due to sequential, token-by-token generation. Speculative decoding mitigates this memory-bandwidth bottleneck by leveraging a lightweight draft model to generate candidate tokens, which are subsequently verified in parallel by a target LLM (Leviathan, Kalman, and Matias, 2023; Chen et al., 2023; Liu, Zhang, and Song, 2024). Recent advancements expand this paradigm either by constructing candidate trees or by learning specialized draft representations (Cai et al., 2024; Li et al., 2024b). Among these, block-parallel drafting has emerged as an appealing paradigm, generating multi-token blocks in a single forward pass without sequential drafting overhead.

Despite its computational efficiency, block-parallel drafting exhibits an inherent structural fragility: the error propagation cascade. Because block-parallel models generate tokens independently or in coarse blocks, a single localized error at a low-confidence position causes conventional prefix verification to reject the entire subsequent draft sequence, even if the trailing tokens are semantically correct. While unconstrained tree-based speculative decoding can recover alternative trajectories, applying dense tree expansion uniformly across all blocks incurs severe target-verification overhead and memory footprint, wasting compute on predictable spans that require no repair.

In this work, we argue that candidate tree expansion should be frugal and spatially localized. Taking code generation as a representative domain, source code exhibits strong global structural predictability (Hindle et al., 2012), yet local variations (such as identifiers, API calls, and syntax operators) introduce localized uncertainty (Casalnuovo et al., 2020). We observe that draft errors are not uniformly distributed; rather, they originate from a few Uncertainty Focal Points (UFPs). Identifying and repairing these specific focal points can prevent downstream cascade rejections without triggering expensive full-tree construction.

To operationalize this intuition, we propose CURE (Local Uncertainty Repair), a budget-aware dynamic repair tree built atop block-parallel draft backends. Prior to candidate verification, our framework evaluates the top-1/top-2 log-probability margins of the block-parallel draft to pinpoint local UFPs. It then dynamically allocates a bounded verification budget, spawning alternative candidate branches strictly at these fragile positions. To ensure seamless execution, we introduce a cache-resynchronization mechanism that realigns the draft model’s internal state with the target-verified path upon token acceptance, eliminating the need for draft model retraining.

We conduct extensive evaluations on primary code generation benchmarks (HumanEval, MBPP, LiveCodeBench-lite) and out-of-domain reasoning (GSM8K). Experimental results show that CURE consistently increases the accepted tokens per step by 4.2% to 7.5% over single-path parallel backends, achieving a 2.66×2.66\times to 3.49×3.49\times end-to-end speedup over target-only autoregressive decoding. Crucially, our empirical analysis reveals a fine-grained acceptance–compute Pareto trade-off: while local repair expands the accepted context length, the additional tree-verification compute presents a tunable knob between arithmetic intensity and memory-bound latency, offering valuable insights for hardware-aware speculative decoding design.

Our main contributions are summarized as follows:

  • Localized Repair Formulation: We formulate draft candidate expansion as a constrained budget-allocation problem, introducing a confidence-margin gating mechanism that confines alternative branching strictly to localized Uncertainty Focal Points (UFPs).

  • Training-Free & Cache-Consistent Architecture: We design a plug-and-play dynamic repair tree with a novel cache-resynchronization procedure. It enables training-free integration with block-parallel backends while maintaining KV-cache consistency across draft-target state transitions.

  • Pareto Analysis of Acceptance vs. Cost: We analyze the acceptance-latency trade-off across multiple code and reasoning benchmarks, establishing quantitative guidelines on when local branching yields net wall-clock acceleration versus when it incurs verification saturation.

Related Work

Speculative decoding separates generation into proposal and verification. Draft-then-verify generation was first developed for sequence-to-sequence decoding and later formalized as lossless sampling from an autoregressive target model (Xia et al., 2023; Leviathan, Kalman, and Matias, 2023; Chen et al., 2023). A smaller model proposes several tokens, and one target-model forward pass accepts a prefix and corrects the first rejection. Although this procedure preserves the target distribution, its wall-clock speedup depends jointly on draft latency, verification latency, proposal length, and accepted tokens (Liu, Zhang, and Song, 2024; Yan, Agarwal, and Venkataraman, 2024).

Draft-model research therefore balances proposal cost against target agreement. DistillSpec uses on-policy knowledge distillation and task-dependent divergence objectives, Online Speculative Decoding adapts drafters to observed queries, and HASS aligns representations and token-level objectives (Zhou et al., 2024; Liu et al., 2024; Zhang et al., 2025). Other methods alter the draft architecture. Medusa adds multiple prediction heads to the target, Hydra conditions later heads on earlier draft tokens, and EAGLE performs autoregression in the target feature space (Cai et al., 2024; Ankner et al., 2024; Li et al., 2024b). EAGLE-3 replaces feature prediction with direct token prediction and fuses multiple target layers (Li et al., 2025). Self-speculative methods skip target layers or exit early, while REST retrieves candidate continuations from prior text (Zhang et al., 2024a; Elhoushi et al., 2024; He et al., 2024). These approaches improve acceptance or reduce draft cost through training, adaptation, architectural changes, or retrieval. In contrast, CURE leaves the pretrained block-parallel drafter fixed and alters how uncertain draft positions are repaired at inference time without requiring architectural changes or retraining.

Refer to caption
Figure 1: Overview of one decoding iteration of CURE: a block-parallel draft produces branch 0 alongside per-position uncertainty margins. Low-margin positions receive a bounded repair budget, and the target model verifies branch 0 together with the resulting repair paths in a single pass. The framework selects the longest accepted prefix and resynchronizes the draft cache only when a repair path wins.

Parallel and non-autoregressive drafting instead reduces the number of drafter calls. Blockwise parallel decoding predicts several future positions simultaneously and accepts a verified prefix (Stern, Shazeer, and Uszkoreit, 2018). Lookahead decoding constructs and verifies Jacobi-style trajectories without a separate draft model, and Lookahead Reasoning extends step-level speculation to long reasoning traces (Fu et al., 2024; Fu et al., 2025). Recent learned drafters replace token-by-token proposals with block-level computation. DFlash uses block diffusion conditioned on target features, whereas DART predicts several masked positions in parallel and prunes the resulting tree with an n-gram constraint (Chen, Liang, and Liu, 2026; Liu et al., 2026). Domino adds causal correction to a parallel backbone so that each position receives prefix-dependent information without returning to full autoregressive drafting (Huang et al., 2026). SpecBlock takes a hybrid approach, generating blocks of dependent positions and constructing a dynamic tree through repeated block expansion (Shi et al., 2026). These methods expose a fundamental trade-off: independent parallel predictions are computationally cheap but lose path consistency, whereas stronger within-path dependence improves proposal quality at added draft cost. CURE operates after a parallel block is generated, preserving the low-cost path and spending additional verification budget strictly where the block reports local ambiguity.

Adaptive candidate construction provides another way to allocate compute. Fixed proposal lengths and static tree shapes spend identical compute on easy and difficult contexts. SpecDec++ learns when to stop autoregressive drafting from conditional acceptance probabilities, while AdaEAGLE predicts a context-dependent draft length (Huang, Guo, and Wang, 2024; Zhang et al., 2024b). Multi-candidate methods instead alter the verification structure. SpecInfer merges proposals into a token tree, GraphSD shares repeated subsequences in a graph, and SpecTr formulates verification through optimal transport (Miao et al., 2024; Gong et al., 2024; Sun et al., 2023). SEQUOIA optimizes tree construction under serving constraints, while SLiM removes low-utility hypotheses before verification (Chen et al., 2024; Lin et al., 2024). Other adaptive trees use draft confidence to decide structure growth: DySpec greedily expands nodes according to draft probabilities, OPT-Tree adapts its topology to the draft distribution, and EAGLE-2 constructs dynamic trees from confidence estimates (Xiong et al., 2024; Wang et al., 2025; Li et al., 2024a). While these methods improve candidate coverage, larger structures increase candidate-construction, attention, and target-verification costs. CURE operates at a distinct boundary: it preserves the block-parallel prediction as branch 0, allocates alternatives exclusively to locally uncertain positions, and replays a winning repair path to maintain draft-cache continuity. It is therefore a selective post-draft repair mechanism under a bounded verification budget rather than a new draft architecture or a general tree-search procedure.

Code generation provides a useful workload for evaluating local repair. Source code contains repeated lexical and syntactic patterns, where local expression choices are often highly predictable (Hindle et al., 2012; Casalnuovo et al., 2020). This regularity can yield long speculative matches, yet identifiers, constants, APIs, and formatting create localized ambiguity that may prematurely terminate an otherwise valid prefix. Work on Verilog generation further shows that syntax-aware token boundaries materially impact speculative-decoding performance (Xu et al., 2025). However, token agreement does not equal functional correctness: two programs may differ textually while passing the same tests, and an identical prefix does not guarantee a correct completion. We therefore evaluate whether local repair recovers accepted tokens and improves latency while reporting execution correctness independently from decoding metrics.

Methodology

Problem Formulation

Let x<tx_{<t} denote the generated context sequence at decoding step tt. A block-parallel draft model qq generates a length-KK candidate sequence 𝐲t:t+K1=(yt,yt+1,,yt+K1)\mathbf{y}_{t:t+K-1}=(y_{t},y_{t+1},\dots,y_{t+K-1}) alongside its corresponding logit distributions in a single forward pass. A target autoregressive model pp subsequently verifies candidate trajectories and accepts a prefix. In standard single-path speculative decoding, candidate generation yields a single path π0\pi_{0}. When an error occurs at position kk, standard prefix verification rejects all trailing tokens yjy_{j} (j>kj>k), leading to severe truncation of the accepted length.

To recover valid suffixes beyond early rejection points without full autoregressive drafting, we formulate local repair as a constrained candidate-tree optimization problem. Let Π={π0,π1,,πR}\Pi=\{\pi_{0},\pi_{1},\dots,\pi_{R}\} represent a tree of candidate execution paths rooted at x<tx_{<t}, where π0\pi_{0} denotes the default block-parallel path and {πr}r=1R\{\pi_{r}\}_{r=1}^{R} denote candidate repair branches spawned at identified error points. Let a(π)a(\pi) be the accepted token length along path π\pi, and let V(Π)V(\Pi) denote the total token budget (i.e., tree node count) presented to the target verifier. The optimal candidate trajectory π\pi^{\star} maximizes the accepted sequence length under a strict verification compute budget VmaxV_{\max}:

π=argmaxπΠa(π)s.t.V(Π)Vmax.\pi^{\star}=\arg\max_{\pi\in\Pi}a(\pi)\quad\text{s.t.}\quad V(\Pi)\leq V_{\max}. (1)

From an efficiency perspective, the effective token generation rate scales with 𝔼[a(π)]+1𝒞d+𝒞v(Π)\frac{\mathbb{E}[a(\pi^{\star})]+1}{\mathcal{C}_{d}+\mathcal{C}_{v}(\Pi)}, where 𝒞d\mathcal{C}_{d} is the constant draft overhead and 𝒞v(Π)\mathcal{C}_{v}(\Pi) is the memory/compute cost of target tree verification. Therefore, candidate tree expansion yields a positive wall-clock trade-off if and only if the gain in accepted tokens outpaces the increased target verification complexity 𝒞v(Π)\mathcal{C}_{v}(\Pi).

Method Overview

To solve the constrained candidate-tree optimization problem under budget VmaxV_{\max}, CURE introduces an end-to-end, inference-only pipeline that operates directly atop any pretrained block-parallel backend without model retraining. As illustrated in Figure 1, each decoding iteration of CURE proceeds through three integrated phases:

  1. 1.

    Uncertainty Focal Point (UFP) Detection: The draft model generates a single-pass block proposal π0\pi_{0}. CURE inspects the per-position top-1/top-2 logit margins to dynamically locate fragile positions (UFPs) where draft confidence drops precipitously.

  2. 2.

    Budget-Aware Dynamic Tree Construction: Instead of uniform or unconstrained tree expansion, CURE dynamically calculates candidate branch allocations strictly at identified UFPs. It attaches alternative candidate tokens to π0\pi_{0}, constructing a sparse repair tree 𝒯\mathcal{T} that satisfies V(𝒯)VmaxV(\mathcal{T})\leq V_{\max}.

  3. 3.

    Single-Pass Verification and Cache Resynchronization: The target model pp verifies all branches in 𝒯\mathcal{T} concurrently using Tree Attention. If a repair branch ππ0\pi^{\star}\neq\pi_{0} yields a longer accepted prefix, CURE accepts the repaired path and resynchronizes the draft model’s internal KV-cache to realign subsequent drafting states.

Local Uncertainty Gating

For each position i{0,,K1}i\in\{0,\dots,K-1\} within a generated draft block, let i,1\ell_{i,1} and i,2\ell_{i,2} denote the top-1 and top-2 unnormalized log-probabilities emitted by the draft model qq, respectively. We define the predictive confidence margin mim_{i} as:

mi=i,1i,2.m_{i}=\ell_{i,1}-\ell_{i,2}. (2)

A smaller predictive margin mim_{i} indicates that the draft model exhibits lower confidence in distinguishing the leading candidate tokens. Positions with mi<τmarginm_{i}<\tau_{\text{margin}} are identified as Uncertainty Focal Points (UFPs). We select positions in ascending order of mim_{i} to prioritize candidate expansion at the most fragile nodes while capping total tree size to remain within the verifier budget VmaxV_{\max}.

In our baseline setup, each selected position expands at most B=5B=5 candidate branches, with a maximum tree depth of 15, a target verification beam width of 5, and a repair margin threshold τmargin=1.0\tau_{\text{margin}}=1.0. To optimize tree efficiency, we further introduce a dynamic branching mechanism that dynamically maps the normalized uncertainty ui[0,1]u_{i}\in[0,1] to a local branch budget bib_{i}:

ui\displaystyle u_{i} =clip(1mi/s,0,1),\displaystyle=\operatorname{clip}(1-m_{i}/s,0,1), (3)
bi\displaystyle b_{i} =clip(round(bmin+ui(bmaxbmin)),bmin,bmax).\displaystyle=\operatorname{clip}(\operatorname{round}(b_{\min}+u_{i}(b_{\max}-b_{\min})),b_{\min},b_{\max}).

where ss denotes the margin scale, bmin=1b_{\min}=1, and bmax=5b_{\max}=5. This dynamic allocation adjusts only the local tree topology without modifying the underlying draft checkpoint or requiring retraining.

Candidate Tree Construction

For each identified UFP, CURE constructs candidate repair paths by preserving the original prefix while substituting the fragile token with high-scoring alternatives. The remaining suffix tokens are then resampled under the substituted token. Paths sharing a common prefix naturally merge into shared parent nodes within the verification tree, enabling the target verifier to process all candidate paths in a single pass via Tree Attention without independent batch computation. Crucially, the original block-parallel path (π0\pi_{0}) is anchored as branch 0 and is protected from pruning by the uncertainty gate.

To ensure computational efficiency, candidate construction is strictly bounded by three complementary constraints: the position gate limits where repair branches may originate, the branch budget caps alternatives per selected position, and the verification beam constrains the active tree frontier. In our primary configuration, at most one low-margin position is repaired per block. This localized strategy concentrates the extra verification budget on critical ambiguous nodes rather than enumerating combinatorial paths across the full sequence block.

Joint Verification and Cache Resynchronization

The constructed candidate paths and the default path π0\pi_{0} are unified into a sparse verification tree 𝒯\mathcal{T}. A single forward pass of the target model pp evaluates all tree positions concurrently via Tree Attention and computes the accepted prefix length a(π)a(\pi) for each candidate trajectory π𝒯\pi\in\mathcal{T}. The framework identifies the optimal trajectory that yields the longest accepted prefix:

π=argmaxπ𝒯a(π).\pi^{\star}=\arg\max_{\pi\in\mathcal{T}}a(\pi). (4)

If branch 0 wins (π=π0\pi^{\star}=\pi_{0}), the current draft internal states are preserved. If a repair branch wins (ππ0\pi^{\star}\neq\pi_{0}), the emitted sequence deviates from the original draft proposal. To maintain state consistency for subsequent drafting steps, CURE replays the selected repair tokens into the draft model’s Key-Value (KV) cache, realigning the draft model’s internal context representation with the verified output sequence.

Algorithm 1 CURE: Local Uncertainty Repair for Block-Parallel Speculative Decoding
1: Target model pp, block-parallel draft model qq, context x<tx_{<t}, block size KK, verification budget VmaxV_{\max}, margin threshold τmargin\tau_{\text{margin}}.
2: Accepted token sequence 𝐲acc\mathbf{y}_{\text{acc}} and updated context x<t+|𝐲acc|x_{<t+|\mathbf{y}_{\text{acc}}|}.
3: 𝐲draft,{i,1,i,2}i=0K1q(x<t)\mathbf{y}_{\text{draft}},\{\ell_{i,1},\ell_{i,2}\}_{i=0}^{K-1}\leftarrow q(x_{<t}) \triangleright Generate block-parallel draft proposal
4: Initialize default path π0𝐲draft\pi_{0}\leftarrow\mathbf{y}_{\text{draft}}, candidate tree 𝒯{π0}\mathcal{T}\leftarrow\{\pi_{0}\}
5: for i=0i=0 to K1K-1 do
6:   mii,1i,2m_{i}\leftarrow\ell_{i,1}-\ell_{i,2} \triangleright Compute predictive margin
7:   if mi<τmarginm_{i}<\tau_{\text{margin}} and V(𝒯)<VmaxV(\mathcal{T})<V_{\max} then
8:    Compute branch budget bib_{i} via Eq. (3)
9:    Sample top-bib_{i} alternative tokens 𝐲ialt\mathbf{y}_{i}^{\text{alt}} from qq
10:    Spawn repair branches using 𝐲ialt\mathbf{y}_{i}^{\text{alt}} and attach to tree 𝒯\mathcal{T}
11:   end if
12: end for
13: 𝐲accepted,πTargetTreeVerify(p,𝒯,x<t)\mathbf{y}_{\text{accepted}},\pi^{\star}\leftarrow\text{TargetTreeVerify}(p,\mathcal{T},x_{<t}) \triangleright Single-pass Tree Attention verification
14: if ππ0\pi^{\star}\neq\pi_{0} then
15:   ResynchronizeCache(q,π)\text{ResynchronizeCache}(q,\pi^{\star}) \triangleright Realign draft KV-cache with winning repair path
16: end if
17: return 𝐲accepted\mathbf{y}_{\text{accepted}}
TPOT \downarrow Speedup vs. Target AR (×\times) \uparrow Accepted tokens/step \uparrow
Dataset Target AR Naive SD Parallel Ours Parallel Ours Parallel Ours
HumanEval 30.430 42.203 6.232 8.718 4.883 3.490 7.165 7.641
MBPP 30.279 49.853 7.919 11.378 3.824 2.661 5.808 6.053
LCB-lite 31.577 55.782 6.382 10.283 4.948 3.071 6.268 6.735
GSM8K 107.070 155.153 16.165 29.461 6.624 3.634 8.514 11.231
Table 1: Controlled end-to-end decoding results. TPOT is measured in ms/token. Speedup is computed against target-only autoregressive decoding within the same run protocol.

Training and Inference Boundary

While the pretrained block-parallel draft checkpoint requires specialized multi-token training, all components of CURE (including the dynamic repair tree, margin gating, dynamic branch allocation, and KV-cache resynchronization) operate entirely at inference time. These mechanisms introduce zero additional parameters to either the draft or target models and require no retraining or fine-tuning, establishing CURE as a flexible, plug-and-play module for existing parallel drafting backends.

Speedup vs. Target AR (×\times) \uparrow
Method Draft structure HumanEval MBPP LCB-lite GSM8K
CURE (ours) Parallel draft + repair 3.49 2.66 3.07 3.63
EAGLE-3 16-node tree 2.17 1.93 1.80 2.21
EAGLE-3 60-node tree 2.50 2.22 2.03 2.56
DART 60-node tree 2.52 2.39 2.24 2.28
DFlash 16-token block 5.21 4.71 5.37 5.21
Domino 16-token block 5.89 5.53 5.27 7.92
Table 2: Reported Qwen3-8B speedups on shared benchmarks. Each value is relative to the target-only baseline in its own evaluation protocol. Related-method values are reported by Domino (Huang et al., 2026).

CURE uses the controlled measurements in Table 1. Related methods use A100 GPUs and a 2048-token generation limit, whereas our runs use a separate implementation and a 256-token limit. The table provides same-target context rather than a controlled ranking.

Experiments

Experimental Setup

Models and Hardware Platform.

We evaluate our framework using the Qwen3 series models. The target model pp is Qwen3-8B, paired with a pretrained Qwen3-8B-based block-parallel draft backend qq (block size K=16K=16). As an autoregressive draft baseline, we employ Qwen3-4B. All experiments are conducted on a single GPU using bfloat16 precision and FlashAttention-2. Decoding temperature is set to 00 (greedy decoding) across all benchmark evaluations. All Time-Per-Output-Token (TPOT) metrics are recorded in seconds per token and reported in milliseconds per token (ms/tok) under sequential single-GPU runs to eliminate inter-request variance.

Datasets and Evaluation Metrics.

We evaluate model performance across three primary code generation benchmarks and one out-of-domain mathematical reasoning stress test:

  • HumanEval: 164 code-eval prompts for functional python evaluation.

  • MBPP: 128 sanitized code-eval prompts.

  • LiveCodeBench-lite (LCB-lite): 128 problems using the public test6.jsonl.

  • GSM8K: 128 multi-step mathematical reasoning tasks serving as an out-of-domain test.

We evaluate system efficiency and functional correctness using four primary metrics:

  1. 1.

    Accept/step (τ\tau): The mean number of tokens accepted per draft/verification step.

  2. 2.

    TPOT (ms/tok): Mean end-to-end latency per output token (recorded in seconds and reported in milliseconds).

  3. 3.

    Speedup (×\times): The TPOT ratio relative to target-only autoregressive decoding (TPOTTarget/TPOTMethod\text{TPOT}_{\text{Target}}/\text{TPOT}_{\text{Method}}).

  4. 4.

    Pass@1 (%): Code-execution or public-test pass rate, reported separately from token-level exactness.

Figure 2: Reported Qwen3-8B speedups from Table 2. Filled markers denote CURE; hollow markers denote source-specific external results.

Baselines.

We compare CURE against three representative decoding strategies:

  • Target AR: Standard single-path autoregressive decoding executed directly on Qwen3-8B.

  • Parallel Draft: The default block-parallel draft backend producing a single candidate path (K=16K=16), serving as both the low-cost reference and branch 0 (π0\pi_{0}) of the repair tree.

  • Naive SD: Standard speculative decoding drafting each block autoregressively with Qwen3-4B and verifying with Qwen3-8B, measuring the practical cost of token-by-token drafting with a smaller model.

Main Results

Table 1 presents our controlled, same-system evaluation, where CURE is configured with the fast_margin100 variant. To contextualize our results within the broader literature, Table 2 separately summarizes reported speedups from existing literature on Qwen3-8B. We utilize the speedup ratio relative to each benchmark’s target-only AR baseline as the primary unifying metric, since raw TPOT is inherently dependent on specific hardware and execution environments, while accepted-length metrics vary by candidate tree structure. While the target model (Qwen3-8B), decoding temperature (00), and evaluation benchmarks are aligned, we explicitly acknowledge that hardware platforms, generation sequence lengths, and underlying framework implementations differ across published works.

Across the three primary code generation benchmarks, CURE achieves an end-to-end speedup of 2.66×2.66\times to 3.49×3.49\times over target-only AR decoding, and an acceleration of 4.38×4.38\times to 5.43×5.43\times over Naive SD. Relative to the single-path parallel draft backend, local uncertainty repair consistently increases the accepted token sequence length by 4.2% to 7.5%, while raw TPOT increases by 1.40×1.40\times to 1.61×1.61\times. These findings establish that the core mechanism of CURE lies in recovering valid candidate trajectories at fragile nodes rather than improving raw latency over the parallel draft baseline. On the out-of-domain GSM8K benchmark, CURE demonstrates a notable 32.0% increase in accepted length, which is analyzed separately as an empirical stress test. Table 2 positions our speedup metrics alongside reported figures for established speculative decoding backends on Qwen3-8B. On shared evaluation benchmarks, the end-to-end speedups achieved by CURE surpass those reported for EAGLE-3 and DART, while remaining lower than DFlash and Domino. Given the variations in execution hardware, generation length, and framework optimizations across these implementations, we interpret this comparison as a system-level context positioning rather than a direct head-to-head benchmark.

Pass@1 (%) \uparrow
Dataset Target AR Parallel Ours Naive SD
HumanEval 79.9 (131/164) 81.1 (133/164) 79.9 (131/164) 80.5 (132/164)
MBPP 71.1 (91/128) 71.1 (91/128) 71.1 (91/128) 71.1 (91/128)
LCB-lite public 23.4 (30/128) 23.4 (30/128) 23.4 (30/128) 23.4 (30/128)
Table 3: Same-run generated-code test results for fast_margin100. Percentages report pass@1, with passed and total problems in parentheses. HumanEval and MBPP use code-eval prompts with a 256-token limit, while LCB-lite uses public tests.

Functional Correctness of Generated Code

To verify that leveraging token error patterns preserves target model alignment without degrading downstream task performance, we evaluate the functional correctness of generated code across standard benchmarks (HumanEval, MBPP, and LCB-lite). Table 3 summarizes the pass rates alongside latency and average accepted sequence length.

Task Performance Parity. Our method matches target-only decoding on all three reported pass@1 counts. Compared with the parallel drafting baseline, it differs by two HumanEval problems and matches MBPP and LCB-lite. These single-run results support comparable test pass counts under the evaluated suites; they do not establish functional equivalence beyond the provided tests.

Scope and Numerical Precision. We note that execution-based test suites evaluate behavioral correctness rather than strict token-level identity. The optimized bfloat16/FlashAttention path exhibits token-level mismatches, while a strict replay path restores target consistency in the tested path at the cost of additional latency.

Ablation Study:

To isolate the system-level contributions of the parallel fallback branch (Branch 0) and the KV cache resynchronization mechanism, we evaluate their individual and combined removals. Experiments are conducted on a representative 64-example subset sampled from HumanEval, MBPP, and LCB-lite. Table 4 summarizes the trade-offs in mean accepted length, end-to-end speedup, and TPOT ratio.

Branch 0 as a Low-Cost Safety Net. Removing Branch 0 results in a 5.7% drop in the average accepted length and reduces the end-to-end speedup from 2.708×2.708\times to 2.616×2.616\times. This degradation demonstrates that retaining the vanilla parallel proposal path serves as a highly efficient fallback baseline; it ensures candidate diversity when error-pattern repair candidates fail to provide a valid token sequence.

Cache Resynchronization for State Alignment. Omitting the cache resynchronization mechanism leads to a catastrophic performance collapse. The average accepted length plummets by 40.1%, while the TPOT ratio deteriorates sharply from 1.776 to 2.642. From a system perspective, this severe overhead stems from stale draft states accumulating across consecutive decoding blocks, which breaks KV cache alignment and invalidates subsequent token verifications.

Aggregate performance Relative to parallel Token consistency
Configuration Accepted/step \uparrow Speedup vs. AR \uparrow TPOT ratio \downarrow Accept ratio \uparrow Exact rate \uparrow
Full method 6.826 2.708 1.776 1.055 0.854
w/o branch 0 6.435 2.616 1.687 0.996 0.833
w/o cache resync 4.089 1.733 2.642 0.637 0.849
w/o both 2.707 1.141 3.877 0.422 0.849
Table 4: Ablation of branch 0 and cache resynchronization, averaged over 64-example subsets of HumanEval, MBPP, and LCB-lite. Ratios use the parallel draft as reference; exact rate measures full-sequence agreement with target-only decoding.

Offline Analysis: Predictability and Selectivity of Useful Repairs

To understand whether token error repairs can be selectively prioritized before verification, we analyze the ranking capacity of a lightweight scoring mechanism. We define a useful repair as a block where the tree candidate yields strictly more accepted tokens than the fallback Branch 0, quantified by the net token gain:

Δa=max(0,atreeabranch0).\Delta a=\max(0,\,a_{\mathrm{tree}}-a_{\mathrm{branch0}}). (5)

A lightweight scorer ranks repair candidates immediately after block construction using draft confidence margins, block positions, and candidate statistics. We evaluate the ranking quality under an admitted-block budget rr across three metrics: Precision (fraction of selected blocks with Δa>0\Delta a>0), Recall (fraction of useful blocks covered), and Extra-Token Recall (fraction of recovered Δa\Delta a covered).

High Predictability of Repair Utility. As reported in Table 5, the offline scorer provides a strong ranking signal for repair effectiveness. Prioritizing the top 10% of blocks (r=0.10r=0.10) captures 39.6%39.6\% of all extra accepted tokens with a precision of 35.9%35.9\%. Expanding the budget to 30% (r=0.30r=0.30) recovers 71.6%71.6\% of the total extra tokens while maintaining a precision of 24.6%24.6\%. This non-linear coverage confirms that useful error repairs are highly concentrated and predictable based on early draft features.

System Trade-offs and Runtime Implications. Because the scorer operates post-candidate construction, it does not bypass the initial candidate generation overhead. In our runtime smoke tests, incorporating a dynamic learned gate yielded negligible end-to-end TPOT improvements due to feature extraction and inference latency overheads. Consequently, we treat Table 5 not as a runtime acceleration claim, but as an insightful offline diagnostic. It demonstrates that a small fraction of candidate blocks drives the majority of acceptance gains, laying the foundation for future zero-overhead, static pattern-pruning strategies.

Admitted blocks Precision Recall Extra-token recall
10% 0.359 0.308 0.396
20% 0.291 0.500 0.603
30% 0.246 0.635 0.716
40% 0.221 0.760 0.834
50% 0.195 0.837 0.888
Table 5: Offline selection of useful repairs after candidate construction. Budget is the share of blocks sent to tree verification.

Per-Dataset Performance & Trade-off Analysis

Table 1 reports the latency (TPOT) and average accepted sequence length across code generation and reasoning benchmarks.

HumanEval & Code Synthesis. On HumanEval, CURE achieves a TPOT of 8.7188.718 ms/token, delivering a 4.84×4.84\times speedup over Naive SD (42.20342.203 ms/token). Compared with the vanilla parallel draft, our repair tree elevates the accepted length per step from 7.1657.165 to 7.6417.641 (+6.6%). While tree verification adds runtime compute, local repair recovers additional candidates at a measurable cost relative to the parallel backend.

Trade-off on General/Lighter Workloads. On MBPP and LCB-lite, CURE maintains consistent acceptance gains (e.g., boosting accepted length by 7.5% on LCB-lite). On MBPP, raw TPOT reaches 11.37811.378 ms/token versus 49.85349.853 ms/token in Naive SD. We observe that on simpler token distributions, the extra verification latency of candidate trees can marginally exceed the wall-clock savings from higher accepted lengths. This reveals an inherent latency-acceptance trade-off: tree-based repair is most beneficial in high-entropy or error-prone sub-sequences where target-draft misalignment is severe.

Generalization to Non-Code Reasoning (GSM8K). To evaluate cross-domain behavior under the legacy verification protocol, we evaluate on GSM8K. CURE achieves 11.23111.231 accepted tokens per step, compared with 8.5148.514 for the parallel draft and 9.4969.496 for Naive SD, yielding a 3.634×3.634\times speedup over target-only AR. This stress test suggests that local repair can recover rejected tokens outside code, but it does not establish protocol-level generality.

Discussion & Conclusion

We presented CURE, a budget-aware repair framework combining candidate trees with cross-block KV cache resynchronization. Across HumanEval, MBPP, and LCB-lite, CURE matches target-only pass counts and is up to 5.43×5.43\times faster than Naive SD. However, candidate construction adds a 1.401.401.61×1.61\times TPOT overhead over the parallel baseline. Future work should filter low-utility candidates before tree synthesis and resynchronize the cache after a repair wins.

References

  • Ankner et al. (2024) Ankner, Z.; Parthasarathy, R.; Nrusimha, A.; Rinard, C.; Ragan-Kelley, J.; and Brandon, W. 2024. Hydra: Sequentially-Dependent Draft Heads for Medusa Decoding. In First Conference on Language Modeling.
  • Austin et al. (2021) Austin, J.; Odena, A.; Nye, M.; Bosma, M.; Michalewski, H.; Dohan, D.; Jiang, E.; Cai, C.; Terry, M.; Le, Q.; and Sutton, C. 2021. Program Synthesis with Large Language Models. arXiv preprint arXiv:2108.07732.
  • Cai et al. (2024) Cai, T.; et al. 2024. Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads. In Proceedings of the 41st International Conference on Machine Learning, 5209–5235.
  • Casalnuovo et al. (2020) Casalnuovo, C.; Lee, K.; Wang, H.; Devanbu, P.; and Morgan, E. 2020. Do Programmers Prefer Predictable Expressions in Code? Cognitive Science, 44(12): e12921.
  • Chen et al. (2023) Chen, C.; et al. 2023. Accelerating Large Language Model Decoding with Speculative Sampling. arXiv preprint arXiv:2302.01318.
  • Chen, Liang, and Liu (2026) Chen, J.; Liang, Y.; and Liu, Z. 2026. DFlash: Block Diffusion for Flash Speculative Decoding. arXiv preprint arXiv:2602.06036.
  • Chen et al. (2021) Chen, M.; Tworek, J.; Jun, H.; Yuan, Q.; Pinto, H. P. d. O.; Kaplan, J.; Edwards, H.; Burda, Y.; Joseph, N.; Brockman, G.; et��al. 2021. Evaluating Large Language Models Trained on Code. arXiv preprint arXiv:2107.03374.
  • Chen et al. (2024) Chen, Z.; et al. 2024. SEQUOIA: Scalable and Robust Speculative Decoding. In Advances in Neural Information Processing Systems.
  • Cobbe et al. (2021) Cobbe, K.; Kosaraju, V.; Bavarian, M.; Chen, M.; Jun, H.; Kaiser, L.; Plappert, M.; Tworek, J.; Hilton, J.; Nakano, R.; Hesse, C.; and Schulman, J. 2021. Training Verifiers to Solve Math Word Problems. arXiv preprint arXiv:2110.14168.
  • Elhoushi et al. (2024) Elhoushi, M.; et al. 2024. LayerSkip: Enabling Early Exit Inference and Self-Speculative Decoding. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, 12622–12642.
  • Fu et al. (2024) Fu, Y.; Bailis, P.; Stoica, I.; and Zhang, H. 2024. Break the Sequential Dependency of LLM Inference Using Lookahead Decoding. In Proceedings of the 41st International Conference on Machine Learning, 14060–14079.
  • Fu et al. (2025) Fu, Y.; Ge, R.; Shao, Z.; Deng, Z.; and Zhang, H. 2025. Scaling Speculative Decoding with Lookahead Reasoning. In Advances in Neural Information Processing Systems, volume 38.
  • Gong et al. (2024) Gong, Z.; Liu, J.; Wang, Z.; Wu, P.; Wang, J.; Cai, X.; Zhao, D.; and Yan, R. 2024. Graph-Structured Speculative Decoding. In Findings of the Association for Computational Linguistics: ACL 2024, 11404–11415.
  • He et al. (2024) He, Z.; Zhong, Z.; Cai, T.; Lee, J.; and He, D. 2024. REST: Retrieval-Based Speculative Decoding. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics, 1582–1595.
  • Hindle et al. (2012) Hindle, A.; Barr, E. T.; Gabel, M.; Su, Z.; and Devanbu, P. 2012. On the Naturalness of Software. In Proceedings of the 34th International Conference on Software Engineering, 837–847.
  • Huang et al. (2026) Huang, J.; Zhang, Y.; Zhang, Q.; Lin, H.; Xu, H.; and Zhang, L. 2026. Domino: Decoupling Causal Modeling from Autoregressive Drafting in Speculative Decoding. arXiv preprint arXiv:2605.29707.
  • Huang, Guo, and Wang (2024) Huang, K.; Guo, X.; and Wang, M. 2024. SpecDec++: Boosting Speculative Decoding via Adaptive Candidate Lengths. arXiv preprint arXiv:2405.19715.
  • Jain et al. (2024) Jain, N.; Han, K.; Gu, A.; Li, W.-D.; Yan, F.; Zhang, T.; Wang, S.; Solar-Lezama, A.; Sen, K.; and Stoica, I. 2024. LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code. arXiv preprint arXiv:2403.07974.
  • Leviathan, Kalman, and Matias (2023) Leviathan, Y.; Kalman, M.; and Matias, Y. 2023. Fast Inference from Transformers via Speculative Decoding. Proceedings of the 40th International Conference on Machine Learning.
  • Li et al. (2024a) Li, Y.; Wei, F.; Zhang, C.; and Zhang, H. 2024a. EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, 7421–7432.
  • Li et al. (2025) Li, Y.; Wei, F.; Zhang, C.; and Zhang, H. 2025. EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test. arXiv preprint arXiv:2503.01840.
  • Li et al. (2024b) Li, Y.; et al. 2024b. EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty. In Proceedings of the 41st International Conference on Machine Learning, 28935–28948.
  • Lin et al. (2024) Lin, C.-H.; Tuli, S.; Smith, J.; Hsu, Y.-C.; Shen, Y.; and Jin, H. 2024. SLiM: Speculative Decoding with Hypothesis Reduction. In Findings of the Association for Computational Linguistics: NAACL 2024, 1005–1017.
  • Liu et al. (2026) Liu, F.; Li, X.; Zhao, K.; Gao, Y.; Zhou, Z.; Zhang, Z.; Wang, Z.; Dou, W.; Zhong, S.; and Tian, C. 2026. DART: Diffusion-Inspired Speculative Decoding for Fast LLM Inference. arXiv preprint arXiv:2601.19278.
  • Liu et al. (2024) Liu, X.; Hu, L.; Bailis, P.; Cheung, A.; Deng, Z.; Stoica, I.; and Zhang, H. 2024. Online Speculative Decoding. In Proceedings of the 41st International Conference on Machine Learning, 31131–31146.
  • Liu, Zhang, and Song (2024) Liu, Z.; Zhang, C.; and Song, D. 2024. How Speculative Can Speculative Decoding Be? In Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation, 8265–8275.
  • Miao et al. (2024) Miao, X.; et al. 2024. SpecInfer: Accelerating Large Language Model Serving with Tree-based Speculative Inference and Verification. In Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, 932–949.
  • Shi et al. (2026) Shi, W.; Xu, Q.; Deng, F.; Wu, Y.; Liu, J.; Xu, Y.; Chen, H.; Zhu, J.; Xu, J.; Huang, X.; Yang, J.; and Zhou, X. 2026. SpecBlock: Block-Iterative Speculative Decoding with Dynamic Tree Drafting. arXiv preprint arXiv:2605.07243.
  • Stern, Shazeer, and Uszkoreit (2018) Stern, M.; Shazeer, N.; and Uszkoreit, J. 2018. Blockwise Parallel Decoding for Deep Autoregressive Models. In Advances in Neural Information Processing Systems, volume 31.
  • Sun et al. (2023) Sun, Z.; Suresh, A. T.; Ro, J. H.; Beirami, A.; Jain, H.; and Yu, F. 2023. SpecTr: Fast Speculative Decoding via Optimal Transport. In Advances in Neural Information Processing Systems, volume 36.
  • Wang et al. (2025) Wang, J.; Su, Y.; Li, J.; Xia, Q.; Ye, Z.; Duan, X.; Wang, Z.; and Zhang, M. 2025. OPT-Tree: Speculative Decoding with Adaptive Draft Tree Structure. Transactions of the Association for Computational Linguistics, 13: 188–199.
  • Xia et al. (2023) Xia, H.; Ge, T.; Wang, P.; Chen, S.-Q.; Wei, F.; and Sui, Z. 2023. Speculative Decoding: Exploiting Speculative Execution for Accelerating Seq2seq Generation. In Findings of the Association for Computational Linguistics: EMNLP 2023, 3909–3925.
  • Xiong et al. (2024) Xiong, Y.; Zhang, R.; Li, Y.; Wu, T.; and Zou, L. 2024. DySpec: Faster Speculative Decoding with Dynamic Token Tree Structure. arXiv preprint arXiv:2410.11744.
  • Xu et al. (2025) Xu, C.; Liu, Y.; Zhou, Y.; Huang, S.; Xu, N.; and Xu, Q. 2025. Speculative Decoding for Verilog: Speed and Quality, All in One. arXiv preprint arXiv:2503.14153.
  • Yan, Agarwal, and Venkataraman (2024) Yan, M.; Agarwal, S.; and Venkataraman, S. 2024. Decoding Speculative Decoding. arXiv preprint arXiv:2402.01528.
  • Zhang et al. (2024a) Zhang, J.; Wang, J.; Li, H.; Shou, L.; Chen, K.; Chen, G.; and Mehrotra, S. 2024a. Draft & Verify: Lossless Large Language Model Acceleration via Self-Speculative Decoding. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, 11263–11282.
  • Zhang et al. (2025) Zhang, L.; Wang, X.; Huang, Y.; and Xu, R. 2025. Learning Harmonized Representations for Speculative Sampling. In International Conference on Learning Representations.
  • Zhang et al. (2024b) Zhang, S.; Wang, H.; Ma, D.; Zhu, Z.; Chen, L.; Lan, K.; and Yu, K. 2024b. AdaEAGLE: Optimizing Speculative Decoding via Explicit Modeling of Adaptive Draft Structures. arXiv preprint arXiv:2412.18910.
  • Zhou et al. (2024) Zhou, Y.; Lyu, K.; Rawat, A. S.; Menon, A. K.; Rostamizadeh, A.; Kumar, S.; Kagy, J.-F.; and Agarwal, R. 2024. DistillSpec: Improving Speculative Decoding via Knowledge Distillation. In International Conference on Learning Representations.