cs.LGApr 28, 2026

Feature Repulsion and Spectral Lock-in: An Empirical Study of Two-Layer Network Grokking

Authors: Yongzhong Xu

Abstract

Tian (2025) proves a repulsion theorem (Theorem 6) for the matrix B=(F~F~+ηI)1B = (\widetilde{F}^\top \widetilde{F} + ηI)^{-1} during the interactive feature-learning stage of grokking: similar features have negative off-diagonal entries BjB_{j\ell}, producing an effective repulsive force that drives them apart. However, the theorem does not specify when this mechanism becomes empirically observable, nor whether it leaves a measurable spectral signature in the parameter updates. We test this directly on Tian's modular addition setup (M=71M = 71, K=2048K = 2048, MSE loss) and observe a clear structure-mechanism dissociation. The predicted sign rule holds robustly on the top-200 most-similar feature pairs across activations (empirical sign-match rising from 0.865 to 0.985 on σ=x2σ= x^2 across 5 seeds, and saturating at 1.000 on σ=ReLUσ= \operatorname{ReLU}). However, the spectral signature in the parameter updates is strongly activation-dependent. With σ=x2σ= x^2, a simple slope detector on the rolling eigengap σ2/σ3σ_2 / σ_3 of ΔWΔW fires in 15/15 grokking seeds at epoch 174 (IQR [173,174]) and in 0/15 non-grokking controls, with 229×\times late-stage magnitude separation; the spectrum is rank-2. In contrast, with σ=ReLUσ= \operatorname{ReLU}, the detector never fires and the spectrum remains effectively rank-1. This dissociation aligns with Tian's Theorem 5 distinction between focused (power-law) and spreading (ReLU) memorization: while the sign structure of BB depends only on F~F~\widetilde{F}^\top \widetilde{F}, how feature repulsion translates into weight updates critically depends on the activation derivative σσ'.

Explore similar work

May 7, 2026cs.LG

Topological Signatures of Grokking

We study the grokking phenomenon through the lens of topology. Using persistent homology on point clouds derived from the embedding matrices of a range of models trained on modular arithmetic with varying primes, we identify a clear and consistent topological signature of grokking: a sharp increase in both the maximum and total persistence of first homology (H1H_1). Persistence diagrams reveal the emergence of a dominant long-lived topological feature together with increasingly structured secondary features, reflecting the underlying cyclic structure of the task. Compared to existing spectral and geometric diagnostics -- specifically, Fourier analysis and local intrinsic dimension -- persistent homology provides a unified geometric and topological characterization of representation learning, capturing both local and global multi-scale structure. Ablations across data regimes and control settings show that these topological transitions are tied to generalization rather than memorization. Our results suggest that persistent homology offers a principled and interpretable framework for analyzing how neural networks internalize latent structure during training.
Yifan Tang, Qiquan Wang, Inés García-Redondo +1
May 18, 2026stat.ML

Feature Learning in Linear-Width Two-Layer Networks: Two vs. One Step of Gradient Descent

We study feature learning in two-layer neural networks within the linear-width regime, where the number of hidden neurons, sample size, and input dimension scale proportionally. While recent work has analyzed feature learning via a single step of gradient descent on the first layer weights in this regime, such one-step update schemes are fundamentally limited: the update to the weights is approximately rank-one, captures only a single direction, and requires the target function to have an information exponent of one. In this paper, we go beyond one-step updates to provide a full characterization of the features learned during the \textit{second step} of gradient descent with step-sizes η1Nα1η_1\asymp N^{α_1} and η2Nα2η_2 \asymp N^{α_2} for α1,α2[0,0.5)α_1, α_2 \in [0,0.5), where NN is the number of hidden neurons. We derive a spectral characterization of the updated weights, demonstrating they behave as a spiked random matrix with multiple outliers, each corresponding to a learned direction. We show that the number of the outliers is determined by the parameters α1,α2α_1, α_2 through α21/2α1\lfloor \frac{α_2}{1/2 - α_1} \rfloor. Furthermore, by analyzing the alignment between the learned directions and the target function, we identify a gap between training with independent versus reused batches. While independent batches restrict learning to directions with an information exponent of one, batch reuse enables the second update to capture directions even when the information exponent exceeds one, provided that α1,α2α_1, α_2 are chosen properly. This shows that the benefits of batch reuse, previously observed in narrow-width regimes, persist in the linear-width limit as well. By characterizing these early-phase evolutions, our work proposes a tractable framework for studying optimization and feature learning phenomenology in modern overparameterized networks.
Behrad Moniri, Hamed Hassani
Jul 27, 2026cs.AI

Grokking on the Weight-Decay Clock: A Rate Hierarchy from Softly Broken Symmetries

Delayed generalization, or grokking, remains poorly understood despite extensive empirical study. We identify an exactly solvable late-time relaxation mechanism for grokking in linear models trained with full-batch heavy-ball optimization and weight decay, together with a locally quadratic extension to nonlinear neural networks. Our analysis reveals a distinguished population-active component of the empirical null space, which we call the grokking subspace. Along this subspace, the training predictions remain unchanged, leaving weight decay as the sole restoring force and giving rise to a slow dissipative relaxation governed by an exact discrete-time and continuous-time law. We show that only this subspace contributes to the slow asymptotic decay of the population risk and derive explicit iteration-scale predictions for the grokking time, recovering the familiar (1β)/(ηλ)(1-β)/(ηλ) scaling in the weak-regularization regime. The theory further predicts distinct effects of optimizer choice, distinguishing coupled L2L_2 regularization from decoupled weight decay, and yields causal predictions for interventions that modify the grokking component. We verify all theoretical identities without fitted parameters in a synthetic model where every subspace and relaxation rate is computable in closed form. We further observe genuine delayed generalization in modular addition, where the measured delay follows the predicted scaling and the late-time relaxation agrees closely with the theoretical clock.
Taeyoung Kim