arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2402.01528cs.LGcs.CL
收藏

解码推测解码

Decoding Speculative Decoding

University of Wisconsin-Madison(威斯康星大学麦迪逊分校)

Minghao Yan, Saurabh Agarwal, Shivaram Venkataraman

AI总结:

本文通过350余次实验系统研究推测解码中草稿模型选择对加速效果的影响,发现草稿模型延迟比语言建模能力更关键,并据此设计硬件高效草稿模型,使吞吐量提升111%,且方法可推广到多种LLaMA及微调模型。

摘要:

推测解码(Speculative Decoding)是一种广泛使用的技术,可在不牺牲质量的前提下加速大型语言模型(LLMs)的推理。在执行推理时,推测解码使用一个较小的草稿模型(draft model)生成推测性token,然后使用目标LLM验证这些草稿token。推测解码所提供的加速效果在很大程度上取决于草稿模型的选择。在这项工作中,我们进行了一项详细研究,包含使用推测解码对LLaMA-65B和OPT-66B进行的超过350次实验,并刻画了影响推测解码性能增益的因素。我们的实验表明,推测解码的性能在很大程度上取决于草稿模型的延迟,而草稿模型的语言建模能力与其在推测解码中的表现并没有很强的相关性。基于这些见解,我们探索了草稿模型的新设计空间,并为推测解码设计了硬件高效的草稿模型。我们新设计的草稿模型能够比现有草稿模型提供高111%的吞吐量,并且我们的方法进一步推广到所有LLaMA模型(1/2/3.1)以及监督微调模型。

英文摘要:

Speculative Decoding is a widely used technique to speed up inference for Large Language Models (LLMs) without sacrificing quality. When performing inference, speculative decoding uses a smaller draft model to generate speculative tokens and then uses the target LLM to verify those draft tokens. The speedup provided by speculative decoding heavily depends on the choice of the draft model. In this work, we perform a detailed study comprising over 350 experiments with LLaMA-65B and OPT-66B using speculative decoding and delineate the factors that affect the performance gain provided by speculative decoding. Our experiments indicate that the performance of speculative decoding depends heavily on the latency of the draft model, and the draft model's capability in language modeling does not correlate strongly with its performance in speculative decoding. Based on these insights we explore a new design space for draft models and design hardware-efficient draft models for speculative decoding. Our newly designed draft model can provide 111% higher throughput than existing draft models and our approach generalizes further to all LLaMA models (1/2/3.1) and supervised fine-tuned models.

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

↑