arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2612.05048cs.LGcs.AI
收藏

编码时代用于推测解码的原生草稿架构

Native Draft Architectures for Speculative Decoding in the Coding Era

Fudan University(复旦大学);Shanghai Innovation Institute(上海创新研究院);Shanghai Jiao Tong University(上海交通大学)

Haoyang Su, Weiran Huang

AI总结:

针对代码结构优化的Spancast原生非Transformer草稿架构,通过分组状态通道和空键注意力等设计,在推测解码中提升平均接受长度、降低延迟并实现零样本迁移。

摘要:

现代人工智能越来越依赖通过迭代生成和编辑代码来解决任务的语言模型智能体。反复生成长代码块使得逐token解码成为主要的延迟瓶颈。推测解码通过将快速草稿模型与并行目标验证相结合,在保留模型输出的同时加速生成。与自然语言不同,可执行代码主要由可预测的语法和被偶尔分支点打断的重复标识符组成。然而,现有的推测解码方法未能利用代码的独特结构。学习型草稿器依赖为单步文本预测设计的无状态Transformer块,而检索方法仅停留在精确子字符串复制。我们提出Spancast,一种具有掩码并行树解码的原生非Transformer草稿架构。Spancast用分组状态通道替换Transformer层,以实现跨token的有状态循环,并使用空键注意力通过零值键跳过前缀。掩码并行树解码并行起草跨度并在恒定步骤中扩展可能的分支。Spancast在平均接受长度上超过了现有的学习型和检索型基线,降低了目标模型的跨token延迟,并且可零样本迁移到未见过的目标模型。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑