2025-03-05 · 进阶 · 机器学习 · 自然语言处理

FR-Spec: Accelerating Large-Vocabulary Language Models via Frequency-Ranked Speculative Sampling

FR-Spec通过频率优先的预测策略,显著加速了大规模语言模型在词汇量较大时的生成速度。

更新于 2025-03-05。作者:Weilin Zhao、Tengyu Pan、Xu Han、Yudi Zhang、Ao Sun、Yuxiang Huang、Kaihuo Zhang、Weilun Zhao、Yuxuan Li、Jianyong Wang、Zhiyuan Liu、Maosong Sun。

中文摘要

推测采样已成为加速大型语言模型(LLMs)自回归生成过程的重要技术,它通过采用先草拟后验证的机制,在每次前向传递中生成多个标记。尽管最先进的推测采样方法仅使用单层和语言模型(LM)头作为草拟模型,实现了令人印象深刻的层压缩,但它们的效率提升对于拥有大词汇量的大型LLMs(如词汇量为128k的Llama-3-8B)来说大幅减少。为了解决这个问题,我们提出了FR-Spec,这是一种基于频率排序的推测采样框架,通过词汇空间压缩优化草拟候选选择。通过将草拟搜索限制在频率优先的标记子集,我们的方法将LM头计算开销减少了75%,同时确保最终输出分布的等价性。在多个数据集上的实验表明,与最先进的推测采样方法EAGLE-2相比,平均速度提升了1.12倍。

英文摘要

Speculative sampling has emerged as an important technique for accelerating the auto-regressive generation process of large language models (LLMs) by utilizing a draft-then-verify mechanism to produce multiple tokens per forward pass. While state-of-the-art speculative sampling methods use only a single layer and a language modeling (LM) head as the draft model to achieve impressive layer compression, their efficiency gains are substantially reduced for large-vocabulary LLMs, such as Llama-3-8B with a vocabulary of 128k tokens. To address this, we present FR-Spec, a frequency-ranked speculative sampling framework that optimizes draft candidate selection through vocabulary space compression. By constraining the draft search to a frequency-prioritized token subset, our method reduces LM Head computation overhead by 75% while ensuring the equivalence of the final output distribution. Experiments across multiple datasets demonstrate an average of 1.12times speedup over the state-of-the-art speculative sampling method EAGLE-2.

解读

一句话总结

FR-Spec通过频率优先的预测策略,显著加速了大规模语言模型在词汇量较大时的生成速度。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源