arXiv:2603.17019cs.LG2026-03

小规模Transformer能学会训练中从未出现的逻辑规则。

Transformers Can Learn Rules They've Never Seen: Proof of Computation Beyond Interpolation

  • 通过移除XOR规则中的一个真值表项,强制模型靠计算而非类比推断。
  • 两层Transformer成功恢复缺失规则,且电路提取显示其精确计算XOR。
  • 适用于研究模型推理能力、规则学习机制的研究者。

我们在一个受控环境中测试Transformer是否能学习训练中未见过的规则,而非仅依赖相似性进行插值预测。实验中,让小型Transformer预测基于纯XOR更新规则的元胞自动机演化过程,并从所有直接监督信号中移除真值表的一项。该缺失项的输出从未被展示,仅通过后续时间步错误预测间接体现。由于XOR奇偶性在任一输入位翻转时改变,缺失项的每一位邻居都带有相反标签,因此基于相似性的预测方法(如最近邻、核方法、高斯过程)必然得出错误答案。然而,两层Transformer仍能正确恢复缺失项,电路提取证实其精确实现XOR运算。消融实验表明恢复依赖于多步预测中梯度信号的传播;另一项独立符号算子链任务也展现出相同能力。结合可构造性证明:标准Transformer块可实现精确局部布尔规则,这些结果为Transformer能学习并显式表达未在训练中直接观察到的规则提供了存在性证明。这排除了‘仅能插值’这一最强形式的架构解释,即模型无法原则上发现和传递未见规则,但未说明大规模语言训练中此类行为何时出现。

原文摘要 · Abstract (English)

A central question in the debate over large language models is whether transformers can learn rules they have never seen, or whether they can only interpolate: predict new cases from their similarity to training examples. We test this in a controlled setting where interpolation provably fails, so success can only come from computation beyond interpolation. We train small transformers to predict the rollout of a cellular automaton whose update rule is pure XOR, and remove one entry of the rule's truth table from all direct supervision. The missing entry's output is never shown to the model; its only trace is indirect, as wrong values corrupt visible predictions at later timesteps. Because XOR parity flips whenever one input bit is changed, every one-bit neighbour of the missing entry carries the opposite label, and we prove that similarity-based predictors, including nearest-neighbour, kernel, and Gaussian-process methods, are forced to the wrong answer. A two-layer transformer can nevertheless recover the missing entry, and circuit extraction confirms it computes XOR exactly. Ablations show the recovery depends on gradient signal propagating through multi-step prediction, and a second, structurally unrelated benchmark on symbolic operator chains exhibits the same capacity under ordinary autoregressive training. Together with a constructive proof that a standard transformer block can implement exact local Boolean rules, these results provide an existence proof that transformers can learn rule structure not directly observed in training and express it explicitly. This rules out the strongest architectural form of the interpolation-only account, the claim that transformers cannot in principle discover and communicate unseen rules, while leaving open when such behaviour arises in large-scale language training.

Transformer规则学习计算能力逻辑推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。