Quantifying the Memorization-to-Generalization Transition: Scaling Laws and Phase Structure in Grokking

Anish KatariaFoGen @ ICML 2026

TL;DR

Researchers have established the first quantitative scaling law for "grokking"—the mysterious phenomenon where neural networks suddenly generalize long after perfectly memorizing their training data. The study reveals that data coverage is the primary driver of this transition, outperforming model capacity by nearly an order of magnitude: doubling your data accelerates generalization by ~4x, while doubling model width only provides a ~1.2x boost.

What Problem Does This Paper Address?

In the world of deep learning, "grokking" is a fascinating puzzle. A model trained on a task like modular arithmetic will initially reach 100% training accuracy by simply memorizing the answers (the "memorization regime"). Then, often thousands of steps later, it suddenly "clicks" and learns the underlying logic, achieving 100% test accuracy (the "generalization regime").

While we have mechanistic theories about how this happens (e.g., Fourier circuits replacing lookup tables), we haven't had a way to predict when it happens. This paper addresses the lack of a quantitative framework to predict the timing of this transition ($T_{\text{grok}}$) based on hyperparameters like model width, data fraction, learning rate, and weight decay.

Methods

The authors conducted a massive hyperparameter sweep, training 384 different configurations of two-hidden-layer Multi-Layer Perceptrons (MLPs). They varied:

  • Model Width ($H$): 128 to 512 neurons.
  • Data Fraction ($D$): 30% to 97% of the possible dataset.
  • Learning Rate ($\eta$): 0.001 to 0.03.
  • Weight Decay ($\lambda$): 0.1 to 3.0.

By fitting a log-linear model to the results, they derived a power-law scaling relation for the time it takes to grok. They also analyzed weight norm trajectories to see if the internal "compression" of the network could serve as a proxy for its progress toward generalization.

Datasets

The study uses two canonical grokking benchmarks:

  1. Modular Addition (mod 113): A dataset of 12,769 possible equations.
  2. Modular Division (mod 97): A dataset of 9,312 possible equations.

These datasets are ideal because the "ground truth" generalizing solution is known to be a discrete Fourier transform, making it easy to distinguish between rote memorization and true algorithmic understanding.

Key Insights and Ideas

  • The Exponent Hierarchy: The most striking finding is that data complexity ($D^{-2.04}$) dominates model capacity ($H^{-0.27}$). In practical terms, if you want a model to grok faster, adding more data is a much more powerful lever than making the model wider.
  • The Phase Boundary: Grokking isn't just a matter of waiting long enough. The authors discovered a "sharp phase boundary" at a weight decay of $\lambda \approx 1.0$. Below this threshold, the model often stays stuck in the memorization "basin" forever. Above it, weight decay actively destabilizes the memorization solution, forcing the network to find the simpler, lower-norm generalizing solution.
  • Data and Regularization are Substitutable: The researchers found a significant interaction between data and weight decay. When data is abundant, the model needs less explicit regularization to generalize. Both act as forces that destabilize high-norm, "messy" memorization in favor of "clean" logic.
  • Weight Norm as a "Regime Indicator": You can tell how close a model is to grokking by looking at its weight norm. The transition typically occurs when the weight norm compresses to about 42% of its value at the moment of perfect memorization.

Key Results

The core contribution is the scaling law: $$T_{\text{grok}} \propto H^{-0.27} D^{-2.04} \eta^{-0.50} \lambda^{-0.64}$$

  • Predictive Power: This model achieved an $R^2$ of 0.821, meaning it explains over 80% of the variance in grokking time across hundreds of runs.
  • Efficiency Trade-offs: While wider models grok in fewer steps, they are actually less compute-efficient (FLOP-efficient) because the cost per step grows faster than the speedup in training time.
  • The "Grokking Gap": The delay between memorization and generalization can span from 100 steps to over 100,000 steps, but this gap shrinks predictably as weight decay increases.

Limitations and Future Work

  • Architecture Scope: The study is limited to MLPs on modular arithmetic. While these are the standard "lab rats" for grokking research, it remains to be seen if the $D^{-2}$ scaling law holds for Transformers or natural language tasks.
  • Width Levels: The width exponent was estimated from only three discrete levels (128, 256, 512), which the authors acknowledge is a relatively small sample for that specific variable.
  • Theoretical Derivation: The phase boundary at $\lambda \approx 1.0$ is an empirical observation. A major "open question" is whether this boundary can be derived from first principles using tools like PAC-Bayes theory or Minimum Description Length (MDL) arguments.
  • Generative Models: The authors suggest their methodology could be a template for studying memorization in diffusion models and LLMs, where "replication" of training data is a major concern.

Summary updated

BibTeX
@inproceedings{kataria2026quantifying,
  author = {Anish Kataria},
  title = {{Quantifying the Memorization-to-Generalization Transition: Scaling Laws and Phase Structure in Grokking}},
  booktitle = {FoGen @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=Qh29Wjs8oo},
}
Figure