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

用于大型语言模型快速推测解码的循环草稿器

Recurrent Drafter for Fast Speculative Decoding in Large Language Models

Apple(苹果公司)

Yunfei Cheng, Aonan Zhang, Xuanyu Zhang, Chong Wang, Yi Wang

AI总结:

提出循环草稿器ReDrafter,利用RNN草稿模型、动态树注意力与知识蒸馏,在MT-Bench上使Vicuna推理加速2.8倍,并在Apple Silicon上实现2.3倍加速。

摘要:

我们提出了循环草稿器(ReDrafter),一种先进的推测解码方法,可在大型语言模型(LLM)推理中实现最先进的加速。性能提升由三个关键方面驱动:(1)利用循环神经网络(RNN)作为草稿模型,以LLM的隐藏状态为条件;(2)在束搜索结果上应用动态树注意力算法,以消除候选序列中的重复前缀;(3)通过从LLM进行知识蒸馏来训练。ReDrafter在MT-Bench中使Vicuna推理加速高达2.8倍,采用PyTorch实现在Nvidia H100 GPU上运行。为展示其在真实环境中的实用性,我们还在MLX中实现了该方法,并在Apple Silicon芯片的Metal GPU上进行了基准测试,验证了其在设备端应用的有效性,实现了高达2.3倍的加速。

英文摘要:

We present Recurrent Drafter (ReDrafter), an advanced speculative decoding approach that achieves state-of-the-art speedup for large language models (LLMs) inference. The performance gains are driven by three key aspects: (1) leveraging a recurrent neural network (RNN) as the draft model conditioning on LLM's hidden states, (2) applying a dynamic tree attention algorithm over beam search results to eliminate duplicated prefixes in candidate sequences, and (3) training through knowledge distillation from the LLM. ReDrafter accelerates Vicuna inference in MT-Bench by up to 2.8x with a PyTorch implementation on Nvidia H100 GPUs. To demonstrate its practicality in real environments, we also validated its effectiveness for on-device applications by implementing the approach in MLX and benchmarking performance on Metal GPUs in Apple Silicon chips, achieving up to 2.3x speedup.

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

↑