Introduction: The Mystery of Delayed Generalization
Grokking is a striking phenomenon in deep learning where a model, after long periods of near-perfect training accuracy but zero test accuracy, suddenly "snaps" into a state of perfect generalization. First observed in modular arithmetic tasks, this behavior challenged standard intuitions about generalization, which usually suggest a more gradual improvement. This paper provides a rigorous theoretical foundation for grokking, attributing it to a transition between two distinct implicit biases during training.
The Mechanism: Kernel vs. Rich Regimes
The authors analyze homogeneous neural networks trained with large initialization scales ($\alpha$) and small weight decay ($\lambda$). They identify a "dichotomy" in the training trajectory:
- The Kernel Regime (Early Phase): With large initialization, the network initially behaves like a linearized model (Neural Tangent Kernel). The implicit bias here often leads to memorization or overfitting, especially if the data structure doesn't align well with the kernel's bias.
- The Rich Regime (Late Phase): As weight decay gradually reduces parameter norms, the model escapes the linearized regime. The implicit bias shifts toward finding min-norm or max-margin solutions, which often correspond to the true underlying structure of the data (e.g., low-rank or sparse features).
The transition occurs when the influence of the initial weights decays sufficiently, a point predictable by the formula $\approx \frac{1}{\lambda} \log \alpha$.
Grokking and "Misgrokking"
The paper introduces a critical insight: grokking is essentially a "bias mismatch" problem. It occurs when the early-phase (kernel) bias is poor for generalization, but the late-phase (rich) bias is excellent.
Interestingly, the authors also identify a reverse phenomenon termed "misgrokking." If the kernel regime generalizes well but the rich regime does not, the model may start with high test accuracy and then suddenly lose it as training progresses, reverting to the poor generalization of the late-phase bias.
Key Results and Empirical Validation
The study provides the first rigorous mathematical proof of grokking in a neural network setting. By analyzing gradient flow, the authors quantify the timing of the transition and validate their findings across several benchmarks:
- Modular Addition: The classic grokking task.
- Sparse Linear Classification: Demonstrating bias towards sparsity.
- Low-rank Matrix Completion: Showing how the model discovers low-rank structures.
Experiments confirm that increasing initialization scale or decreasing weight decay pushes the grokking transition further out in time, exactly as predicted by their quantitative theory.
Conclusion and Future Work
This work demystifies grokking by framing it as a predictable transition between implicit biases. While it focuses on initialization and weight decay, the authors note that other factors like optimizer choice (e.g., Adam) or non-smooth activations (ReLU) warrant further investigation. The ultimate goal remains finding practical ways to bypass this delay and achieve "instant" generalization.
Summary updated