Skip to main content
QUICK REVIEW

[论文解读] Transformers converge to invariant algorithmic cores

Joshua S. Schiffman|arXiv (Cornell University)|Feb 26, 2026
Natural Language Processing Techniques被引用 0
一句话总结

论文提取出对 transformer 任务表现既必要又充分的低维算法核心,显示核心在独立运行中收敛,并在 GPT-2 规模下展示出单一维的主谓一致核心,揭示不变的计算结构。

ABSTRACT

Large language models exhibit sophisticated capabilities, yet understanding how they work internally remains a central challenge. A fundamental obstacle is that training selects for behavior, not circuitry, so many weight configurations can implement the same function. Which internal structures reflect the computation, and which are accidents of a particular training run? This work extracts algorithmic cores: compact subspaces necessary and sufficient for task performance. Independently trained transformers learn different weights but converge to the same cores. Markov-chain transformers embed 3D cores in nearly orthogonal subspaces yet recover identical transition spectra. Modular-addition transformers discover compact cyclic operators at grokking that later inflate, yielding a predictive model of the memorization-to-generalization transition. GPT-2 language models govern subject-verb agreement through a single axis that, when flipped, inverts grammatical number throughout generation across scales. These results reveal low-dimensional invariants that persist across training runs and scales, suggesting that transformer computations are organized around compact, shared algorithmic structures. Mechanistic interpretability could benefit from targeting such invariants -- the computational essence -- rather than implementation-specific details.

研究动机与目标

  • 提出训练目标影响内部电路而非身份 identifiability 的问题的动机。
  • 开发一种提取对任务性能既必要又充分的低维算法核心子空间的方法。
  • 证明独立训练的变换器尽管内部权重不同,也会收敛到相似的核心。
  • 将核心提取应用于逐步复杂化的设置,包括马尔可夫链、模组加法,以及 GPT-2 语言模型。
  • 展示一个普遍的一维一致性核心支配跨 GPT-2 规模的主谓数的一致性。

提出的方法

  • 将算法核心定义为对任务性能既必要又充分的低维子空间,通过消融实验来确认。
  • 使用 ACE(Algorithmic Core Extraction,算法核心提取)从模型隐藏状态中提取核心,并测试其充分性/必要性。
  • 在核心坐标中拟合线性算子以恢复任务动力学,并将谱与真实动力学进行比较。
  • 在独立训练的模型之间进行几何和统计对齐(投影算子重叠、主角角、CCA)以比较核心。
  • 对于模组加法,分析 grokking 过程中的核心形成,并在权重衰减下追踪核心膨胀。
  • 将核心提取应用于 GPT-2 Small/Medium/Large,识别一个一维的主谓一致核心,并测试因果干预(必要性、充分性、翻转)。
Figure 1 : Transformers trained on the same Markov task converge to a low-dimensional, causal algorithmic core. Three one-layer transformer language models with identical architectures ( $d_{\rm model}=64$ , $d_{\rm ff}=256$ , $|V|=4$ ) were initialized with independent random seeds and trained on t
Figure 1 : Transformers trained on the same Markov task converge to a low-dimensional, causal algorithmic core. Three one-layer transformer language models with identical architectures ( $d_{\rm model}=64$ , $d_{\rm ff}=256$ , $|V|=4$ ) were initialized with independent random seeds and trained on t

实验结果

研究问题

  • RQ1变换器中是否存在对任务性能既必要又充分的低维算法核心?
  • RQ2这样的核心是否在不同权重的独立训练模型之间共享?
  • RQ3核心内部的动力学是否可以机械地表征(如马尔可夫性或旋转算子)?
  • RQ4是否存在一个普遍核心,用于跨 GPT-2 规模的语言计算(如主谓一致)?

主要发现

  • 在同一马尔可夫任务上独立训练的一层变换器收敛到一个三维核心,该核心对性能既必要又充分。
  • 来自独立模型的核心几何上不对齐但统计上对齐,核心维度之间的典型相关几乎达到单位。
  • 在核心坐标内拟合线性动力学可Recover 真正的马尔可夫谱,特征值与马尔可夫转移矩阵的特征值相匹配(排除 Perron–Frobenius 特征值)。
  • 对于模组加法,核心在 grokking 时形成,揭示一个旋转机制;在持续权重衰减下,由于分布式的冗余模态,核心膨胀。
  • 在 GPT-2 的模型(Small、Medium、Large)中,存在一个单一的一维一致性核心控制主谓一致,扰动或翻转该核心可在开放式生成中可靠地调制或颠倒语法数。
  • 跨越 GPT-2 规模的核心坐标对齐良好,指示在模型之间存在普遍、共享的语法数编码。
Figure 2 : Modular addition cores form at grokking and are defined by automatically recoverable rotational operations. Three two-layer transformers with equivalent architectures ( $d_{\rm model}=128$ , $d_{\rm ff}=512$ ) were initialized with independent random seeds and trained for $2\times 10^{3}$
Figure 2 : Modular addition cores form at grokking and are defined by automatically recoverable rotational operations. Three two-layer transformers with equivalent architectures ( $d_{\rm model}=128$ , $d_{\rm ff}=512$ ) were initialized with independent random seeds and trained for $2\times 10^{3}$

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。