Grouped State Channel (GSC)
Maintains G parallel unit-RMS recurrent states on the hypersphere while leaving gated bilinear feature readouts unconstrained, paired with orthogonal cross-group mixing for multi-token syntactic continuity.
arXiv:2612.05048 · Speculative Decoding
bfloat16, greedy decoding, batch size 1 on H100). (a) 18-benchmark mean per model against target-agnostic and target-coupled baselines on Qwen3-8B. (b) 17-model mean per benchmark across target-agnostic methods.
Modern AI increasingly relies on language model agents that solve tasks by iteratively generating and editing code. Repeatedly producing long code blocks makes token-by-token decoding a major latency bottleneck. Speculative decoding accelerates generation while preserving model outputs by combining a fast draft model with parallel target verification. Unlike natural language, executable code consists largely of predictable syntax and repeated identifiers broken by occasional branching points. However, existing speculative decoding methods fail to exploit the distinct structure of code. Learned drafters rely on stateless Transformer blocks designed for single-step text prediction, while retrieval methods stop at exact substring copies. We introduce Spancast, a native non-Transformer draft architecture with Masked Parallel Tree Decoding. Spancast replaces Transformer layers with Grouped State Channel for stateful recurrence across tokens and Null-Key Attention to skip the prefix via a zero-value key. Masked Parallel Tree Decoding drafts spans in parallel and expands likely branches in constant steps. Spancast surpasses existing learned and retrieval baselines in average acceptance length, lowers inter-token latency across target models, and transfers zero-shot to unseen target models.
Three components derived natively for parallel span drafting over plain text with an independent vocabulary.
Maintains G parallel unit-RMS recurrent states on the hypersphere while leaving gated bilinear feature readouts unconstrained, paired with orthogonal cross-group mixing for multi-token syntactic continuity.
Augments causal prefix and draft attention with a learned zero-value null key (∅) and continuous-phase RoPE, letting novel tokens abstain cleanly from attending to the prefix while sharpening verbatim span copying.
Compiles multi-layer prefix states into one shared KV bank and drafts 127-node candidate trees across two branching levels in constant parallel depth (~2.25 ms CUDA-Graph latency at K = 32).
18-benchmark means under greedy decoding (bfloat16, batch size 1, max length 8,192) on an NVIDIA H100 GPU.
| Target Model | Family | Size | AR ITL (ms/tok) | Spancast Mean τ | Spancast ITL (ms/tok) | Speedup |
|---|
Direct probes of the draft backbone and end-to-end latency behavior across workloads and target scales.
Without a null key, standard softmax concentrates over 40% of decoder attention mass onto position 0 during novel generation. Null-Key Attention removes this sink almost completely.
Specialized prefix copy heads assign high null-key weight on novel tokens (match length 0) and drop it sharply on repeated code spans (match length ≥ 6) to retrieve verbatim tokens.
GSC slows survival decay past step 4 relative to a matched Transformer. Lower single-step prefix NLL alone (e.g., Mamba-2 or RWKV-7) does not maximize parallel span acceptance.
Spancast matches neural drafters on novel general QA, overtakes target-coupled DFlash under moderate reuse, and reaches ~16.5 median accepted tokens on edit-heavy code spans.
Expanding the draft horizon 8× (from K = 4 to K = 32) leaves full-tree CUDA-Graph drafting latency nearly flat near ~2 ms, whereas sequential drafters scale linearly.
As target models scale from 3B to 32B, constant drafting overhead amortizes cleanly, bringing 32B step-time ratios close to non-parametric SuffixTree.
Run Spancast on vLLM with the released checkpoint and draft tokenizer.
git clone https://github.com/Hoyant-Su/Spancast.git
cd Spancast
pip install -r requirements.txt
huggingface-cli download Hoyant-Su/Spancast \
step_72000.pt drafter_tokenizer.json \
--local-dir checkpoints/spancast_98m
bash run_inference.sh \
--model qwen3_8b \
--benchmark canitedit \
--checkpoint checkpoints/spancast_98m/step_72000.pt \
--tokenizer checkpoints/spancast_98m/drafter_tokenizer.json
Standalone vLLM inference engine, fused Triton & Hopper CUDA kernels, Rust PyO3 tree-verification host, 17 target model configs, 18 benchmark suites, and run_inference.sh.
arXiv preprint (2612.05048) and public Hugging Face release (Hoyant-Su/Spancast) of step_72000.pt and drafter_tokenizer.json.
Full training pipeline, corpus preparation, and architectural/decoding ablation scripts.
If you find Spancast useful in your research, please cite:
@misc{su2026nativedraftarchitecturesspeculative,
title={Native Draft Architectures for Speculative Decoding in the Coding Era},
author={Haoyang Su and Weiran Huang},
year={2026},
eprint={2612.05048},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2612.05048},
}