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

用于推测解码的注意力混合

Mixture of Attentions For Speculative Decoding

UCL Centre for Artificial Intelligence(伦敦大学学院人工智能中心)

Matthieu Zimmer, Milan Gritta, Gerasimos Lampouras, Haitham Bou Ammar, Jun Wang

AI总结:

本文提出用于推测解码的注意力混合架构,解决小模型缺乏同策略性和部分可观察性问题,在单设备和客户端-服务器场景下均实现显著加速与更高准确性。

摘要:

大型语言模型(LLMs)参数数量的增长导致计算需求显著激增,使其部署具有挑战性且成本高昂。推测解码(SD)利用较小的模型高效地提出未来的词元,然后由LLM并行验证。利用LLM激活的较小模型目前实现了最快的解码速度。然而,我们发现了SD模型的几个局限性,包括训练期间缺乏同策略性以及部分可观察性。为了解决这些缺点,我们通过为SD引入注意力混合,提出了一种更具根基的小型模型架构。我们的新架构可应用于两种场景:传统的单设备部署,以及一种新颖的客户端-服务器部署,其中小模型托管在消费设备上,而LLM托管在服务器上。在单设备场景中,我们展示了最先进的加速效果,将EAGLE-2提升了9.5%,其接受长度提升了25%。在客户端-服务器设置中,我们的实验表明:1)在不同的网络条件下,以最少的对服务器的调用实现了最先进的延迟;2)在完全断开连接的情况下,与其他SD方法相比,我们的方法能够保持更高的准确性,并展示出优于对LLM进行API调用的优势,后者否则将无法继续生成过程。

英文摘要:

The growth in the number of parameters of Large Language Models (LLMs) has led to a significant surge in computational requirements, making them challenging and costly to deploy. Speculative decoding (SD) leverages smaller models to efficiently propose future tokens, which are then verified by the LLM in parallel. Small models that utilise activations from the LLM currently achieve the fastest decoding speeds. However, we identify several limitations of SD models including the lack of on-policyness during training and partial observability. To address these shortcomings, we propose a more grounded architecture for small models by introducing a Mixture of Attentions for SD. Our novel architecture can be applied in two scenarios: a conventional single device deployment and a novel client-server deployment where the small model is hosted on a consumer device and the LLM on a server. In a single-device scenario, we demonstrate state-of-the-art speedups improving EAGLE-2 by 9.5% and its acceptance length by 25%. In a client-server setting, our experiments demonstrate: 1) state-of-the-art latencies with minimal calls to the server for different network conditions, and 2) in the event of a complete disconnection, our approach can maintain higher accuracy compared to other SD methods and demonstrates advantages over API calls to LLMs, which would otherwise be unable to continue the generation process.

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

↑