To Grok Grokking: Provable Grokking in Ridge Regression

Mingyue Xu, Gal Vardi, Itay Safran

International Conference on Machine Learning 2026 · Oral

Overview

This talk explores grokking, a machine learning phenomenon where model generalization occurs long after the training loss has plummeted and the model has seemingly overfitted the data. Originally discovered by Power et al., grokking highlights a perplexing delay between achieving high training accuracy and actual test set accuracy. While this behavior has drawn intense interest in the deep learning community, theoretical explanations remain sparse. In this work, the authors—Mingyue Xu, Gal Vardi, and Itay Safran—provide a rigorous, mathematical investigation of grokking within the seemingly simple framework of ridge regression.

Watch on SlidesLive

Visual summary for To Grok Grokking: Provable Grokking in Ridge Regression by Mingyue Xu, Gal Vardi, Itay Safran
Visual summary for To Grok Grokking: Provable Grokking in Ridge Regression by Mingyue Xu, Gal Vardi, Itay Safran

Key moments

  1. 0:00 Introduction to grokking and research motivation
  2. 2:00 Problem setup and ridge regression definitions
  3. 4:00 Main theorem and bounds on grokking time
  4. 5:30 Simulation results illustrating the grokking phenomenon
  5. 6:00 Intuition behind training phases in ridge regression
  6. 7:00 Comparison between theoretical bounds and empirical values
  7. 8:00 Conclusion and future research directions
  8. 8:30 Audience Q and A on label noise and non-realizable settings

To Grok Grokking: Provable Grokking in Ridge Regression

Speakers: Mingyue Xu; Gal Vardi; Itay Safran

Conference: ICML

YouTube: https://slideslive.com/39083637

Overview

This talk explores grokking, a machine learning phenomenon where model generalization occurs long after the training loss has plummeted and the model has seemingly overfitted the data. Originally discovered by Power et al., grokking highlights a perplexing delay between achieving high training accuracy and actual test set accuracy. While this behavior has drawn intense interest in the deep learning community, theoretical explanations remain sparse. In this work, the authors—Mingyue Xu, Gal Vardi, and Itay Safran—provide a rigorous, mathematical investigation of grokking within the seemingly simple framework of ridge regression.

By studying a linear model trained via gradient descent with weight decay (L2 regularization), the researchers prove that grokking is not exclusive to deep neural networks or complex non-linear architectures. They establish the first rigorous quantitative bounds for grokking that satisfy three essential requirements: the model overfits the training data quickly, poor generalization persists for a protracted number of iterations, and the generalization loss eventually drops to a small value. This work supplies a principled, mathematical foundation for controlling grokking through hyperparameter tuning.

Beyond the theoretical proofs, the paper bridges the gap between analysis and empiricism by validating its quantitative bounds against simulations. The authors demonstrate how tuning parameters such as the weight decay coefficient, sample size, feature dimension, and initialization scale directly dictate the grokking time. This technical analysis demystifies the mechanics of delayed generalization and offers a stepping stone toward understanding similar dynamics in broader machine learning systems.

Background

▶ Watch: Introduction to grokking and research motivation (0:00)

The phenomenon of grokking was first brought to light by Power et al., who observed that overparameterized neural networks trained on algorithmic tasks could achieve 100% training accuracy very early in training (e.g., around $1,000$ iterations) while test accuracy remained near random chance for hundreds of thousands or millions of iterations before suddenly surging. This disconnect challenges traditional learning theory intuition, which often equates early training success or standard convergence with immediate generalization.

In the broader machine learning and systems space, understanding this behavior is critical for training large-scale models efficiently. If practitioners stop training too early—assuming that overfitting implies the end of useful optimization—they miss the window where generalization kicks in. Conversely, waiting too long incurs massive computational costs.

Prior work has largely focused on observing or heuristically analyzing grokking in deep networks. However, teasing apart the exact mathematical mechanisms in non-linear, multi-layer architectures is exceptionally difficult due to non-convex loss landscapes and complex feature learning dynamics. To gain rigorous traction, the authors strip away the non-linearities and focus on a foundational, tractable machine learning model: ridge regression. By studying linear models under gradient descent with weight decay, the ML systems community can isolate how explicit regularization interacts with optimization trajectories to delay generalization.

Key Findings

▶ Watch: Main theorem and bounds on grokking time (4:00)

The central achievement of this work is the mathematical proof that grokking occurs in ridge regression trained via gradient descent from random initialization. The authors formalize the timeline of training using two critical milestones:

  • $T_1(\epsilon)$: The time step at which the empirical training loss drops below a small threshold $\epsilon$ (representing the onset of overfitting).
  • $T_2(C)$: The time step at which the population test loss drops below a threshold $C$ (representing successful generalization).

Grokking is mathematically confirmed by proving a lower bound on the delay $T_2 - T_1$. The primary findings and discoveries include:

  • Rigorous Quantitative Bounds: The authors derive upper bounds for $T_1$ and lower bounds for $T_2$ that depend explicitly on task hyperparameters, sample sizes, and initialization scales.
  • The Role of Weight Decay ($\lambda$): The upper bound for $T_1$ (overfitting time) is independent of the weight decay coefficient $\lambda$. Conversely, the lower bound for $T_2$ scales inversely with $\lambda$ (proportional to $1/\lambda$).
  • Arbitrary Grokking Delays: Taking the weight decay $\lambda$ to zero leaves $T_1$ unaffected while pushing $T_2$ toward infinity. Consequently, practitioners can manufacture an arbitrarily large delay between overfitting and generalization by dialing down the weight decay.
  • Empirical Validation: Simulations comparing theoretical bounds against empirical trajectories across varying weight decays, sample sizes, feature dimensions, and initialization scales show that the theoretical bounds accurately capture the qualitative and quantitative behavior of $T_1$ and $T_2$.

Technical Dive

▶ Watch: Intuition behind training phases in ridge regression (6:00)

The theoretical framework considers an overparameterized setting where the ambient feature dimension $m$ is larger than the sample size $n$. The training dataset consists of $n$ independent and identically distributed (i.i.d.) examples drawn from a distribution in $\mathbb{R}^m$, with continuous labels generated by a linear teacher model parameterized by a weight vector $\theta^*$. The empirical objective utilizes the standard square loss.

For ridge regression, the optimization objective minimizes the regularized empirical loss:

$$\min_{\theta} \left( \hat{L}(\theta) + \lambda \|\theta\|_2^2 \right)$$

where $\lambda$ is the weight decay coefficient. Optimization proceeds via gradient descent starting from a random initialization scaled by a parameter $\nu$.

The mathematical intuition behind the emergence of grokking in this linear setting breaks down into two distinct training phases when $\lambda$ is sufficiently small:

  1. The Early Phase (Fast Overfitting): Because the weight decay coefficient $\lambda$ is small, its influence on the gradient descent trajectory is initially negligible. The optimization path closely mirrors standard linear regression without regularization. Consequently, the trajectory rapidly converges to an interpolating solution that fits the training data perfectly while remaining as close as possible in $L_2$ distance to the random initialization point. This marks the rapid achievement of $T_1$.
  2. The Late Phase (Slow Regularization Drift): Although the model has already fit the training data, the persistent, low-level pressure of weight decay continues to work on the parameters over a vastly extended timeframe. The trajectory slowly drifts away from the initialization-biased interpolator toward the ultimate minimum norm interpolator—the solution that fits the training data while possessing the absolute minimal $L_2$ norm.

Through standard uniform convergence arguments, this minimum norm interpolator guarantees strong generalization performance. The vast temporal gulf between reaching the initial interpolator and finally settling near the minimum norm interpolator accounts for the massive gap $T_2 - T_1$.

Experimental Setup & Results

▶ Watch: Comparison between theoretical bounds and empirical values (7:00)

To validate the theoretical bounds, the authors perform numerical simulations of ridge regression on synthetic linear tasks.

  • Datasets & Data Generating Process: Inputs are sampled i.i.d. from a high-dimensional distribution, with labels generated cleanly via a linear teacher model $\theta^*$ in a realizable setting (no label noise).
  • Baselines & Hyperparameter Sweeps: The experiments systematically sweep across four primary axes:
  • Weight decay coefficient ($\lambda$)
  • Sample size ($n$)
  • Feature dimension ($m$)
  • Random initialization scale ($\nu$)
  • Metrics: The primary metrics tracked are $T_1(\epsilon)$ (the iteration count where training loss crosses an empirical threshold) and $T_2(\epsilon)$ (the iteration count where test population loss drops to the same small threshold).
  • Headline Results & Ablations: In empirical plots tracking training loss (red curves) versus test loss (blue/red comparison curves), training loss plummets to near-zero within roughly $1,000$ iterations, whereas test loss lingers at high error rates before dropping precipitously around $10^5$ iterations. Comparing theoretical bounds (dashed lines) against empirical values (solid lines) across hyperparameter variations confirms that while constants may differ, the functional dependencies and overall behavioral trends predicted by the theory closely match practice.

Practical Implications

▶ Watch: Audience Q and A on label noise and non-realizable settings (8:30)

For machine learning practitioners, infrastructure teams, and model deployers, this work demystifies a counterintuitive optimization dynamic that frequently catches engineering pipelines off guard.

  • Training Duration Pitfalls: In overparameterized regimes utilizing gradient descent with weight decay, halting training immediately after the training loss plateaus or training accuracy hits 100% can cause engineers to discard models that would have eventually generalized successfully.
  • Hyperparameter Control: The discovery that grokking duration scales inversely with the weight decay coefficient ($\sim 1/\lambda$) gives developers a direct handle for managing training schedules. Adjusting $\lambda$ allows teams to explicitly modulate the transition speed between overfitting and generalization.
  • Limitations and Future Horizons: The current proof relies heavily on a realizable setting (pure teacher-student linear models without label noise). Introducing label noise introduces theoretical complications: while empirical tests show grokking still occurs with noisy labels, the asymptotic norm of the model diverges as sample sizes increase, presenting a hurdle for future mathematical formalization. Extending these provable bounds to non-linear models and neural networks remains an open, vital frontier.

Key Takeaways

  • Grokking—the phenomenon where generalization occurs long after training data is overfitted—is provably reproducible even in simple linear frameworks like ridge regression.
  • Training under gradient descent with weight decay exhibits a two-phase trajectory: a fast early phase that rapidly reaches an initialization-biased interpolator, followed by a slow late phase driven by weight decay toward the minimum norm interpolator.
  • The time gap between overfitting ($T_1$) and generalization ($T_2$) can be controlled systematically; specifically, taking the weight decay coefficient $\lambda$ to zero pushes the generalization time $T_2$ to infinity.
  • Theoretical bounds derived for $T_1$ and $T_2$ accurately track empirical simulation behavior across sweeps of weight decay, sample size, feature dimension, and initialization scale.
  • While current proofs assume a clean, realizable setting, empirical evidence confirms that grokking persists even in the presence of label noise, posing exciting challenges for future theoretical work on non-linear architectures.

About the Speaker(s)

  • Gal Vardi: Co-author of a paper on provable grokking in ridge regression.

Co-authors: Mingyue Xu, Itay Safran.

Reviews

→ Top-rated talks at International Conference on Machine Learning 2026

All talks from International Conference on Machine Learning 2026