自回归解码使得大型语言模型(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.
Red Note Hi-Lab(红笔记高研实验室);Shanghai Jiaotong University(上海交通大学);Nanjing University(南京大学);Zhejiang University(浙江大学);Chinese University of Hong Kong(香港中文大学)
Draft-OPD: On-Policy Distillation for Speculative Draft Models
Shanghai Jiao Tong University(上海交通大学);Shanghai AI Laboratory(上海人工智能实验室);Tsinghua University(清华大学);The Chinese University of Hong Kong(香港中文大学);Peking University(北京大学);Zhejiang University(浙江大学)
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(北京邮电大学计算机学院)
Flatter Tokens are More Valuable for Speculative Draft Model Training
Key Laboratory of New Generation Artificial Intelligence Technology and Its Interdisciplinary Applications (Southeast University), Ministry of Education(新一代人工智能技术及其交叉应用关键实验室(东南大学));Southeast University(东南大学);Nanjing University of Information Science and Technology(南京信息工程大学);Qiyuan Tech(启元科技)
RheoSampling: Resolving the One-Hot Dilemma in Stochastic Dynamic-Tree Speculative Decoding
National Center for Mathematics and Interdisciplinary Sciences (NCMIS), AMSS, CAS(中国科学院数学与系统科学研究院国家数学与交叉科学中心);The University of Tokyo(东京大学);SKLMS and AMSS, Chinese Academy of Sciences(中国科学院数学与系统科学研究院,科学与工程计算国家重点实验室);School of Mathematical Sciences, University of Chinese Academy of Sciences(中国科学院大学数学科学学院);Lenovo AI Technology Center(联想AI技术中心)
Learning to Draft: Adaptive Speculative Decoding with Reinforcement Learning
National Key Laboratory for Multimedia Information Processing, Peking University(多媒体信息处理国家级重点实验室,北京大学);School of Computer Science, Peking University(计算机科学学院,北京大学);Microsoft Research Asia(微软亚洲研究院)
SAM Decoding: Speculative Decoding via Suffix Automaton
School of Information, Renmin University of China(中国人民大学信息学院);Key Laboratory of Data Engineering and Knowledge Engineering(数据工程与知识工程重点实验室);Knowledge Engineering Group, Tsinghua University(清华大学知识工程组);Engineering Research Center of Database and Business Intelligence(数据库与商业智能工程研究中心)