arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.26412cs.CL
收藏

当隐藏状态漂移时:KV缓存能否拯救长程推测解码?

When Hidden States Drift: Can KV Caches Rescue Long-Range Speculative Decoding?

Qwen Applications Business Group of Alibaba(阿里巴巴Qwen应用业务组)

Tianyu Liu, Yuhao Shen, Xinyi Hu, Baolin Zhang, Hengxin Zhang, Jun Dai, Jun Zhang, Shuang Ge, Lei Chen, Yue Li, MingCheng Wan

AI总结:

本文研究长程推测解码中隐藏状态漂移问题,提出KV重用假设,通过KVShot框架验证,发现KV重用能提升长程接受率,但端到端加速有限,指出需超越TTT向块级训练发展。

摘要:

推测解码加速LLM推理,但基于隐藏状态的顶级drafters面临长程衰减:推测步数增加时draft准确性下降。现有工作将此衰减归因于训练-推理不匹配,并提出测试时训练(TTT)作为解决方案,但我们在TTT-trained drafters中仍观察到长程衰减持续存在。我们从上下文信息保存的角度重新审视长程衰减。在隐藏状态重用中,我们认为目标隐藏状态作为有偏的上下文压缩:它根据当前位置的注意力查询聚合历史token信息,产生一个为即时下token预测优化的紧凑表示。这种压缩可以抑制对当前查询不重要但对后续推测步骤重要的信息。相比之下,目标模型的KV缓存作为显式上下文,保留完整的token-wise KV表示。因此我们提出KV-Reuse假说:允许draft模型重用目标KV缓存可以为长范围drafting提供更丰富的信号。为测试此假说,我们引入KVShot,一个诊断框架,比较三种重用范式:隐藏-only、KV-only和混合。在Qwen3-8B上的广泛评估显示,KV重用提高长程接受率,尽管在当前训练管道下端到端加速仍有限。我们的分析识别出两个关键结构瓶颈:浅层drafters难以准确估计目标查询,且draft-side KV投影接收稀疏梯度信号。这些发现表明,实现KV-aware解码的全部潜力需要超越TTT向块级训练范式发展。通过暴露这些瓶颈,KVShot提供了一个基础诊断测试平台和设计下一代推理架构的明确路线图。

英文摘要:

Speculative decoding accelerates LLM inference, but SOTA hidden-state-based drafters suffer from long-range decay: draft accuracy degrades as the speculative step increases. Existing work attributes this decay to train-inference mismatch and proposes test-time training (TTT) as a remedy, yet we observe that long-range decay persists even in TTT-trained drafters. We revisit long-range decay from the perspective of context information preservation. In hidden-state reuse, we argue the target hidden state acts as a biased context compression: it aggregates historical token information according to the attention query at the current position, yielding a compact representation optimized for immediate next-token prediction. This compression can suppress information less relevant to the current query but important for later speculative steps. In contrast, the target model's KV cache serves as an explicit context, retaining the complete set of token-wise KV representations. We therefore posit the KV-Reuse Hypothesis: allowing the draft model to reuse the target KV cache can provide richer signals for long-horizon drafting. To test this hypothesis, we introduce KVShot, a diagnostic framework that compares three reuse paradigms: hidden-only, KV-only, and hybrid. Extensive evaluations on Qwen3-8B show that KV-Reuse improves long-range acceptance, although end-to-end speedups remain marginal under current training pipelines. Our analysis identifies two key structural bottlenecks: shallow drafters struggle to estimate target queries accurately, and draft-side KV projections receive sparse gradient signals. These findings suggest that realizing the full potential of KV-aware decoding requires moving beyond TTT toward block-wise training paradigms. By exposing these bottlenecks, KVShot provides a foundational diagnostic testbed and a clear roadmap for designing next-generation inference architectures.

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

↑