Towards Understanding Grokking: An Effective Theory of Representation Learning

Ziming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud, Max Tegmark +1 more
5/20/2022
cs.LGcond-mat.dis-nncond-mat.stat-mech

Official code: ejmichaud/grokking-squared (29 stars, Jupyter Notebook, MIT, last commit 2023-02-01).

Abstract

We aim to understand grokking, a phenomenon where models generalize long after overfitting their training set. We present both a microscopic analysis anchored by an effective theory and a macroscopic analysis of phase diagrams describing learning performance across hyperparameters.

Show full abstract

We find that generalization originates from structured representations whose training dynamics and dependence on training set size can be predicted by our effective theory in a toy setting. We observe empirically the presence of four learning phases: comprehension, grokking, memorization, and confusion. We find representation learning to occur only in a "Goldilocks zone" (including comprehension and grokking) between memorization and confusion. We find on transformers the grokking phase stays closer to the memorization phase (compared to the comprehension phase), leading to delayed generalization. The Goldilocks phase is reminiscent of "intelligence from starvation" in Darwinian evolution, where resource limitations drive discovery of more efficient solutions. This study not only provides intuitive explanations of the origin of grokking, but also highlights the usefulness of physics-inspired tools, e.g., effective theories and phase diagrams, for understanding deep learning.

View on arXivView PDF

Code Implementations(1)

MIT
299Jupyter Notebook, PythonMar 11, 20223 years agoMIT

Similar Papers

Cite this paper

@article{liu2022towards,
  title  = {Towards Understanding Grokking: An Effective Theory of Representation Learning},
  author = {Ziming Liu and Ouail Kitouni and Niklas Nolte and Eric J. Michaud and Max Tegmark and Mike Williams},
  year   = {2022},
  eprint = {2205.10343},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.10343}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.10343.svg)](https://codeofpaper.com/paper/2205.10343)

Discussion