我们提出了一种通过语义自适应令牌的推测解码(Speculative Decoding with Semantic Adaptive Tokens,SDSAT)来加速大语言模型(LLMs)的方案。该设计的主要目标是在不损害模型准确性的前提下,增强大语言模型更准确地生成草稿令牌的能力。核心策略包括:1)在不改变模型结构的情况下,通过引入具有灵活解码能力的语义自适应令牌对模型进行微调,使其能够生成高质量的草稿令牌。2)通过采用不影响标准令牌的训练方法,模型可以在其原始框架之上以最小的训练开销获得并行解码能力。3)我们设计了使用贪心搜索和核采样的“两步草稿-然后-验证”生成策略。在CodeLlama-13B和7B模型上进行的实验分别实现了超过3.5倍和3.0倍的速度提升。请参阅https://github.com/hasuoshenyun/SDSAT。
英文摘要:
We propose an acceleration scheme for large language models (LLMs) through Speculative Decoding with Semantic Adaptive Tokens (SDSAT). The primary objective of this design is to enhance the LLM model's ability to generate draft tokens more accurately without compromising the model's accuracy. The core strategies involve: 1) Fine-tune the model by incorporating semantic adaptive tokens that possess flexible decoding capabilities without changing its structure, allowing them to generate high-quality draft tokens. 2) By employing a training method that does not affect the standard tokens, the model can acquire parallel decoding abilities atop its original framework with minimal training overhead. 3) We have designed the "two-step-draft-then-verify" generation strategies using both greedy search and nucleus sampling. Experiments conducted on the CodeLlama-13B and 7B models have yielded speed increases of over 3.5X and 3.0X, respectively. Please refer to https://github.com/hasuoshenyun/SDSAT.
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(北京邮电大学计算机学院)
DREAM: Drafting with Refined Target Features and Entropy-Adaptive Cross-Attention Fusion for Multimodal Speculative Decoding
Courant Institute of Mathematical Sciences, New York University(纽约大学数学科学学院);Tandon School of Engineering, New York University(纽约大学工程学院);Cerebras Systems Inc.(Cerebras Systems公司);University of Pennsylvania(宾夕法尼亚大学)
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(启元科技)
CLaSp: In-Context Layer Skip for Self-Speculative Decoding
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(深圳先进技术研究院,中国科学院);University of Chinese Academy of Sciences(中国科学院大学);Singapore University of Technology and Design(新加坡科技设计大学);School of Biomedical Engineering, UNSW Sydney(新南威尔士大学生物医学工程学院)
Mistletoe: Stealthy Acceleration-Collapse Attacks on Speculative Decoding
Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));South China University of Technology(华南理工大学);Tsinghua Shenzhen International Graduate School, Tsinghua University(清华大学深圳国际研究生院);Huawei Technology(华为技术)
AdaEAGLE: Optimizing Speculative Decoding via Explicit Modeling of Adaptive Draft Structures
X-LANCE Lab(X-LANCE实验室);Department of Computer Science and Engineering(计算机科学与工程系);MoE Key Lab of Artificial Intelligence(教育部人工智能重点实验室);SJTU AI Institute(上海交通大学人工智能研究院);Shanghai Jiao Tong University(上海交通大学)
PACER: Blockwise Pre-verification for Speculative Decoding with Adaptive Length
X-LANCE Lab, School of Computer Science MoE Key Lab of Artificial Intelligence, SJTU AI Institute Shanghai Jiao Tong University(X-LANCE实验室,计算机科学学院,人工智能关键实验室,上海交通大学人工智能研究院)
Accelerating Speculative Decoding with Block Diffusion Draft Trees
Department of Computer Science, Technion – Israel Institute of Technology(计算机科学系,技术离子理工学院 – 以色列理工学院);Department of Electrical and Computer Engineering, Technion – Israel Institute of Technology(电气与计算机工程系,技术离子理工学院 – 以色列理工学院)
Spec-LLaVA: Accelerating Vision-Language Models with Dynamic Tree-Based Speculative Decoding
Carnegie Mellon University(卡内基梅隆大学);University of Nottingham(诺丁汉大学);The University of Hong Kong(香港大学);The Hong Kong Polytechnic University(香港理工大学);Columbia University(哥伦比亚大学);University of California, Berkeley(加州大学伯克利分校)
Traversal Verification for Speculative Tree Decoding
Lenovo AI Technology Center, Lenovo(联想人工智能技术中心,联想);National Center for Mathematics and Interdisciplinary Sciences (NCMIS), AMSS, CAS(国家数学与交叉科学中心(NCMIS),中国科学院数学研究所)
AdaFlash: Adaptive Speculative Decoding via On-Policy Distilled Diffusion Drafters
State Key Laboratory for Novel Software Technology, Nanjing University(南京大学计算机软件新技术国家重点实验室);School of Artificial Intelligence, Nanjing University(南京大学人工智能学院);Huawei Foundation Model Dept(华为基础模型部)
Red Note Hi-Lab(红笔记高研实验室);Shanghai Jiaotong University(上海交通大学);Nanjing University(南京大学);Zhejiang University(浙江大学);Chinese University of Hong Kong(香港中文大学)