Native Draft Architectures for Speculative Decoding in the Coding Era
Abstract
Spancast, a non-Transformer draft architecture with Masked Parallel Tree Decoding, accelerates code generation by drafting spans in parallel and using stateful recurrence and Null-Key Attention, improving acceptance length and latency over learned and retrieval baselines.
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.
Get this paper in your agent:
hf papers read 2612.05048 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 1
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper