跳转至

注意力作为条件反射:经典学习理论对线性Transformer的预测

文章背景与核心概要

尽管Transformer中的注意力机制经常被描述为联想记忆,但仅凭这种直觉很难解释该记忆在特定条件下的具体运作方式。本文并未发明全新的预测框架,而是证明了控制主流线性注意力系列的更新方程与一个世纪以来的动物学习理论中的经典模型在逐项上完全一致:线性注意力实现了赫布邻近性(Hebbian contiguity),DeltaNet实现了Rescorla-Wagner误差校正,而衰减变体(如RetNet)则实现了带有刺激痕迹的邻近性。

这种理论对应关系架起了经典条件反射与现代神经网络行为之间的桥梁,将心理学学习现象转化为对线性Transformers的可检验预测。通过建立精确的闭式等价关系、揭示cue competition(线索竞争)的解离现象、量化容量状态的标度指数,该研究不仅深化了我们对现代序列模型内部机制的理解,也为未来设计具备类脑学习特性的架构提供了坚实的理论支撑。


Summary

While attention in transformers is frequently described as an associative memory, this intuition alone rarely explains how that memory operates under specific conditions. Rather than inventing novel predictive frameworks, this paper demonstrates that the update equations governing major linear-attention families are term-for-term identical to classical models from a century of animal learning theory: * Linear attention implements Hebbian contiguity. * DeltaNet implements Rescorla–Wagner error correction. * Decay variants (e.g., RetNet) implement contiguity with a stimulus trace.

This dictionary bridges classical conditioning with modern neural network behavior, turning psychological learning phenomena into testable predictions regarding linear transformers.

虽然Transformer中的注意力机制经常被描述为联想记忆,但仅凭这种直觉很难解释该记忆在特定条件下的运作方式。本文并未凭空捏造新的预测框架,而是证明了控制主流线性注意力系列的更新方程与一个世纪以来的动物学习理论中的经典模型在逐项上完全一致: * 线性注意力实现了赫布邻近性(Hebbian contiguity)。 * DeltaNet实现了Rescorla–Wagner误差校正。 * 衰减变体(例如 RetNet)实现了带有刺激痕迹的邻近性

这种对应关系架起了经典条件反射与现代神经网络行为之间的桥梁,将心理学中的学习现象转化为对线性Transformer的可检验预测。


Key Contributions & Findings

  • Exact Closed-Form Equivalences: The mapping yields an exact closed-form solution for Kamin blocking, which simulations verify to \(< 10^{-7}\) across five distinct learning rates.
  • Cue Competition Dissociation: Empirical tests show that error-correcting attention exhibits cue competition, whereas contiguity-based attention does not—a dissociation that persists even after training on generic in-context association.
  • Capacity Regimes: A single state exhibits two distinct capacity regimes with measured scaling exponents of 1.22 (faithful retrieval) and 1.89 (identification), aligning with linear and near-quadratic theoretical predictions.
  • Role of Attention Heads: Across the entire head grid, retrieval error is primarily governed by total state size rather than how that state is partitioned across individual heads. This indicates that multiple heads provide raw capacity rather than redundant copies.
  • No Spontaneous Recovery: The paper proves the absence of spontaneous recovery for analyzed single-state recurrences under cue-orthogonal retention trials. Using a never-presented-cue control and probes within the trained positional range, trained models similarly exhibit no recovery.
  • PH-Attention: The author introduces PH-attention—a Pearce–Hall-inspired rule featuring an explicit feature-indexed associability state that produces cue-dependent learning rates absent from standard token-computed gates.
  • 精确的闭式等价关系: 该映射为卡明阻滞效应(Kamin blocking)提供了精确的闭式解,仿真实验在五种不同的学习率下验证了其精度达到 \(< 10^{-7}\) 以下。
  • 线索竞争解离: 实证测试表明,具备误差校正功能的注意力机制表现出线索竞争(cue competition)现象,而基于邻近性的注意力则没有——这种解离现象即使在经过通用上下文联想训练后依然存在。
  • 容量状态(Capacity Regimes): 单一状态表现出两种不同的容量机制,其测得的标度指数分别为 1.22(忠实检索)和 1.89(识别),这与线性及接近平方的理论预测相吻合。
  • 注意力头的作用: 在整个注意力头网格中,检索误差主要由总状态大小决定,而不是由该状态如何在各个注意力头之间分割决定。这表明多个注意力头提供的是原始容量,而非冗余的副本。
  • 无自发恢复: 本文证明了在特征正交的保持试验下,所分析的单状态递归不存在自发恢复现象。通过从未呈现过的线索对照组以及在训练位置范围内的探测,训练后的模型同样表现出没有自发恢复。
  • PH-Attention: 作者引入了 PH-attention——这是一种受 Pearce-Hall 启发而规则,具有显式的特征索引关联度状态,能够产生标准 Token 计算门控所不具备的线索依赖型学习率。