Pick a concrete input and say what the equation should give before you read the math.
Foundation reference
Grokking: Delayed Generalization
Grokking shows that a network can generalize long after it has fit its training data perfectly, so stopping when training accuracy reaches 100% can stop too early (Power et al., 2021).
Study guide
Where to start
Do memorization and generalization use different circuits, and how does training eventually favor the generalizing one?
How to study this pagePredict · Check · Generalize · Continue
Work through the math, then read the cited papers for the original argument.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
Use the prerequisites and related concepts at the end of the page to fill the next gap.
Why It Matters for Modern Models
- Grokking shows that a network can generalize long after it has fit its training data perfectly, so stopping when training accuracy reaches 100% can stop too early (Power et al., 2021).
- It gives a small, fully reproducible setting in which the mechanism of generalization can be read off: Nanda et al. (2023) found that transformers trained on modular addition implement it with discrete Fourier transforms and trigonometric identities.
- It explains why some small algorithmic tasks need surprisingly long training, and shows how regularization such as weight decay changes when generalization arrives.
Questions to Think About
- How does weight decay slowly remove the memorizing solution so that the generalizing one dominates?
- The jump in test accuracy looks sudden, so why do progress measures show the generalizing circuit forming gradually beforehand (Nanda et al., 2023)?
Core Math
Grokking is generalization that arrives long after a network has fit its training data. Power et al. (2021) observed it in small transformers trained on algorithmic tasks such as modular arithmetic: validation accuracy rose from chance to near-perfect far past the point of overfitting.
A typical run has three stages:
- Memorization: training loss falls to near zero while test loss stays high.
- A long delay: test loss stays high for many more steps. Progress measures show a generalizing circuit forming gradually during this time (Nanda et al., 2023).
- Generalization: test loss drops to match training loss as the memorizing components are removed.
Smaller training sets need more optimization before generalization appears (Power et al., 2021).
Weight norm. Liu et al. (2023) relate grokking to the size of the weights: training loss is low over a wide range of weight norms, but test loss is low only in a narrower range of smaller norms. A network initialized with large weights first finds a memorizing solution at large norm; weight decay then shrinks the weights slowly until they reach the range where solutions generalize. Power et al. (2021) found weight decay the most effective of the interventions they tried: compared with most of the others, it more than halved the training data needed to generalize.