Lune

ICML2024Top-tier venue

Why Do You Grok? A Theoretical Analysis on Grokking Modular Addition

Mohamad Amin Mohamadi, Zhiyuan Li, Lei Wu, Danica J. Sutherland

Abstract

We present a theoretical explanation of the "grokking" phenomenon (Power et al., 2022) , where a model generalizes long after overfitting, for the originally-studied problem of modular addition. First, we show that early in gradient descent, when the "kernel regime" approximately holds, no permutation-equivariant model can achieve small population error on modular addition unless it sees at least a constant fraction of all possible data points. Eventually, however, models escape the kernel regime. We show that two-layer quadratic networks that achieve zero training loss with bounded ℓ ∞ norm generalize well with substantially fewer training points, and further show such networks exist and can be found by gradient descent with small ℓ ∞ regularization. We further provide empirical evidence that these networks as well as simple Transformers, leave the kernel regime only after initially overfitting. Taken together, our results strongly support the case for grokking as a consequence of the transition from kernel-like behavior to limiting behavior of gradient descent on deep networks.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Intrinsic Task Symmetry Drives Generalization in Algorithmic Tasks cites Towards Understanding Grokking: An Effective Theory of Representation Learning
  • Gradient Flow Through Diagram Expansions: Learning Regimes and Explicit Solutions cites Towards Understanding Grokking: An Effective Theory of Representation Learning
  • Gradient Flow Through Diagram Expansions: Learning Regimes and Explicit Solutions cites Emergence in non-neural models: grokking modular arithmetic via average gradient outer product
  • Gradient Flow Through Diagram Expansions: Learning Regimes and Explicit Solutions cites Tensor Programs IV: Feature Learning in Infinite-Width Neural Networks
  • Emergence in non-neural models: grokking modular arithmetic via average gradient outer product cites Towards Understanding Grokking: An Effective Theory of Representation Learning
  • Egalitarian Gradient Descent: A Simple Approach to Accelerated Grokking cites Towards Understanding Grokking: An Effective Theory of Representation Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Intrinsic Task Symmetry Drives Generalization in Algorithmic TasksHyeonbin Hwang, Yeachan ParkICML 2026 · 1 citation
  2. Gradient Flow Through Diagram Expansions: Learning Regimes and Explicit SolutionsDmitry Yarotsky, Eugene Golikov, Yaroslav GusevICML 2026 · 1 citation
  3. Egalitarian Gradient Descent: A Simple Approach to Accelerated GrokkingAli Saheb Pasand, Elvis DohmatobICLR 2026 · 1 citation
  4. Emergence in non-neural models: grokking modular arithmetic via average gradient outer productNeil Mallinar, Daniel Beaglehole, Libin Zhu, Adityanarayanan Radhakrishnan et al.ICML 2025
  5. Making Hard Problems Easier with Custom Data Distributions and Loss Regularization: A Case Study in Modular ArithmeticEshika Saxena, Alberto Alfarano, Emily Wenger, Kristin E. LauterICML 2025

Builds on24

  1. PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph CompilationJason Ansel, Edward Z. Yang, Horace He, Natalia Gimelshein et al.ASPLOS 2024 · 693 citations
  2. Gradient Descent Maximizes the Margin of Homogeneous Neural NetworksKaifeng Lyu, Jian LiICLR 2020 · 402 citations
  3. Towards Understanding Grokking: An Effective Theory of Representation LearningZiming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud et al.NeurIPS 2022 · 299 citations
  4. Deep learning versus kernel learning: an empirical study of loss landscape geometry and the time evolution of the Neural Tangent KernelStanislav Fort, Gintare Karolina Dziugaite, Mansheej Paul, Sepideh Kharaghani et al.NeurIPS 2020 · 255 citations
  5. Tensor Programs IV: Feature Learning in Infinite-Width Neural NetworksGreg Yang, Edward J. HuICML 2021 · 242 citations

Related papers

  1. To Grok Grokking: Provable Grokking in Ridge RegressionMingyue Xu, Gal Vardi, Itay SafranICML 2026
  2. Grokking Beyond the Euclidean Norm of Model ParametersPascal Tikeng Notsawo Jr., Guillaume Dumas, Guillaume RabusseauICML 2025
  3. Grokking as the transition from lazy to rich training dynamicsTanishq Kumar, Blake Bordelon, Samuel J. Gershman, Cengiz PehlevanICLR 2024 · 86 citations
  4. Grokking as a First Order Phase Transition in Two Layer NetworksNoa Rubin, Inbar Seroussi, Zohar RingelICLR 2024 · 43 citations
  5. Dichotomy of Early and Late Phase Implicit Biases Can Provably Induce GrokkingKaifeng Lyu, Jikai Jin, Zhiyuan Li, Simon Shaolei Du et al.ICLR 2024 · 71 citations
Dusk over the sea between two cliffs drawn in fine vertical lines