To Grok Grokking: Provable Grokking in Ridge Regression
Mingyue Xu, Gal Vardi, Itay Safran
TL;DR
This work studies grokking, the delayed emergence of generalization after overfitting, in a classical ridge regression setting and proves an end-to-end grokking guarantee for over-parameterized linear models trained with gradient descent and weight decay. It provides explicit bounds on the grokking time in terms of hyperparameters such as the sample size $n$, feature dimension $m$, learn-rate $\eta$, decay $\lambda$, and initialization $\nu$, and shows how hyperparameter tuning can amplify or eliminate the delay. The authors validate the theory with experiments on linear/ridge and non-linear networks, including random-feature and two-layer ReLU architectures, finding qualitative and quantitative alignment with the predictions. The results suggest grokking arises from training conditions rather than fundamental architectural limitations, implying grokking can be mitigated without major model changes.
Abstract
We study grokking, the onset of generalization long after overfitting, in a classical ridge regression setting. We prove end-to-end grokking results for learning over-parameterized linear regression models using gradient descent with weight decay. Specifically, we prove that the following stages occur: (i) the model overfits the training data early during training; (ii) poor generalization persists long after overfitting has manifested; and (iii) the generalization error eventually becomes arbitrarily small. Moreover, we show, both theoretically and empirically, that grokking can be amplified or eliminated in a principled manner through proper hyperparameter tuning. To the best of our knowledge, these are the first rigorous quantitative bounds on the generalization delay (which we refer to as the "grokking time") in terms of training hyperparameters. Lastly, going beyond the linear setting, we empirically demonstrate that our quantitative bounds also capture the behavior of grokking on non-linear neural networks. Our results suggest that grokking is not an inherent failure mode of deep learning, but rather a consequence of specific training conditions, and thus does not require fundamental changes to the model architecture or learning algorithm to avoid.
