Speculative decoding (SD), where a small draft model is employed to propose draft tokens in advance and then the target model validates them in parallel, has emerged as a promising technique for LLM inference acceleration. Many endeavors to improve SD are to eliminate the need for a draft model and generate draft tokens in a retrieval-based manner in order to further alleviate the drafting overhead and significantly reduce the difficulty in deployment and applications. However, retrieval-based SD relies on a matching paradigm to retrieval the most relevant reference as the draft tokens, where these methods often fail to find matched and accurate draft tokens. To address this challenge, we propose LogitSpec to effectively expand the retrieval range and find the most relevant reference as drafts. Our LogitSpec is motivated by the observation that the logit of the last token can not only predict the next token, but also speculate the next next token. Specifically, LogitSpec generates draft tokens in two steps: (1) utilizing the last logit to speculate the next next token; (2) retrieving relevant reference for both the next token and the next next token. LogitSpec is training-free and plug-and-play, which can be easily integrated into existing LLM inference frameworks. Extensive experiments on a wide range of text generation benchmarks demonstrate that LogitSpec can achieve up to 2.61 $\times$ speedup and 3.28 mean accepted tokens per decoding step. Our code is available at https://github.com/smart-lty/LogitSpec.


翻译:推测解码(Speculative Decoding, SD)通过使用一个小型草稿模型预先生成候选词元,再由目标模型并行验证,已成为一种有前景的大语言模型推理加速技术。许多改进SD的努力旨在消除对草稿模型的需求,转而采用基于检索的方式生成候选词元,以进一步降低草稿生成开销并显著减少部署与应用难度。然而,基于检索的SD依赖于匹配范式来检索最相关的参考作为候选词元,这些方法往往难以找到匹配且准确的候选词元。为应对这一挑战,我们提出LogitSpec,以有效扩大检索范围并找到最相关的参考作为草稿。LogitSpec的动机源于观察到最后一个词元的逻辑值不仅能预测下一个词元,还能推测下下一个词元。具体而言,LogitSpec通过两个步骤生成候选词元:(1)利用最后一个逻辑值推测下下一个词元;(2)为下一个词元及下下一个词元检索相关参考。LogitSpec无需训练且即插即用,可轻松集成到现有的大语言模型推理框架中。在广泛的文本生成基准测试上的大量实验表明,LogitSpec最高可实现2.61倍的加速,且每个解码步骤平均接受3.28个词元。我们的代码公开于https://github.com/smart-lty/LogitSpec。

0
下载
关闭预览

相关内容

面向多模态智能的下一个Token预测:综述
专知会员服务
26+阅读 · 2024年12月30日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
35+阅读 · 2020年9月3日
通过集成 XNNPACK 实现推理速度飞跃
TensorFlow
26+阅读 · 2020年7月30日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
超全总结:神经网络加速之量化模型 | 附带代码
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
VIP会员
最新内容
人工智能赋能无人机:俄乌战争(万字长文)
专知会员服务
4+阅读 · 今天6:56
国外海军作战管理系统与作战训练系统
专知会员服务
2+阅读 · 今天4:16
美军条令《海军陆战队规划流程(2026版)》
专知会员服务
9+阅读 · 今天3:36
《压缩式分布式交互仿真标准》120页
专知会员服务
4+阅读 · 今天3:21
《电子战数据交换模型研究报告》
专知会员服务
6+阅读 · 今天3:13
《基于Transformer的异常舰船导航识别与跟踪》80页
《低数据领域军事目标检测模型研究》
专知会员服务
6+阅读 · 今天2:37
【CMU博士论文】物理世界的视觉感知与深度理解
专知会员服务
10+阅读 · 4月22日
伊朗战争停火期间美军关键弹药状况分析
专知会员服务
8+阅读 · 4月22日
电子战革命:塑造战场的十年突破(2015–2025)
相关VIP内容
面向多模态智能的下一个Token预测:综述
专知会员服务
26+阅读 · 2024年12月30日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
35+阅读 · 2020年9月3日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员