arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2403.18647cs.CL
收藏

SDSAT:通过语义自适应令牌的推测解码加速大语言模型推理

SDSAT: Accelerating LLM Inference through Speculative Decoding with Semantic Adaptive Tokens

Thundersoft(Thunder Software)

Chengbo Liu, Yong Zhu

AI总结:

本文提出SDSAT方法,通过引入语义自适应令牌和两步草稿-验证策略实现大语言模型推测解码加速,在CodeLlama-13B和7B上分别获得超过3.5倍和3.0倍的速度提升。

摘要:

我们提出了一种通过语义自适应令牌的推测解码(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.

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

↑