On Grokking and the Dynamics of Generalization

Malik AmirarXiv 2026

TL;DR

"Grokking"—that eerie phenomenon where a neural network memorizes its training data almost instantly, sits at terrible test accuracy for ages, and then suddenly clicks into perfect generalization—remains one of deep learning’s strangest parlor tricks. In this paper, Malik Amir builds a rigorous mathematical framework showing that grokking doesn't actually require internal "feature learning" at all; instead, it can emerge purely from differences in how fast various mathematical modes learn and how training signals transfer to test data. Even more surprisingly, whether and when a model groks cannot be predicted by watching its training dynamics alone.

What Problem Does This Paper Address?

Imagine teaching a student physics. They memorize all the textbook solutions by Tuesday (zero training loss), fail every practice quiz for six months, and then wake up one random Sunday suddenly solving unseen problems effortlessly (high evaluation accuracy). In machine learning, this delayed generalization is called grokking.

A popular intuition in the field is that during that long, quiet plateau, the network is slowly reorganizing its internal representations—doing "feature learning"—until it discovers the true underlying rule. However, we still lack a complete, mathematically precise theory connecting how training error shrinks to how test error behaves over time. Amir tackles this gap by asking: How exactly does error reduction on training data translate into performance on unseen test data, and what really causes that dramatic, delayed leap in accuracy?

Methods

Building on a "signal-channel" theory recently introduced by Litman and Guo, Amir models neural network training using operator theory and preconditioned gradient flows (a smooth, continuous-time mathematical version of gradient descent) with time-dependent kernels.

The core methodological novelty is splitting the learning process into two distinct mathematical operators:

  1. Dissipation: How much training error is burned away along specific directions during optimization.
  2. Transfer: How strongly those learned directions actually carry over ("become visible") to the evaluation space where test data lives.

Think of the network's output space as having a signal channel (directions that actively transmit useful information to test outputs) and a reservoir (directions where signals remain hidden or trapped). Using spectral analysis—breaking the dynamics down into distinct modes with their own learning speeds (eigenvalues)—Amir tracks how task directions escape the reservoir via eigenvalue activation or subspace rotation, and relates classification margins (how confidently a data point sits on the right side of a decision boundary) to exact crossing times. He also introduces a matrix-free empirical protocol to probe these quantities in practice.

Datasets

Not discussed in the paper. (Note: The provided document consists of the abstract and an 80-page table of contents outlining a purely theoretical and mathematical treatise; no specific empirical datasets or benchmarks are detailed in the provided pages.)

Key Insights and Ideas

  • Invisibility has two culprits: If a model hasn't learned a task on the test set yet, a task direction is "invisible" either because training hasn't dissipated enough error along it yet, or because the geometric bridge transferring that signal from the training space to the evaluation space is weak.
  • Grokking doesn't need feature learning: Contrary to conventional wisdom, dramatic grokking can happen even when features are completely frozen (constant kernels). If a model has fast-learning spectral modes that memorize noise/shortcuts and ultra-slow modes aligned with the true rule, the sheer separation of learning rates creates an arbitrarily long delay.
  • The illusion of sudden insight: Why does accuracy jump from 0% to 100% seemingly overnight? Amir shows this happens when the times at which test points cross the classification decision boundary ("margin crossing times") tightly bunch together. Test accuracy skyrockets over a razor-thin time window even while the underlying continuous population risk barely budges!
  • Selective generalization: Because transfer depends heavily on the test distribution's geometry, the exact same training run can gloriously grok under one evaluation distribution while completely failing to generalize under another.
  • The limits of watching training: You cannot, in general, predict if or when grokking will happen just by staring at training metrics or training dynamics alone. You have to know the geometry connecting the training space, the test distribution, and the target function.

Key Results

Because this work is a theoretical study, the primary results are mathematical proofs and constructive models rather than empirical leaderboard numbers:

  • Infinite delay, instantaneous jump: Amir constructs an exact family of gradient flows (without feature evolution) where, in the mathematical limit, the delay between low training loss and high evaluation accuracy approaches infinity ($\to \infty$), while the transition window where classification accuracy leaps from 0 to 1 shrinks to zero ($\to 0$). Simultaneously, the change in continuous population risk across that dramatic transition also tends to zero.
  • Quantitative bounds and criteria: The paper establishes necessary and sufficient geometric conditions (including an "angle criterion") for transferred training signals to actually reduce squared population risk, alongside quantitative error bounds under margin assumptions and stability guarantees under distribution shifts and stochastic optimizer updates.

Limitations and Future Work

While the full text's concluding section ("Further questions" on page 75) is only listed in the table of contents, an inherent structural boundary established by the paper itself is the identifiability limit of training-only information—proving mathematically that training-side observations alone are fundamentally insufficient to diagnose generalization timing without access to evaluation transfer geometry. Furthermore, the primary exact delay and two-mode classification models focus heavily on continuous gradient flows and spectral separation; bridging these operator-theoretic insights to large-scale empirical deep learning via the proposed matrix-free empirical protocol represents the natural frontier suggested by the work's structure.

Summary updated

Abstract

We extend the signal-channel theory of grokking introduced by Litman and Guo by relating training dissipation and evaluation transfer to population risk. For preconditioned gradient flows with time-dependent kernels, we distinguish two sources of limited evaluation visibility, namely small cumulative dissipation and weak transfer. We obtain quantitative bounds for task visibility and establish their stability under signal filtering and changes of evaluation distribution. We describe how task directions enter the effective signal channel through spectral activation or transport. We establish necessary and sufficient conditions for the transferred signal to decrease squared population risk and derive classification error bounds under margin assumptions. These results yield sufficient conditions for the same training trajectory to generalize under one evaluation distribution while failing under another. We show that differences in spectral learning rates can produce arbitrarily long delays between low training loss and low population risk. By relating classification accuracy to the distribution of margin crossing times, we construct a family of gradient flows in which the generalization delay tends to infinity, while both the duration of the transition from zero to full accuracy and the corresponding variation of population risk tend to zero. These phenomena occur without feature evolution during training. Finally, we prove that the occurrence and timing of generalization cannot generally be inferred from training dynamics alone, but depend on the geometry of evaluation transfer and its relation to the target.
BibTeX
@misc{amir2026grokking,
  author = {Malik Amir},
  title = {{On Grokking and the Dynamics of Generalization}},
  year = {2026},
  eprint = {2611.33825},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.33825},
}
Figure