arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.16858cs.CLcs.LG
收藏

EAGLE-2:利用动态草稿树加速语言模型推理

EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees

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

Yuhui Li, Fangyun Wei, Chao Zhang, Hongyang Zhang

AI总结:

本文提出EAGLE-2,通过引入上下文感知的动态草稿树改进投机采样,利用草稿模型置信度近似接受率,在三个LLM系列和六项任务上实现3.05-4.26倍加速,比EAGLE-1快20%-40%,且保持生成分布不变。

摘要:

现代大语言模型(LLMs)的推理过程昂贵且耗时,投机采样已被证明是一种有效的解决方案。大多数投机采样方法(如EAGLE)使用静态草稿树,隐式假设草稿token的接受率仅取决于其位置。有趣的是,我们发现草稿token的接受率还与上下文相关。本文在EAGLE的基础上提出EAGLE-2,在草稿建模中引入了一种上下文感知的动态草稿树新技术。这一改进利用了EAGLE草稿模型校准良好的事实:草稿模型给出的置信度分数能以较小误差近似接受率。我们在三个系列的LLMs和六项任务上进行了广泛评估,EAGLE-2实现了3.05倍至4.26倍的加速比,比EAGLE-1快20%-40%。EAGLE-2还确保生成文本的分布保持不变,使其成为一种无损加速算法。

英文摘要:

Inference with modern Large Language Models (LLMs) is expensive and time-consuming, and speculative sampling has proven to be an effective solution. Most speculative sampling methods such as EAGLE use a static draft tree, implicitly assuming that the acceptance rate of draft tokens depends only on their position. Interestingly, we found that the acceptance rate of draft tokens is also context-dependent. In this paper, building upon EAGLE, we propose EAGLE-2, which introduces a new technique of context-aware dynamic draft tree into drafting modeling. This improvement leverages the fact that the draft model of EAGLE is well-calibrated: the confidence scores from the draft model approximate acceptance rates with small errors. We conducted extensive evaluations on three series of LLMs and six tasks, with EAGLE-2 achieving speedup ratios 3.05x-4.26x, which is 20%-40% faster than EAGLE-1. EAGLE-2 also ensures that the distribution of the generated text remains unchanged, making it a lossless acceleration algorithm.

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

↑