Skip to main content
QUICK REVIEW

[Paper Review] Towards Understanding Grokking: An Effective Theory of Representation Learning

Ziming Liu, O. Kitouni|arXiv (Cornell University)|May 20, 2022
Neural dynamics and brain functionNeuroscience24 citations
TL;DR

The paper develops an effective theory and phase diagrams to explain grokking, linking generalization to structured representations and identifying four learning phases (comprehension, grokking, memorization, confusion) in transformers and toy models.

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. 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.

Motivation & Objective

  • Investigate why neural networks generalize after overfitting on small algorithmic datasets.
  • Link generalization to the emergence of structured input representations.
  • Develop a physics-inspired effective theory to predict critical training data size and learning trajectories.
  • Characterize learning phases and how hyperparameters influence delayed generalization.

Proposed method

  • Construct a simplified toy model where inputs map to trainable embeddings and a decoder processes their sum.
  • Define Representation Quality Index (RQI) based on parallelogram structure in embeddings.
  • Formulate an effective loss ell_eff that governs embedding dynamics and derivation of grokking rate from a Hessian spectrum.
  • Derive phase diagrams by varying representation and decoder learning rates and weight decay in toy and transformer-like settings.
  • Extend analysis to modular addition and non-abelian groups to test generality across tasks.

Experimental results

Research questions

  • RQ1What causes generalization in grokking when models overfit on training data?
  • RQ2How does the training data size affect the emergence of structured representations and generalization?
  • RQ3Under what conditions does delayed generalization occur and how can hyperparameters delay or accelerate it?
  • RQ4Do phase diagrams and effective theory predictions hold beyond toy models to transformer architectures and MNIST?
  • RQ5What role does representation structure play in enabling generalization across different operations?

Key findings

  • Generalization correlates with the emergence of structured embeddings that create parallelograms in representation space.
  • The critical training data fraction determines when a linear, unique representation arises, enabling generalization.
  • Grokking is a phase between comprehension and memorization, and can be shifted or removed by proper hyperparameter tuning.
  • Phase diagrams reveal four learning phases and show that faster decoders or excessive decoder capacity promote memorization, while balanced learning supports comprehension and grokking.
  • In transformer settings, reducing decoder capacity or applying regularization speeds up generalization and can suppress grokking, with evidence from MNIST experiments.
  • The effective theory predicts grokking times and phase transition points that align qualitatively with neural network training trajectories.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.