跳到正文
arXiv cs.AI· Anand Swaroop·· 3 天前AI 评分31

Grokking 前潜藏算法结构:ReLU MLP 模运算的机制研究

Latent Algorithmic Structure Precedes Grokking: A Mechanistic Study of ReLU MLPs on Modular Arithmetic

AI 导读

研究发现 ReLU MLP 在模加法任务中学习到的是近二值方波输入权重,中间值权重仅出现在符号变化边界附近,输出权重的傅里叶相位满足 φ_out = φ_a + φ_b 关系,该关系在噪声数据上训练、模型未能 grok 时依然成立。

正文 · 原文

View PDF HTML (experimental)

Abstract:Grokking-the phenomenon where validation accuracy of neural networks on modular addition of two integers rises long after training data has been memorized-has been characterized in previous works as producing sinusoidal input weight distributions in transformers and multi-layer perceptrons (MLPs). We find empirically that ReLU MLPs in our experimental setting instead learn near-binary square wave input weights, where intermediate-valued weights appear exclusively near sign-change boundaries, alongside output weight distributions whose dominant Fourier phases satisfy a phase-sum relation $\phi_{\mathrm{out}} = \phi_a + \phi_b$; this relation holds even when the model is trained on noisy data and fails to grok. We extract the frequency and phase of each neuron's weights via DFT and construct an idealized MLP: Input weights are replaced by perfect binary square waves and output weights by cosines, both parametrized by the frequencies, phases, and amplitudes extracted from the dominant Fourier components of the real model weights. This idealized model achieves 95.5% accuracy when the frequencies and phases are extracted from the weights of a model trained on noisy data that itself achieves only 0.23% accuracy. This suggests that grokking does not discover the correct algorithm, but rather sharpens an algorithm substantially encoded during memorization, progressively binarizing the input weights into cleaner square waves and aligning the output weights, until generalization becomes possible.
Comments: 9 pages, 5 figures
Subjects: Machine Learning (cs.LG); Artificial Intelligence (cs.AI)
Cite as: arXiv:2603.23784 [cs.LG]
  (or arXiv:2603.23784v1 [cs.LG] for this version)
  https://doi.org/10.48550/arXiv.2603.23784

arXiv-issued DOI via DataCite

Submission history

From: Anand Swaroop [view email]
[v1] Tue, 24 Mar 2026 23:36:26 UTC (123 KB)

来源:arXiv cs.AI · arxiv.org