arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.26444cs.CL
收藏

NanoSpec: 利用极简上下文词汇表加速推测解码

NanoSpec: Accelerating Speculative Decoding using Minimalist In-Context Vocabularies

Institute for Artificial Intelligence, Peking University, Beijing, China(北京大学人工智能研究院);Key Laboratory of High Confidence Software Technologies (Peking University), Ministry of Education(教育部高可信软件技术重点实验室);School of Computer Science, Peking University, Beijing, China(北京大学计算机学院);State Key Laboratory of Networking(网络与交换技术国家重点实验室);School of Computer Science, Beijing University of Posts(北京邮电大学计算机学院)

Zhiyang Chen, Daliang Xu, Yinyuan Zhang, Chenghua Wang, Mengwei Xu, Yun Ma

AI总结:

提出NanoSpec,一种无需训练的方法,通过动态构建极简上下文感知词汇表(平均<3k tokens),结合系统-算法协同设计,将推测解码的草稿生成时间平均减少51.6%,实现端到端加速1.17-1.29倍。

摘要:

大型语言模型的巨大词汇量(通常超过10万tokens)在推测解码过程中对最后的线性投影层造成了计算瓶颈。现有的词汇表剪枝方案依赖于静态或粗粒度的子词汇表,需要较大的活跃大小(约30k)才能维持草稿质量。我们提出NanoSpec,一种新颖的无需训练的方法,通过为每个生成步骤动态构建一个极简的、上下文感知的活跃词汇表,打破了这种权衡。利用语言生成固有的时间局部性,NanoSpec实现了高覆盖率,同时将平均词汇量削减了40倍以上(降至<3k tokens),且无需任何辅助训练参数。为了在现代硬件上实现这种高稀疏性的理论优势,我们引入了系统-算法协同设计,通过异步收集和GPU驻留状态管理克服了稀疏内存访问的低效问题。作为一个互补的即插即用模块,NanoSpec将草稿生成时间平均减少了51.6%,在7个任务上比最先进的推测解码方法EAGLE-2和EAGLE-3实现了1.17-1.29倍的端到端加速,并优于复杂的基于训练的剪枝基线。

英文摘要:

The massive vocabulary sizes of large language models, often exceeding 100k tokens, impose a computational bottleneck on the final linear projection layer during speculative decoding. Existing vocabulary pruning solutions rely on static or coarsely-grained sub-vocabularies that necessitate large active sizes ($\sim$30k) to maintain draft quality. We propose NanoSpec, a novel training-free approach that breaks this trade-off by dynamically constructing a minimalist, context-aware active vocabulary for each generation step. Leveraging the inherent temporal locality of language generation, NanoSpec achieves high coverage while slashing the average vocabulary size by over $40\times$ (to $<$3k tokens) without requiring any auxiliary trained parameters. To realize the theoretical benefits of such high sparsity on modern hardware, we introduce a system-algorithm co-design that overcomes the inefficiencies of sparse memory access through asynchronous gathering and GPU-resident state management. As a complementary plug-and-play module, NanoSpec cuts draft time by an average of 51.6\%, delivering a $1.17$-$1.29\times$ end-to-end speedup over the state-of-the-art speculative decoding methods EAGLE-2 and EAGLE-3 across 7 tasks and outperforming complex training-based pruning baselines.

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

↑