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

通过投机解码实现更快的级联推理

Faster Cascades via Speculative Decoding

Google Research(谷歌研究院)

Harikrishna Narasimhan, Wittawat Jitkrittum, Ankit Singh Rawat, Seungyeon Kim, Neha Gupta, Aditya Krishna Menon, Sanjiv Kumar

AI总结:

本文提出投机级联技术,将级联推理的延迟规则通过投机执行实现,结合两种方法的优势,在Gemma和T5模型上取得优于基线的成本-质量权衡。

摘要:

级联推理和投机解码是提升语言模型推理效率的两种常见方法。两种方法都涉及不同规模模型的交错使用,但机制根本不同:级联推理采用延迟规则,仅对“困难”输入调用较大模型;而投机解码则利用投机执行,主要以并行验证模式调用较大模型。这些机制带来不同的优势:经验上,级联推理提供更好的成本-质量权衡,通常甚至优于单独使用大模型;理论上,投机解码则提供质量中性的保证。本文通过设计新的投机级联技术,利用投机执行来实现其延迟规则,从而结合两种方法的优点。我们刻画了投机级联的最优延迟规则,并采用插件式近似来实现该最优规则。在多个语言基准上使用Gemma和T5模型进行的实验表明,与级联推理和投机解码基线相比,我们的方法实现了更好的成本-质量权衡。

英文摘要:

Cascades and speculative decoding are two common approaches to improving language models' inference efficiency. Both approaches involve interleaving models of different sizes, but via fundamentally distinct mechanisms: cascades employ a deferral rule that invokes the larger model only for "hard" inputs, while speculative decoding uses speculative execution to primarily invoke the larger model in parallel verification mode. These mechanisms offer different benefits: empirically, cascades offer better cost-quality trade-offs, often even outperforming the large model, while theoretically, speculative decoding offers a guarantee of quality-neutrality. In this paper, we leverage the best of both these approaches by designing new speculative cascading techniques that implement their deferral rule through speculative execution. We characterize the optimal deferral rule for our speculative cascades, and employ a plug-in approximation to the optimal rule. Experiments with Gemma and T5 models on a range of language benchmarks show that our approach yields better cost quality trade-offs than cascading and speculative decoding baselines.

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

↑