Manuscript Offprint
arXiv:2609.10657Quantifying the Memorization-to-Generalization Transition: Scaling Laws and Phase Structure in Grokking
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Neural networks trained past memorization frequently undergo a delayed transition to generalization, a phenomenon known as grokking. Despite theoretical progress on why this transition occurs, the quantitative structure of when it occurs in hyperparameter space remains uncharacterized. We map the memorization-to-generalization boundary across 384 configurations of two-hidden-layer MLPs on modular arithmetic, fitting a power-law scaling relation for generalization onset time: . The exponent hierarchy reveals that data complexity () is the dominant driver of regime transition, not model capacity (): doubling data accelerates generalization by , while doubling width yields only . A sharp phase boundary at weight decay separates grokking from non-grokking configurations, and weight norm trajectories show monotonic compression during the transition, consistent with implicit regularization selecting low-complexity solutions. These results provide a quantitative foundation for predicting and controlling regime transitions in overparameterized networks.
1. Introduction
When do overparameterized neural networks transition from memorizing their training data to genuinely generalizing? This question sits at the center of modern deep learning theory. The double descent phenomenon (Belkin et al., 2019; Nakkiran et al., 2020) shows that generalization can improve beyond the interpolation threshold, and the lazy-to-rich transition (Woodworth et al., 2020; Chizat et al., 2019) identifies feature learning as the mechanism that separates kernel-regime memorization from structured generalization. Yet these frameworks characterize the transition qualitatively; they do not predict when, in training time, a given configuration will cross from one regime to the other.
Grokking (Power et al., 2022) provides a clean experimental window into this question. Networks trained on modular arithmetic first memorize the training set perfectly, then, after continued training with weight decay, abruptly generalize. The delay between memorization and generalization can span orders of magnitude depending on hyperparameters. Mechanistic studies have identified what happens during this transition: Fourier-feature circuits replace memorization lookup tables (Nanda et al., 2023), competing subnetworks resolve in favor of sparse generalizing solutions (Merrill et al., 2023), and weight norms compress toward low-complexity basins (Liu et al., 2023).
What is missing is a quantitative scaling theory: which hyperparameters govern the transition time, in what proportion, and does a phase boundary exist in hyperparameter space? We address this with a 384-configuration sweep, fitting a power-law scaling law for generalization onset time .
-
A sharp phase boundary at in -space, below which generalization is structurally suppressed regardless of training duration.
-
Weight norm dynamics showing monotonic compression (median ratio ) as a measurable proxy for regime state.
Princeton University, Princeton, NJ, USA. Correspondence to: Anish Kataria ak8686@princeton.edu.
The central finding overturns a natural intuition: it is data coverage and regularization strength, not model capacity, that primarily control when networks escape the memorizing regime.
Proceedings of the International Conference on Machine Learning, Seoul, South Korea. PMLR 306, 2026. Copyright 2026 by the author(s).
2. Experimental Setup
Tasks. We study addition mod 113 ( examples) and division mod 97 ( examples), canonical grokking benchmarks (Power et al., 2022) where the ground-truth generalizing solution (discrete Fourier transform) is known (Nanda et al., 2023).
Architecture. A two-hidden-layer MLP with learned embeddings: , where , is ReLU, and (100K–960K parameters).
Hyperparameter sweep. We vary data fraction , learning rate , and weight decay , yielding configurations. All models use AdamW (, ), full-batch training, up to 150K steps, each with a single random seed (median seed variance CV ; up to 18% near the phase boundary, quantified in Section A.1). Of 356 completed runs (28 diverged at high , low ), 297 (83.4%) grokked.
Regime operationalization. We define as the first step with training accuracy and as the first step with test accuracy . A configuration is non-grokking if . This operationalization cleanly separates the memorization plateau from the generalization transition: the grokking gap spans from 100 to over 100,000 steps ( range).
3. Scaling Law for Generalization Onset
We fit a log-linear model over the 297 grokked runs:
yielding the power-law form
with . All exponents are negative: increasing any hyperparameter reduces .
3.1. Exponent Hierarchy: Data Dominates Capacity
The exponent magnitudes in Table 1 establish a clear hierarchy among the drivers of generalization onset.
Data complexity (). Doubling the training fraction cuts by . This superlinear dependence suggests that additional data does more than provide redundant examples: it simultaneously strengthens the signal for the generalizing circuit and destabilizes the memorizing solution by reducing its effective capacity advantage. In the
Table 1. Fitted exponents with standard errors and Spearman correlations. Data fraction has the steepest exponent and second-highest rank correlation; weight decay has the highest rank correlation despite a smaller exponent, reflecting its role in the phase boundary.
| Exponent | ||||
| Spearman |
Fourier-feature picture of Nanda et al. (2023), each training pair constrains the phase of a Fourier component; at high , the constraint set becomes overdetermined for the memorizing lookup table but remains consistent for the algebraic circuit.
Implicit regularization (). Weight decay is the second lever. Its Spearman correlation with is higher than that of any other hyperparameter, reflecting its dual role: both accelerates the transition and determines whether it occurs at all (Section 4). The exponent is consistent with implicit regularization theory (Lyu and Li, 2020): weight decay biases gradient descent toward low-norm solutions, and the rate of this bias scales sublinearly with .
Learning rate (). The scaling is consistent with SGD convergence rates: faster optimization traverses the loss landscape more quickly, reducing the time to reach the generalizing basin. The interaction term () indicates wider models benefit more from higher learning rates, suggesting the optimization landscape becomes more navigable with increased capacity.
Model capacity (). Width has the weakest effect. Doubling reduces by only . This contradicts the naive expectation that larger models should generalize faster and supports a view where the transition is governed by optimization dynamics (how quickly weight decay compresses the network) rather than representational capacity (how many parameters are available). The low Spearman correlation () confirms that width's contribution is further muted by interactions with other hyperparameters.
3.2. Interaction Effects
Adding all six pairwise interactions plus a binary task indicator raises to 0.821 (adjusted ; leave-one-run-out ). Four interactions are significant (all ):
- (). At high data fractions,
Compute-Optimal Grokking: Scaling Laws for Delayed Generalization






Figure 1. Grokking dynamics across 356 runs, two tasks, and three model sizes. (a) Representative training curves showing the memorization plateau followed by delayed generalization. (b) vs. FLOPs by model width: wider models grok faster in steps but at higher FLOP cost. (c) Phase diagram in space: grokking rate approaches 100% for . (d) Grokking gap vs. by width. (e) Data scaling: median vs. . (f) Compute-optimal frontier.
faster learning rates accelerate grokking more.
-
(). Wider models benefit more from higher learning rates.
-
(). Larger datasets partially substitute for strong regularization.
-
(). Wider models are less sensitive to weight decay.
The interaction (+0.38) is notable: when data is abundant (), the marginal effect of weight decay is reduced. This supports a picture where data coverage and regularization are partially substitutable mechanisms for driving the memorization-to-generalization transition, both acting to destabilize the high-norm memorizing solution.
3.3. Robustness
The exponents are stable across tasks (addition: ; division: ; pooled: ) and across generalization thresholds (Section A.2). A Weibull accelerated failure time model fit to all 356 runs (59 right-censored) achieves concordance index 0.71 with coefficient signs consistent with OLS. The Weibull shape parameter implies a mildly increasing hazard: once a network begins transitioning, it accelerates, consistent with the positive-feedback picture of norm compression (Section 5).
Scaling Law Fits

Figure 2. Scaling law fit quality. Predicted vs. actual under the base power-law model ( ). Points near the diagonal indicate good fit; spread reflects residual variance from initialization noise, task structure, and unswept hyperparameters.
Per-Model Scaling Laws:

Figure 3. Per-model-size scaling. vs. FLOPs stratified by model width. Wider models grok in fewer steps but consume more FLOPs per step, producing the characteristic rightward shift.
4. Phase Structure of the Grokking Boundary
The scaling law describes how varies within the grokking regime. Equally important is the boundary between regimes: which configurations grok at all?
Figure 5 (left) shows a sharp phase boundary in -space. At , nearly all configurations grok regardless of learning rate. At , fewer than 60% do, and grokking becomes sensitive to . The boundary is not gradual: the transition from to grokking occurs within a factor of in .
Conjecture 1 (Phase boundary). There exists a critical regularization strength (relative to the AdamW scale used here) such that generalization onset is structurally suppressed for . Below , the memorizing solution is a stable fixed point of the training dynamics; above , weight decay destabilizes the memorizing basin, and the network converges to a lower-norm generalizing solution.
Grokking Speed: Model Size x Data x Operation

Figure 4. Model–data interaction. Visualization of the and interaction terms, showing how the effects of learning rate are modulated by data fraction and model width.
This conjecture is consistent with the Omnigrok framework of Liu et al. (2023), where grokking occurs when the weight norm trajectory crosses a critical threshold at which the generalizing loss landscape basin becomes accessible. Our phase diagram provides the first quantitative characterization of where this threshold sits in hyperparameter space.
The grokking gap. The delay drops by more than an order of magnitude as increases from 0.1 to 3.0. This gap measures the time spent in the memorizing regime after the training objective is satisfied; it is the “wasted” computation from a generalization perspective. The scaling law predicts this gap, enabling practitioners to estimate whether a given configuration will exhibit delayed generalization or rapid transition.
5. Weight Norm Dynamics as a Regime Indicator
Existing accounts of grokking emphasize that norm compression drives the transition (Liu et al., 2023; Merrill et al., 2023). We quantify this directly.
From 20 configurations stratified by (fast < 1K, medium 1K–10K, slow > 10K; draws within each stratum), we track weight norms at 100-step intervals. Among the 14 of 20 runs with non-trivial grokking gap, the norm at generalization is lower than at memorization in all 14 cases. The median ratio (IQR: 0.31–0.54). While the sample is modest, the monotonic compression pattern is consistent across all three strata (fast, medium, slow) and both tasks.
Conjecture 2 (Norm compression threshold). The
Grokking Phase Diagram


Figure 5. Left: Phase diagram in space. Color indicates grokking rate across dataset fractions and widths. At , nearly all configurations grok; at , fewer than do. The boundary is sharp, not gradual. Right: Compute-optimal frontier. Total FLOPs , where . Wider models grok faster in steps but at higher FLOP cost, mirroring Chinchilla-style trade-offs (Hoffmann et al., 2022).
Grokking Rate by Hyperparameters and Model Size

Figure 6. Grokking rate heatmaps across the grid, stratified by model width and task. The sharp transition at is consistent across all settings.
memorization-to-generalization transition occurs when the weight norm ratio crosses a threshold in the range 0.3–0.5. If is approximately configuration-independent, then the time to reach it is governed by the scaling law (2), with weight decay controlling the compression rate and data fraction controlling how much compression is needed.
Two observations support this conjecture. First, the norm ratio is monotonically decreasing in all 14 runs during the memorization phase: the network progressively compresses before the transition. Second, the absolute norm at does not predict (Spearman , ), but the rate of norm decrease does: configurations with faster compression grok sooner. This is consistent with the view that what matters is not the starting point but the trajectory through weight space, governed by the interplay of (compression force) and (landscape structure).
6. Related Work
Grokking. Power et al. (2022) discovered grokking in modular arithmetic. Nanda et al. (2023) reverse-engineered the Fourier circuits that form during the transition. Liu et al. (2023) showed grokking extends beyond algorithmic data and proposed the norm-based LU mechanism. Barak
(a) Weight norm trajectories

(b) Norm aligned to transitions
(c) Norm at memorization vs. grokking time
(d) Norm change vs. grokking gap
(p = 0.003)
(p = 0.759)
Figure 7. Weight norm dynamics. Norm trajectories across representative configurations, showing monotonic compression between memorization and generalization onset. The median ratio .
et al. (2022) demonstrated hidden progress in parity learning with SGD. These works characterize what happens; we characterize when, providing the first quantitative scaling law.
Implicit regularization and regime transitions. Lyu and Li (2020) showed gradient descent converges to max-margin solutions for homogeneous networks. Woodworth et al. (2020) identified the lazy-to-rich transition as a function of initialization scale. Our exponent quantifies how explicit regularization modulates this transition in practice.
Phase transitions in learning. Belkin et al. (2019) and Nakkiran et al. (2020) identified the interpolation threshold as a phase boundary. Our phase diagram (Figure 5) identifies an analogous boundary in -space governing delayed generalization.
Scaling laws. Kaplan et al. (2020) and Hoffmann et al. (2022) established power-law scaling for language model loss. Bordelon et al. (2024) derived scaling laws from a solvable model connecting lazy-to-rich transitions with exponent values. We extend the scaling law framework to predict not final loss but the timing of a qualitative regime transition.
Memorization in generative models. Somepalli et al. (2023) and Carlini et al. (2023) documented memorization in diffusion models, finding that dataset scale modulates replication rates. Our exponent quantifies an analogous data-complexity effect on memorization persistence.
7. Discussion
The data complexity result. The exponent, nearly eight times the capacity exponent , suggests that the memorization-to-generalization transition is fundamentally governed by how well the training data constrains the solution space, not by how many parameters are available. To halve , one can either double width (reducing by ) or increase data fraction by 41% (reducing by ). Data is the cheaper lever.
Connections to generative models. Although our experiments use MLPs on modular arithmetic, the memorization-to-generalization transition we characterize is relevant to generative model training. Diffusion models memorize training images at early stages before generalizing to novel samples (Somepalli et al., 2023; Carlini et al., 2023), and dataset scale modulates replication rates. Our scaling methodology—hyperparameter sweep plus power-law fit to transition timing—offers a template for characterizing these transitions in larger-scale generative models. The key prediction is structural: data complexity should dominate capacity in determining transition timing, regardless of architecture. Testing this prediction on transformers, which also grok on modular arithmetic (Nanda et al., 2023; Power et al., 2022), is a natural next step; quantitative data-fraction exponents for attention architectures remain to be measured.
Limitations. (1) The scaling law is fitted on two-hidden-layer MLPs on modular arithmetic; exponents may differ for transformers or natural-language tasks. (2) The width exponent is estimated from only three discrete levels. (3) (base model) leaves 27% variance unexplained, likely from initialization noise ( ), task-specific structure ( ), and unswept hyperparameters ( ). (4) The phase boundary (Conjecture 1) is empirically observed, not derived from first principles.
Open questions. (i) Does the exponent generalize to other group-structured tasks, or is it specific to modular arithmetic? (ii) Can the phase boundary at be derived from a PAC-Bayes or minimum description length argument about the relative complexity of the memorizing vs. generalizing solutions? (iii) Is the norm compression trajectory (Conjecture 2) a Lyapunov function for the memorizing regime, with controlling the rate of descent? These questions connect the empirical findings reported here to the theoretical foundations that the community is well-positioned to develop.
Code availability. Code and run logs for all 384 configurations are available at https://github.com/anishesg/icml-papers.
References
Boaz Barak, Benjamin L Edelman, Surbhi Goel, Sham Kakade, Eran Malach, and Cyril Zhang. Hidden progress in deep learning: SGD learns parities near the computational limit. In NeurIPS, 2022.
Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine-learning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences, 116(32):15849–15854, 2019.
Blake Bordelon, Alexander Atanasov, and Cengiz Pehlevan. A dynamical model of neural scaling laws. In ICML, 2024.
Nicolas Carlini, Jamie Hayes, Milad Nasr, Matthew Jagielski, Vikash Sehwag, Florian Tramèr, Borja Balle, Daphne Ippolito, and Eric Wallace. Extracting training data from diffusion models. In USENIX Security Symposium, 2023.
Lénaïc Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. In NeurIPS, 2019.
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, et al. Training compute-optimal large language models. In NeurIPS, 2022.
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv:2001.08361, 2020.
Ziming Liu, Eric J Michaud, and Max Tegmark. Omnigrok: Grokking beyond algorithmic data. In ICLR, 2023.
Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. In ICLR, 2020.
William Merrill, Nikolaos Tsilivis, and Aman Shukla. A tale of two circuits: Grokking as competition of sparse and dense subnetworks. arXiv:2303.11873, 2023.
Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. In ICLR, 2020.
Neel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith, and Jacob Steinhardt. Progress measures for grokking via mechanistic interpretability. In ICLR, 2023.
Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, and Vedant Misra. Grokking: Generalization beyond overfitting on small algorithmic datasets. In ICLR Workshop on Mathematics of Deep Learning, 2022.
Gowthami Somepalli, Vasu Singla, Micah Goldblum, Jonas Geiping, and Tom Goldstein. Diffusion art or digital forgery? Investigating data replication in diffusion models. In CVPR, 2023.
Blake Woodworth, Suriya Gunasekar, Jason D Lee, Edward Moroshko, Pedro Savarese, Itay Golan, Daniel Soudry, and Nathan Srebro. Kernel and rich regimes in overparametrized models. In COLT, 2020.
A. Robustness and Variance Analysis
A.1. Seed Variance
We rerun 10 configurations spanning the range with 5 random seeds each. The median within-configuration CV is 8%. The maximum CV is 18% for a configuration near the grokking phase boundary (, ), where stochastic fluctuations can determine whether the network grokks within the 150K step budget. Initialization noise accounts for roughly 1–2% of variance in .
Table 2. Seed variance analysis. Each configuration is trained 5 times with different random initializations.
| Regime | Config | Mean | Std | CV (%) | Grokked | |
|---|---|---|---|---|---|---|
| Fast | div_97, , , , | 350 | 238 | 68.0 | 4/5 | . |
| Fast | add_113, , , , | 300 | 0 | 0.0 | 5/5 | (3) |
| Fast | div_97, , , , | 420 | 45 | 10.6 | 5/5 | The two remaining interactions ( and ) are not significant (). |
| Medium | add_113, , , , | 1060 | 55 | 5.7 | 5/5 | |
| Medium | div_97, , , , | 1480 | 110 | 7.4 | 5/5 | |
| Medium | add_113, , , , | 1360 | 114 | 8.4 | 5/5 | |
| Medium | div_97, , , , | 860 | 55 | 6.4 | 5/5 | |
| Slow | add_113, , , , | 5660 | 472 | 8.5 | 5/5 | |
| Slow | div_97, , , , | 13120 | 1224 | 9.3 | 5/5 | |
| Slow | div_97, , , , | 11060 | 1503 | 13.6 | 5/5 |
A.2. Threshold Sensitivity
The exponent is stable across generalization thresholds: -2.15 at 85%, -2.05 at 90%, -2.04 at 95%, -1.88 at 99%. The width exponent varies more (-0.28 to -0.19), reflecting its weaker signal.
Table 3. Fitted exponents under different generalization-accuracy thresholds. is the number of runs classified as grokked.
| Threshold | ||||||
|---|---|---|---|---|---|---|
| 85% | 301 | -0.28 | -2.15 | -0.49 | -0.60 | 0.754 |
| 90% | 300 | -0.29 | -2.05 | -0.48 | -0.61 | 0.708 |
| 95% | 297 | -0.27 | -2.04 | -0.50 | -0.64 | 0.732 |
| 99% | 287 | -0.19 | -1.88 | -0.53 | -0.68 | 0.784 |
A.3. Cross-Validation
Leave-one-level-out cross-validation yields across held-out hyperparameter levels, with median multiplicative prediction errors of . The hardest level to extrapolate is because the power law must extrapolate over a wider dynamic range.
Table 4. Leave-one-level-out cross-validation of the interaction model.
| Held-out HP | CV | Med. mult. err. | 90th pct. err. |
|---|---|---|---|
| (width) | 0.76 | 1.43× | 2.48× |
| (data frac.) | 0.67 | 1.48× | 2.65× |
| (lr) | 0.70 | 1.58× | 2.94× |
| (wd) | 0.68 | 1.51× | 3.36× |
B. Interaction Model Details
The full interaction model is:
Compute-Optimal Frontier
The per-step FLOP cost for two-hidden-layer MLP with width , input dimension (embeddings), and output classes is: . For our architectures (, ), the terms dominate: . Total FLOPs to grok: . Since total FLOPs grow with width (), wider models are less FLOP-efficient despite grokking in fewer steps. The compute-optimal width for a given FLOP budget satisfies , meaning roughly 58% of additional budget should go to width.
D. Falsifiable Predictions
The scaling law and norm dynamics generate three testable predictions:
-
Fourier mode onset scales as . If the exponent reflects data coverage requirements for circuit formation, then the step at which specific Fourier features emerge in the weight matrices (measurable via the methodology of Nanda et al. (2023)) should scale as when data fraction is varied.
-
Wider models form higher-rank memorization solutions. If the weak width exponent () reflects wider models building more complex memorization solutions, then the singular value spectrum of weight matrices at should have higher effective rank for larger .
-
Norm compression rate predicts better than absolute norm. The derivative at should correlate more strongly with than does. Our data shows for the absolute norm; we predict for the compression rate.