arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.09992cs.LGcs.AI
收藏

注意力漂移:自回归推测解码模型学习了什么

Attention Drift: What Autoregressive Speculative Decoding Models Learn

Northwestern University(西北大学);GE Aerospace(通用电气航空航天);University of Waterloo(滑铁库大学)

Doğaç Eldenk, Payal Mohapatra, Yigitcan Comlek, Kaan Oktay, Hongyang Zhang, Stephen Xia

AI总结:

本文研究了自回归推测解码模型中出现的注意力漂移现象,通过改进模型架构,提升了在模板扰动和长上下文任务中的表现。

摘要:

推测解码通过小型模型起草未来token来加速LLM推理,但起草模型在模板扰动和长上下文输入下性能急剧下降。我们发现了一种以前未报告的现象,称为注意力漂移:随着起草模型在推测链中生成后续token,注意力逐渐从提示移动到其最近生成的token。我们观察到这一现象存在于EAGLE3起草者和MTP头中,表明漂移是起草者设计的属性。我们追溯到链步之间的非归一化残差路径:起草者的隐藏状态幅度随着链深度单调增长,其动态与在目标上堆叠额外预归一化Transformer层一致,而非作为独立的自回归预测器。为限制增长,我们提出两种架构改进:在起草者隐藏状态后应用后归一化,并在捕获目标隐藏状态后对每个隐藏状态应用RMSNorm。我们的干预措施在模板扰动下将接受长度提升至当前领先模型EAGLE3的2倍,在长上下文任务中提升1.18倍,在七个标准基准上提升1.10倍。我们的改进还允许更短的训练-测试深度在更长的起草序列上泛化。

英文摘要:

Speculative decoding accelerates LLM inference by drafting future tokens with a small model, but drafter models degrade sharply under template perturbation and long-context inputs. We identify a previously-unreported phenomenon we call \textbf{attention drift}: as the drafter generates successive tokens within a speculation chain, attention progressively moves from the prompt onto its own recently-generated tokens. We observe this across both \emph{EAGLE3} drafters and \emph{MTP heads}, suggesting drift is a property of drafter designs. We trace this to the un-normalized residual path between chain steps: the drafter's hidden state magnitude grows monotonically with chain depth, which exhibits dynamics consistent with additional pre-norm transformer layers stacked on the target rather than as a standalone autoregressive predictor. In order to limit the growth, we propose two architectural changes: Post-norm on the drafter hidden states and per-hidden-state RMSNorm after capturing target hidden states. Our interventions improve acceptance length over the current leading model, pre-norm EAGLE3, by up to $2\times$ under template perturbation, $1.18\times$ on long-context tasks, and $1.10\times$ on seven standard benchmarks spanning multi-turn chat, math, and coding. Our changes also allow shorter train-time-test depths to generalize over longer drafting sequences.

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

↑