让模型学会遗忘注意力,用记忆固化提升效率
Learning to Forget Attention: Memory Consolidation for Adaptive Compute Reduction
- 基于生物记忆机制,将短期记忆逐步转为长期参数化记忆
- 训练中注意力使用量下降37.8倍,1.6%计算量达100%准确率
- 适合需要高效推理的长序列建模任务,如语言生成
混合状态空间模型与注意力机制的架构在效率与性能间取得了良好平衡,但现有方法或均匀使用注意力,或学习静态稀疏模式。本文发现:在GPT-2模型中,88%的注意力操作获取的信息可由隐藏状态预测,且该冗余在训练中不减少。受此启发,提出 extbf{ ous{}}(基于记忆固化的自适应记忆路由),一种仿生记忆机制,将瞬时检索逐步提炼为参数化语义记忆。不同于以往稀疏注意力方法, extbf{ ous{}}在训练过程中呈现注意力使用量下降趋势,在约3000步时出现显著相变,实现37.8倍的计算压缩。理论证明:无记忆固化机制时,含重复模式的任务需Ω(f·n)注意力,而静态路由无法避免。在新提出的SRCD基准上, extbf{ ous{}}在仅1.6%注意力计算下达到100%检索准确率(基线为68%),且固化模式可迁移至未见任务,实现48–52%注意力减少而无需重训练。惊人的是,学习到的记忆固化动态与认知心理学中人类从情景记忆到语义记忆的转变曲线高度吻合(γ=0.43,人类γ≈0.4–0.5)。代码与基准已公开。
原文摘要 · Abstract (English)
Hybrid architectures combining state-space models with attention have achieved strong efficiency-quality tradeoffs, yet existing approaches either apply attention uniformly or learn static sparse patterns. This misses a key opportunity: \emph{attention demand should decrease over time as recurring patterns become familiar}. We present a surprising finding from analyzing GPT-2 models: \textbf{88\%} of attention operations retrieve information already predictable from the model's hidden state, and this redundancy does \emph{not} decrease during training. Motivated by this observation, we introduce \textbf{\ours{}} (\textbf{C}onsolidation-based \textbf{R}outing for \textbf{A}daptive \textbf{M}emory), a biologically inspired memory consolidation mechanism that gradually distills episodic retrievals into parametric semantic memory. Unlike prior sparse attention methods, \ours{} exhibits \emph{decreasing attention utilization} over training, achieving a \textbf{37.8$\times$} reduction through a sharp phase transition at approximately 3K steps. We prove that this capability is \emph{impossible} without consolidation: any static routing scheme requires $Ω(f \cdot n)$ attention for tasks with recurring patterns of frequency $f$. On our proposed SRCD benchmark, \ours{} achieves \textbf{100\% retrieval accuracy} at 1.6\% attention compute (vs.\ 68\% for baselines), and consolidated patterns transfer to unseen tasks with \textbf{48--52\%} attention reduction without retraining. Remarkably, the learned consolidation dynamics quantitatively match human episodic-to-semantic memory transition curves from cognitive psychology ($γ= 0.43$ vs.\ $γ_{\text{human}} \approx 0.4$--$0.5$). Code and benchmarks are available at [anonymized].
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。