arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.20441cs.LGcs.AIcs.NE
收藏

Transformer在Grokking中的权重衰减区域:廉价的在线诊断

Weight Decay Regimes in Grokking Transformers: Cheap Online Diagnostics

Independent Researcher(独立研究者)

Lucky Verma

AI总结:

研究探讨了在模运算中训练的Transformer模型在记忆、泛化和崩溃之间的尖锐转变,并通过权重衰减作为标量经验控制参数来分析这些区域,引入了两种廉价的在线诊断方法,通过注意力激活来跟踪训练动态,并在较低计算成本下补充损失景观诊断。

摘要:

在模运算中训练的Transformer模型表现出记忆、泛化和崩溃之间的尖锐转变。我们证明权重衰减作为这些区域的标量经验控制参数,并引入了两种廉价的在线诊断方法,即平均成对注意力头余弦相似度和熵标准差,这些方法仅通过注意力激活来跟踪训练动态,并在较低计算成本下补充损失景观诊断。在十一种实验条件和三种模型规模(0.82M到85M参数)中,权重衰减轴将记忆、发展性Grokking和崩溃分开。一个接近临界点的逻辑拟合将记忆到发展性的边界定位在λ_c=0.0158(95%置信区间[0.0109, 0.0200],N=210);一个幂律拟合给出经验指数ν=0.757(置信区间[0.725, 0.799])。参考指数ν=1/2和3D伊辛ν≈0.63在我们四格网格下位于此经验置信区间之外,因此我们报告ν为经验值,并将临界点类别的识别推迟到更密集的有限大小缩放工作。一个与地平线匹配的多任务复制(n=280,四个模运算)保留了权重衰减控制模式;在λ=0.05时进行的配对注意力头重新初始化实验改变了阶段2的振幅(Cohen的d=-1.190,n=10,p_t=4.5×10^-3),而匹配的权重范数裁剪则没有。三个跨架构探测(4L MLP,4L LSTM和4L Mamba;每个n=70)在小Transformer注意力模型的模运算中复制了权重衰减控制的转变,具有架构特定的λ_c值。主要诊断主张限于小Transformer注意力模型的模运算;非注意力实验是范围探测,架构广泛、语言模型和临界点类别的主张超出范围。

英文摘要:

Transformers trained on modular arithmetic exhibit sharp transitions between memorization, generalization, and collapse. We show that weight decay acts as a scalar empirical control parameter for these regimes, and introduce two cheap online diagnostics, mean pairwise attention-head cosine similarity and entropy standard deviation, that track training dynamics from attention activations alone and complement loss-landscape diagnostics at lower compute cost. Across eleven experimental conditions and three model scales (0.82M to 85M parameters), the weight-decay axis separates memorization, developmental grokking, and collapse. A near-transition logistic fit localizes the memorization-to-developmental boundary at $λ_c=0.0158$ (95% CI [0.0109, 0.0200], N=210); a power-law fit gives an empirical exponent $ν=0.757$ (CI [0.725, 0.799]). Reference exponents $ν=1/2$ and 3D Ising $ν\approx 0.63$ lie outside this empirical CI under our four-bin grid, so we report $ν$ as empirical and defer universality-class identification to denser finite-size-scaling work. A horizon-matched multi-task replication (n=280, four modular operations) preserves the weight-decay control pattern; a paired attention-head re-initialization experiment at $λ=0.05$ changes Phase-2 amplitude (Cohen's $d=-1.190$, n=10, $p_t=4.5 \times 10^{-3}$), while matched weight-norm clipping does not. Three cross-architecture probes (4L MLP, 4L LSTM, and 4L Mamba; each n=70) replicate the weight-decay-controlled transition with architecture-specific $λ_c$ values. Main diagnostic claims are scoped to modular arithmetic in small transformer attention models; the non-attention experiments are scope probes, and architecture-wide, language-model, and universality-class claims are out of scope.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑