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

打破LLM推理的顺序依赖性:使用前瞻解码

Break the Sequential Dependency of LLM Inference Using Lookahead Decoding

UCSD(加利福尼亚大学圣迭戈分校);Google(谷歌);UC Berkeley(加利福尼亚大学伯克利分校)

Yichao Fu, Peter Bailis, Ion Stoica, Hao Zhang

AI总结:

本文提出前瞻解码,一种无需辅助模型的精确并行解码算法,通过以每步log(FLOPs)换取减少解码步数,在MT-bench上实现1.8倍、多GPU代码补全上4倍的加速。

摘要:

大语言模型(LLM)的自回归解码受限于内存带宽,导致高延迟并严重浪费现代加速器的并行处理能力。现有的加速LLM解码方法通常需要草稿模型(如推测解码),而草稿模型难以获得且无法泛化。在本文中,我们引入了前瞻解码(Lookahead decoding),一种精确的并行解码算法,无需辅助模型或数据存储即可加速LLM解码。它允许以每步log(FLOPs)的代价来减少总解码步数,在单个或多个现代加速器上更具并行性,并与并发内存高效注意力(如FlashAttention)兼容。我们的前瞻解码实现可在MT-bench上将自回归解码速度提升高达1.8倍,在代码补全任务中多GPU强扩展下提升高达4倍。我们的代码可在https://github.com/hao-ai-lab/LookaheadDecoding获取。

英文摘要:

Autoregressive decoding of large language models (LLMs) is memory bandwidth bounded, resulting in high latency and significant wastes of the parallel processing power of modern accelerators. Existing methods for accelerating LLM decoding often require a draft model (e.g., speculative decoding), which is nontrivial to obtain and unable to generalize. In this paper, we introduce Lookahead decoding, an exact, parallel decoding algorithm that accelerates LLM decoding without needing auxiliary models or data stores. It allows trading per-step log(FLOPs) to reduce the number of total decoding steps, is more parallelizable on single or multiple modern accelerators, and is compatible with concurrent memory-efficient attention (e.g., FlashAttention). Our implementation of Lookahead decoding can speed up autoregressive decoding by up to 1.8x on MT-bench and 4x with strong scaling on multiple GPUs in code completion tasks. Our code is avialable at https://github.com/hao-ai-lab/LookaheadDecoding

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

↑