• 1 min read • AI Interpretability

Grokking in Neural Networks

Grokking is when a neural network suddenly picks up the general pattern in its data after many training iterations, long after it has memorized the training set.

What is Grokking?

Grokking is a sudden improvement in generalization during training, usually after the network appears to have memorized the training data for a long time. This was first systematically studied by Power et al. in 2022.

The Training Dynamics

Typically, training proceeds in phases:

  1. Initial Learning: The model quickly learns to fit the training data
  2. Memorization Phase: Training accuracy reaches near 100%, but test accuracy remains low
  3. Compression Phase: The model starts to simplify its internal representations
  4. Grokking: Test accuracy suddenly jumps to match training accuracy

This suggests that the model first memorizes, then gradually discovers a more general algorithm that explains the data.

Mathematical Analysis

The phase transition can be modeled as a logistic function of training time, with test accuracy jumping sharply around an inflection point.

Mechanistic Interpretability

Studying grokking provides insights into:

  • How circuits form in neural networks
  • The relationship between memorization and generalization
  • The dynamics of weight decay and regularization

This matters for AI safety research because it shows how and when models develop capabilities that generalize instead of memorizing.

Back to top