arXiv:2605.26444cs.CL2026-05被引 1

用动态小词汇表加速推测生成,速度提升超50%。

NanoSpec: Accelerating Speculative Decoding using Minimalist In-Context Vocabularies

论文配图:NanoSpec: Accelerating Speculative Decoding using Minimalist In-Context Vocabularies
图 1 · 摘自论文原文
  • 根据上下文动态构建极简词汇表,每步仅保留关键词。
  • 平均词汇量缩至3000以下,比原有小40倍以上。
  • 无需训练参数,适配现代显卡,适合部署优化场景。

大型语言模型动辄超过10万词的词表规模,在推测生成的最终线性投影层中造成计算瓶颈。现有词表剪枝方法依赖静态或粗粒度子词表,需维持约3万活跃词以保证草稿质量。我们提出NanoSpec,一种无需训练的新方法,通过动态构建每个生成步骤的上下文感知极简词表,利用语言生成的时间局部性,在不损失草稿质量的前提下,将平均词表大小压缩超过40倍(降至3000以内)。为充分发挥高稀疏性的理论优势,我们设计了软硬件协同方案,通过异步收集与GPU驻留状态管理克服稀疏内存访问效率低的问题。作为可即插即用模块,NanoSpec在7个任务上平均降低草稿时间51.6%,相比当前最优的EAGLE-2和EAGLE-3实现1.17–1.29倍端到端加速,并优于复杂训练型剪枝基线。

原文摘要 · Abstract (English)

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.

推理加速推测生成词表压缩系统优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。