학술

Native Draft Architectures for Speculative Decoding in the Coding Era

arXiv CS.AI
CC BY
이 매체는 공공·자유 라이선스로 본문을 직접 표시합니다.

Abstract

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.
Additional Features

관련 뉴스