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

EAGLE:推测采样需要重新思考特征不确定性

EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty

Peking University(北京大学);Microsoft Research(微软研究院);University of Waterloo(滑铁卢大学);Vector Institute(矢量研究院)

Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang

AI总结:

本文提出高效推测采样框架EAGLE,通过引入提前一步的词元序列解决特征级自回归的不确定性,实现精确的次顶层特征预测,在LLaMA2-Chat 70B上取得2.7-3.5倍加速且不改变文本分布。

摘要:

自回归解码使得大型语言模型(LLMs)的推理过程耗时较长。本文重新审视推测采样并得出两个关键观察。首先,特征(次顶层)级别的自回归比词元级别更为直接。其次,特征(次顶层)级别自回归中固有的不确定性制约了其性能。基于这些洞察,我们提出了EAGLE(Extrapolation Algorithm for Greater Language-model Efficiency),一个简单但高效的推测采样框架。通过引入提前一个时间步的词元序列,EAGLE有效消除了不确定性,以极小的开销实现了精确的次顶层特征预测。我们对EAGLE进行了全面评估,涵盖Vicuna和LLaMA2-Chat系列的所有模型、MoE模型Mixtral 8x7B Instruct,以及对话、代码生成、数学推理和指令遵循等任务。对于LLaMA2-Chat 70B,EAGLE实现了2.7倍至3.5倍的延迟加速比,吞吐量翻倍,同时保持了生成文本的分布。

英文摘要:

Autoregressive decoding makes the inference of Large Language Models (LLMs) time-consuming. In this paper, we reconsider speculative sampling and derive two key observations. Firstly, autoregression at the feature (second-to-top-layer) level is more straightforward than at the token level. Secondly, the inherent uncertainty in feature (second-to-top-layer) level autoregression constrains its performance. Based on these insights, we introduce EAGLE (Extrapolation Algorithm for Greater Language-model Efficiency), a simple yet highly efficient speculative sampling framework. By incorporating a token sequence advanced by one time step, EAGLE effectively resolves the uncertainty, enabling precise second-to-top-layer feature prediction with minimal overhead. We conducted comprehensive evaluations of EAGLE, including all models from the Vicuna and LLaMA2-Chat series, the MoE model Mixtral 8x7B Instruct, and tasks in dialogue, code generation, mathematical reasoning, and instruction following. For LLaMA2-Chat 70B, EAGLE achieved a latency speedup ratio of 2.7x-3.5x, doubled throughput, while maintaining the distribution of the generated text.

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

↑