arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.21224cs.CLcs.AIcs.DCcs.LG
收藏

让每个草稿都值得:基于隐藏状态的推测解码

Make Every Draft Count: Hidden State based Speculative Decoding

The Chinese University of Hong Kong(香港中文大学);University of Waterloo(滑铁卢大学);University of Science and Technology of China(中国科学技术大学)

Yuetao Chen, Xuliang Wang, Xinzhou Zheng, Ming Li, Peng Wang, Hong Xu

AI总结:

本文提出基于隐藏状态的推测解码系统,通过自回归预测和延迟整合标记信息,提高隐藏状态重用率,实现3.3倍的推理速度提升。

摘要:

推测解码作为一种加速大语言模型(LLM)推理的关键技术,通过使用轻量级的草案模型生成候选标记,这些标记随后由目标模型并行验证。然而,尽管这种范式成功地提高了内存绑定推理的算术强度,但它导致了显著的计算低效性:大多数草案标记失败验证并被丢弃,导致计算资源浪费。受回收浪费计算的目标驱动,我们提出了一种新颖的系统,将被丢弃的草案转换为可重用的标记。我们的关键见解是,在隐藏状态层面执行自回归预测,并在生成隐藏状态后推迟整合标记信息,这样草案隐藏状态不会受到错误标记的污染,从而实现隐藏状态的重用。为了实现这种系统,首先我们引入了一种基于自回归隐藏状态的草案模型架构,其比基于标记的草案器保留了更丰富的语义,以促进草案的再利用。其次,我们设计了一种高效的标记信息注入机制,利用我们的专用草案模型构建高质量的草案标记树,并能够从验证失败中重新采样标记。第三,我们消除了设计中的开销,进一步最大化硬件利用率。我们对各种基线进行了广泛的评估,证明了相对于标准推测解码,速度提高了高达3.3倍。

英文摘要:

Speculative decoding has emerged as a pivotal technique to accelerate LLM inference by employing a lightweight draft model to generate candidate tokens that are subsequently verified by the target model in parallel. However, while this paradigm successfully increases the arithmetic intensity of memory-bound inference, it causes significant compute inefficiency: the majority of draft tokens fail verification and are discarded, resulting in waste of computation. Motivated by the goal of recollecting this wasted computation, we propose a novel system that transforms discarded drafts into reusable tokens. Our key insight is to perform auto-regressive prediction at the hidden states level and postpone the integrating token information after the hidden states generation, so the draft hidden states are not contaminated by incorrect tokens, enabling hidden state reuse. To implement such a system, first we introduce a draft model architecture based on auto-regressive hidden states, which preserves richer semantics than token-based drafters to facilitate draft repurposing. Second, we design an efficient token information injection mechanism that leverages our specialized draft model to construct high-quality draft token trees and enables resampling tokens from verification failures. Third, we eliminate the overhead hidden in our design to further maximize hardware utilization. We conducted extensive evaluations against various baselines, demonstrating up to a 3.3x speedup against standard speculative decoding.

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

↑