Papers
Topics
Authors
Recent
Search
2000 character limit reached

SpecLA: Efficient Speculative Decoding for Linear-Attention Models

Published 18 Jul 2026 in cs.CL | (2607.16673v1)

Abstract: Linear-attention models replace the growing KV cache with recurrent states, but autoregressive decoding still reads, updates, and writes these states one token at a time. Speculative decoding can reduce this cost by verifying several draft tokens in one target pass, yet existing speculative systems are designed for Transformer KV caches. For stateful linear-attention targets, verification must follow recurrent dependencies across chains and branches, acceptance must update only the accepted state trajectory, and the drafter must avoid submitting candidates that waste stateful verification work. This paper presents SpecLA, a speculative decoding runtime for stateful linear-attention models. SpecLA verifies chains and trees with topology-aware kernels, stores compact factors produced during verification to recover accepted states, and uses confidence pruning plus a target-aligned EAGLE-style drafter to feed useful candidates to the verifier. On an NVIDIA H100 with a public GDN-1.3B target, SpecLA achieves up to 1.70x end-to-end speedup over autoregressive decoding.

Summary

  • The paper introduces SpecLA, a runtime that combines topology-aware verification, chain-decomposed tree scheduling, and delayed state updates to make speculative decoding practical for recurrent linear-attention models.
  • SpecLA buffers compact attention-update factors instead of full recurrent states, reducing state-recovery latency by up to 4.28× and delivering up to 7.11× faster kernel verification than root-to-leaf replay.
  • The system achieves up to 1.70× end-to-end speedup on GSM8K, but results show that speculation becomes beneficial only when draft acceptance is sufficiently high, generally around 0.8 or above.

Motivation and problem statement

Speculative decoding is well established as an inference-time acceleration for Transformer serving: a drafter proposes a short continuation, the target verifies it in a batched pass, and posterior rejection sampling preserves the target distribution. The technique relies on an implicit assumption that the target's history is a token-indexed KV cache, so that a draft is simply a speculative suffix and rejection is a suffix truncation. Linear-attention and stateful sequence models such as Gated DeltaNet (GDN) break this assumption. They compress the prefix into a dense recurrent state St\mathbf{S}_t that every token mutates, so there is no addressable suffix to truncate and no natural way to batch candidate tokens without violating the recurrence.

The paper's motivation is quantitative rather than asymptotic. Although linear attention removes the growing KV cache, decode remains memory-bound: a Qwen3-Next-style GDN state is 2 MiB per layer (FP32, hv=32h_v{=}32, dk=dv=128d_k{=}d_v{=}128), and batch-1 GDN decode has arithmetic intensity below 1 FLOP/B. Each token still pays a full read–write round trip of the dense state. Verifying several draft tokens in one target invocation could amortize this fixed state traffic and launch overhead across multiple accepted tokens.

The authors show that two naive adaptations fail. Replaying candidates with single-token decode kernels preserves the per-token state round trip that speculation is meant to amortize, and branching proposals additionally require distinct intermediate states. Reusing long-sequence prefill kernels exposes token parallelism, but speculative windows (roughly 8–32 tokens) are too short to amortize layout conversion, UT-transformed triangular solves, synchronization, and intermediate tensors; moreover, a causal prefill dependency model is incorrect for tree proposals, where candidates should see only their ancestor paths.

System design

SpecLA is a speculative decoding runtime organized in three layers, each addressing one of the coupled challenges the authors identify: efficient SRAM-resident verification, cheap rollback of dense state, and target-aligned drafting.

Topology-aware verification kernels

The first mechanism treats the submitted draft topology as a kernel scheduling signal. For chain-like proposals, SpecLA reorders execution from token-major to layer-major so adjacent candidate tokens at the same layer execute consecutively. A state-resident serial kernel tiles the recurrent state along the value dimension (keeping the full key dimension per block), keeping V-tiled state slices in SRAM across adjacent same-layer updates and eliminating the per-token HBM round trip. V-dimension tiling is chosen over K-dimension tiling because the latter partitions the output query and forces a cross-block reduction per token.

For tree-shaped proposals, the paper develops a fully factorized tree verifier that inserts the tree mask Mtree\mathbf{M}_{\mathrm{tree}} into the GDN Delta-rule UT factorization, replacing the regular sequence dependency with a tree-local lower-triangular solve Ttree=solve_tril(I−Mtree⊙KbKa⊤)\mathbf{T}_{\mathrm{tree}} = \mathrm{solve\_tril}(\mathbf{I} - \mathbf{M}_{\mathrm{tree}} \odot \mathbf{K}_b\mathbf{K}_a^\top). All candidate logits are computed from the single committed state S0\mathbf{S}_0, with updates propagating only along ancestor paths. This is the exact parallel endpoint, but its multi-stage setup is hard to amortize at speculative window sizes.

The practical route is therefore a chain-decomposed hybrid schedule: the draft tree is decomposed into node-disjoint, dependency-respecting chains via heavy-light decomposition, each chain is verified with the low-overhead state-resident serial kernel, and only boundary states consumed by child chains are written back. Execution is serial across layers and parallel across ready chains within a layer. This preserves shared prefixes exactly once while avoiding the full factorized setup.

Accepted-factor state management

Because rejected candidates cannot be removed by truncating recurrent state, SpecLA separates speculative progress from durable state. The central observation is that verification already produces the compact layer-specific factors (kt\mathbf{k}_t, vt\mathbf{v}_t, decay αt\alpha_t, Delta-rule βt\beta_t) needed to reconstruct state updates, so the runtime buffers these factors instead of full states or token identifiers. After posterior selection, it gathers only accepted-path factors and applies the cheap delta-construction step. For GDN-1.3B, factor buffering costs roughly hv=32h_v{=}320 KiB per layer—about hv=32h_v{=}321 smaller than full-state buffering's hv=32h_v{=}322 MiB—while avoiding token replay's redundant factor generation, which the paper measures as the dominant cost of state recovery (29.73 ms replay vs. 8.62 ms factor reuse for a four-token accepted prefix, a 3.45× reduction).

A second mechanism, delayed state update, fuses the accepted-factor application into the next iteration's verification kernel: each thread block loads a state tile, applies the pending accepted factors, and proceeds directly to verification, eliminating a standalone state-access pass at every iteration boundary. The authors note the design generalizes across layer types—GLA, DeltaNet, and Mamba-style SSMs each expose different factor records, but buffering the relevant layer-specific quantities suffices in all cases.

Target-aligned draft integration

On the draft side, SpecLA prunes low-probability paths before verification using a global margin on cumulative root-to-node draft log-probability, hv=32h_v{=}323. Because hv=32h_v{=}324 is monotonically non-increasing along any path, a single threshold prunes width and depth jointly and yields an ancestor-closed window; a token budget then truncates score-ranked selection. Pruning preserves correctness because final acceptance remains target-side. The drafter itself is an EAGLE-style layer trained on features collected from the target's own recurrent state holders, so pruning scores reflect the target's dynamics. Notably, the authors deliberately keep the drafter Transformer-style: at hv=32h_v{=}325, quadratic attention is negligible (≈32 KiB KV cache), and making the drafter recurrent would import speculative-state management into the proposal path without benefit.

Evaluation

The implementation is PyTorch plus four custom Triton kernels, evaluated on an NVIDIA H100 with a public GDN-1.3B target (hv=32h_v{=}326, hv=32h_v{=}327, 2 MiB FP32 state per layer) and an EAGLE-style GDN draft layer. All speculative routes are hash-verified against autoregressive decoding, and dataset-level speedups are computed from summed latencies rather than averaged ratios.

End-to-end, SpecLA achieves 1.42×, 1.70×, and 1.06× speedup on the mixed suite, GSM8K, and HumanEval respectively, with the tree route raising average accepted length from 3.47 to 5.00 tokens and first-token match from 0.68 to 0.81 on GSM8K relative to the chain route. HumanEval is the hardest workload, with only 2.34 tokens accepted on average; the paper is candid that target-side optimization pays off only when the drafter supplies sufficient accepted work. A baseline using the native FLA/GDN target path with the same drafter falls below autoregressive decoding on HumanEval, indicating the target-side mechanisms, not the drafter, drive the gains.

Kernel microbenchmarks are stronger. Chain-decomposed hybrid verification improves over root-to-leaf replay by 1.80–7.11× across proposal shapes, reaching 7.11× on 32-node, top-hv=32h_v{=}328 trees; the fully factorized parallel kernel often falls below even serial verification (as low as 0.52×) because its setup cost does not amortize at the target shape. Factor-buffer reuse reduces accepted-state recovery latency by 2.74–4.28× versus token replay, with FP32 state differences bounded at hv=32h_v{=}329; delayed state update reduces commit-boundary latency by 1.15–1.44× with exact output and state matches.

A controlled study with synthetically sampled acceptance isolates proposal quality. On the measured 1.3B pair, acceptance probabilities of 0.5–0.6 remain below 1× for all draft lengths; dk=dv=128d_k{=}d_v{=}1280 is a transition region, and all lengths become beneficial at dk=dv=128d_k{=}d_v{=}1281, with oracle acceptance reaching 3.71× at dk=dv=128d_k{=}d_v{=}1282. A calibrated 9B-scale projection (replacing only the autoregressive baseline latency with a Qwen3.5-9B proxy, not a measured speculative setup) shifts the profitable region upward, with oracle acceptance projected at 4.61×. The implication is that larger draft budgets raise the ceiling only when drafter accuracy is sufficient, and the profitability threshold tightens for smaller targets.

Limitations and open questions

The paper is explicit about several constraints. The end-to-end evaluation uses a single 1.3B pure-GDN target on one H100; the 9B-scale result is a projection, not a measurement, and the interaction of SpecLA's mechanisms with hybrid Transformer–GDN architectures (the setting where GDN is deployed in practice, e.g., Qwen3-Next) is untested. The fully factorized parallel kernel, despite being the exact tree endpoint, is not profitable at runtime shapes, so the system's tree support effectively rests on the hybrid schedule. The controlled study assumes synthetic per-token acceptance independence, which real drafters may violate. HumanEval results—1.06× with 2.34 average accepted tokens—show that the approach's benefit is contingent on workload-dependent drafter quality, and the paper does not evaluate whether drafter training or pruning parameters can be tuned per domain to close this gap. Finally, the delayed state-update and factor-buffering mechanisms are validated for numerical equivalence but the end-to-end path is described as "correctness-first," leaving kernel-level precision optimization of the full pipeline open.

Conclusion

SpecLA demonstrates that speculative decoding transfers to stateful linear-attention targets once three coupled problems are solved: verification kernels that respect proposal topology rather than forcing decode-replay or prefill-reuse shapes, state recovery from compact verification factors with fused commitment, and target-aligned, confidence-pruned drafting. The reported results—up to 1.70× end-to-end and up to 7.11× kernel-level speedup over root-to-leaf replay—establish the hybrid chain-decomposed schedule and factor-based state management as the effective design points at speculative window sizes, while the controlled study delineates the drafter-accuracy threshold below which speculation is unprofitable.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.