N-Grammys:利用免学习的批量推测加速自回归推理
The N-Grammys: Accelerating Autoregressive Inference with Learning-Free Batched Speculation
AI总结:
本文提出免学习的N-gram草稿策略组合,通过并行验证加速自回归推理,性能媲美复杂方法且无需修改模型,实现即插即用集成。
摘要:
推测解码旨在通过并行验证由较小草稿模型生成的token来加速语言模型的自回归生成。在本工作中,我们探索了免学习、近乎零成本的草稿策略的有效性,即从模型权重和上下文中获得的N-grams。虽然基础模型预测的下一个token很少是这些简单策略的顶级预测,但我们观察到,对于较小的k值,它常常位于其top-k预测之内。基于此,我们表明,简单策略的组合可以在不同任务上实现显著的推理加速。整体性能与更复杂的方法相当,但不需要昂贵的预处理或修改基础模型,并允许无缝地“即插即用”集成到流水线中。
英文摘要:
Speculative decoding aims to speed up autoregressive generation of a language model by verifying in parallel the tokens generated by a smaller draft model.In this work, we explore the effectiveness of learning-free, negligible-cost draft strategies, namely $N$-grams obtained from the model weights and the context. While the predicted next token of the base model is rarely the top prediction of these simple strategies, we observe that it is often within their top-$k$ predictions for small $k$. Based on this, we show that combinations of simple strategies can achieve significant inference speedups over different tasks. The overall performance is comparable to more complex methods, yet does not require expensive preprocessing or modification of the base model, and allows for seamless `plug-and-play' integration into pipelines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。