grokking
Grokking is the phenomenon where neural networks suddenly achieve perfect generalization on held-out data long after memorizing the training set and achieving near-zero training loss, suggesting delayed learning of underlying structure. Discovery: Power et al. (2022) observed on algorithmic tasks (modular arithmetic) that models first memorize training examples, then much later (10-100× more training steps) suddenly "grok" the general algorithm. Timeline: (1) Initial learning—rapid training loss decrease; (2) Memorization—training loss near zero, test loss remains high (model memorized, didn't generalize); (3) Plateau—extended period of no apparent progress on test set; (4) Grokking—sudden sharp drop in test loss to near-perfect generalization. Mechanistic understanding: (1) Phase transition—model transitions from memorization circuits to generalizing circuits; (2) Weight decay role—regularization gradually pushes model from memorized to structured solution; (3) Representation learning—model slowly develops internal representations that capture the underlying algorithm; (4) Circuit competition—memorization and generalization circuits compete, generalization eventually wins. Key factors: (1) Dataset size—grokking more pronounced with smaller training sets; (2) Regularization—weight decay is often necessary to trigger grokking; (3) Training duration—requires very long training beyond convergence; (4) Task structure—tasks with learnable algorithmic structure. Practical implications: (1) Early stopping may miss generalization—standard practice of stopping at minimum validation loss could be premature; (2) Compute investment—continued training past apparent convergence may unlock capabilities; (3) Understanding generalization—challenges traditional learning theory assumptions. Active research area connecting to mechanistic interpretability—understanding what computational structures form during grokking illuminates how neural networks learn algorithms.