改进线性注意力的残差学习机制,提升长距离依赖建模能力。
Enhancing Linear Attention with Residual Learning
- 引入显式残差拟合机制,通过递归状态累积误差并修正预测。
- 在语言建模与召回任务中显著优于现有线性注意力方法。
- 保持线性复杂度,适合需要高效长序列处理的场景。
线性注意力提供了自注意力的线性时间替代方案,但通常难以捕捉长距离模式。我们从预测-校正视角重新审视线性注意力,发现主流变体可表示为历史预测与单标记校正的组合,存在表达力瓶颈。为此,提出残差线性注意力(RLA),引入显式残差拟合机制,维护一个辅助递归状态,持续学习累积残差误差并修正基础预测。进一步设计了基于增量规则的RDN版本,结合自适应门控与残差裁剪以增强校正控制与稳定性。实现采用高度优化的线性注意力核,保持线性时间与内存开销。在语言建模与高召回需求评估中,RLA与RDN持续超越基线及其他现代线性注意力方法,在缩小与标准Transformer差距的同时,维持线性扩展性。
原文摘要 · Abstract (English)
Linear attention offers a linear-time alternative to self-attention but often struggles to capture long-range patterns. We revisit linear attention through a prediction-correction lens and show that prevalent variants can be written as a combination of a historical prediction and a single-token correction, which creates an expressivity bottleneck. To address this bottleneck, we introduce Residual Linear Attention (RLA), a framework that equips linear attention with an explicit residual-fitting mechanism. RLA maintains an auxiliary recurrent state that learns to accumulate residual errors over time and correct the base prediction. We further instantiate a delta-rule version, Residual Delta Net (RDN), incorporating adaptive gating and residual clipping for enhanced correction control and stability. Our implementation leverages highly optimized linear attention kernels and preserves linear time and memory. Across language modeling and recall-intensive evaluations, RLA and RDN consistently outperform their respective baselines and other modern linear-attention methods, narrowing the gap to standard Transformers while retaining linear scaling.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。