TL;DR
This paper proposes that grokking—the sudden, late-stage drop in test loss long after training loss has plateaued—is driven by a transition from "lazy" to "rich" training dynamics. By analyzing a simple polynomial regression task, the authors show that grokking can be precisely controlled by network scaling and initial task alignment, providing a unified explanation that holds across architectures like Transformers and MLPs without needing weight decay.
What Problem Does This Paper Address?
In deep learning, we usually expect training performance to be a reliable proxy for generalization. Grokking breaks this intuition: a model might achieve near-zero training loss almost immediately but fail to generalize for thousands of additional epochs before suddenly "getting it."
Previous theories suggested that grokking is caused by weight decay (regularization) forcing the model toward simpler, generalizing solutions. However, this paper identifies cases where grokking occurs without weight decay and even when weight norms increase. The authors set out to find a more fundamental mechanism rooted in the fundamental training dynamics of neural networks.
Methods
The authors primarily investigate a "minimal" model of grokking: a two-layer neural network (specifically a committee machine) performing high-dimensional polynomial regression.
They utilize two key theoretical frameworks:
- Lazy vs. Rich Training: "Lazy" training (the Neural Tangent Kernel or NTK regime) occurs when a network behaves like a linear model using fixed initial features. "Rich" training involves active feature learning, where the network adapts its internal representations to the task.
- Loss Decomposition: They mathematically decompose the test loss into three components: variance error, misalignment error (how well features match the target), and power in linear modes (unhelpful linear components for a non-linear task).
To test their hypothesis, they introduce two control parameters:
- $\alpha$ (Laziness/Scale): A factor that scales the network's output. Large $\alpha$ pushes the network into the lazy regime.
- $\epsilon$ (Alignment): A measure of how well the initial NTK matches the target function.
Datasets
The study uses a mix of synthetic and real-world benchmarks:
- Polynomial Regression: Synthetic tasks where the target is a quadratic or higher-degree polynomial of Gaussian inputs.
- Modular Arithmetic: The classic "grokking" task ($a + b \pmod p$) used in original discovery papers.
- MNIST: Standard handwritten digit classification.
- Student-Teacher Networks: Where a student network learns to mimic a fixed teacher network.
- Eigenvector Labels: A novel synthetic setup where labels are chosen as specific eigenvectors of the initial NTK to precisely control task difficulty and alignment.
Key Insights and Ideas
- Grokking as a Regime Transition: The authors argue that grokking happens when a network first tries to solve a task "lazily" using its initial, misaligned features. Because these features are a poor fit, test loss stays high. Eventually, the network transitions to a "rich" regime, learns better features, and generalization suddenly occurs.
- The "Goldilocks" Zone: Grokking requires a specific dataset size. If the dataset is too small, the network never generalizes. If it's too large, the network generalizes immediately. Grokking lives in the intermediate range where generalization is possible but requires significant feature learning.
- Weight Decay is a Proxy, Not a Cause: While weight decay often induces grokking, the authors show it's because weight decay pushes the model out of the lazy regime. They demonstrate grokking in models with zero weight decay where the parameter norm actually increases (see Figure 2).
Key Results
- Controlling Grokking with $\alpha$: By simply tuning the output scale $\alpha$, the authors could make grokking appear or disappear in MLPs and Transformers. Increasing $\alpha$ (making the model "lazier") increases the delay before generalization.
- Alignment Matters: Tasks that are "hard" for the initial kernel (low alignment) exhibit more intense grokking. Interestingly, worse initial alignment can sometimes lead to better final generalization because it forces the network to learn richer features.
- Universality: The "lazy-to-rich" explanation successfully describes grokking in diverse settings, including MNIST classification and modular addition in Transformers (Figure 6).
Limitations and Future Work
- Theoretical Sharpness: The paper provides a conceptual and empirical framework but lacks a "sharp" mathematical proof of the exact time or sample size required for the lazy-to-rich transition.
- Adaptive Optimizers: While the theory holds for vanilla Gradient Descent, the authors note that the specific dynamics of adaptive optimizers like AdamW (commonly used in grokking studies) are not yet fully understood and may further amplify these effects.
- High-Degree Polynomials: While they show the effect persists for higher-degree polynomials, the sample complexity for such tasks grows rapidly, making them harder to study in the grokking regime.
Summary updated