arXiv:2605.15787cs.LGcs.AI2026-05

Transformer延迟泛化源于注意力对关键信息的结构推理滞后。

Grokking as Structural Inference: Transformers Need Bayesian Lottery Tickets

论文配图:Grokking as Structural Inference: Transformers Need Bayesian Lottery Tickets
图 1 · 摘自论文原文
  • 将注意力视为任务依赖图的贝叶斯后验,揭示泛化需满足容量与结构双重条件。
  • 实验显示在算法序列任务上,新方法比彩票券迁移更快实现泛化。
  • 适合研究模型泛化机制、注意力机制或贝叶斯学习的读者。

为何一个已记忆训练集的Transformer要经历数千步训练才开始泛化?现有解释聚焦于范数最小化、特征涌现或稀疏子网的后期发现,但忽略了基于注意力模型的独特约束:一旦注意力丢弃重要标记,任何有限下游计算都无法恢复。本文将注意力形式化为任务依赖图的隐式贝叶斯后验,证明泛化需满足两个可分离条件:一是与范数理论一致的MLP容量黄金法则;二是注意力必须为每个信息性标记分配足够概率质量的新型贝叶斯结构条件。该解耦解释了延迟泛化为结构推理的延迟。训练初期,MLP通过非对齐特征记忆数据,使交叉熵损失趋近零,从而剥夺注意力的结构梯度。权重衰减必须先侵蚀记忆,才能让缺失结构可学习,由此产生已知的反向权重衰减延迟,我们将其推导为结构等待时间。进一步证明,通过基于KL的结构干预可绕过此延迟,获得反向干预强度的缩放规律。算法序列任务上的实验隔离了结构与容量,表明该贝叶斯彩票券性能匹配或优于彩票券迁移。

原文摘要 · Abstract (English)

Why does a Transformer that has memorized its training set wait thousands of steps before it generalizes? Existing accounts locate this delay in norm minimization, feature emergence, or the late discovery of sparse subnetworks. These explanations capture important parts of the transition, but ignore a constraint unique to attention-based models: if attention discards an informative token, no bounded downstream computation can recover it. We formalize attention as an implicit Bayesian posterior over the task dependency graph and prove that generalization requires two separable conditions: a familiar Goldilocks bound on MLP capacity, coinciding with norm-based theories of grokking, and a novel Bayesian structural condition requiring attention to place sufficient mass on every informative token. This decoupling explains delayed generalization as delayed structural inference. Early in training, the MLP memorizes through unaligned features, drives the cross-entropy loss near zero, and thereby starves attention of structural gradient. Weight decay must then erode memorization before the missing graph becomes learnable, yielding the known inverse-weight-decay delay, which we derive as a structural waiting time. We then prove that this explaining-away delay can be bypassed by a KL-based structural intervention, yielding an inverse-intervention-strength scaling law for the grokking time. Experiments on algorithmic sequence tasks isolate structure from capacity and show that this Bayesian ticket matches or outperforms lottery-ticket transfer.

Transformer贝叶斯推理泛化机制注意力

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