AI Glossary / Deep learning / Intermediate
Grokking
Definition
Grokking is a machine-learning phenomenon in which a model achieves strong performance on its training examples, remains poor on unseen examples for an extended period, and then develops substantially better generalization with further training. The term became established through experiments on small algorithmic datasets. It describes a pattern in learning behavior, not a separate model architecture, a universal training guarantee, or evidence that a system has acquired humanlike understanding.
What it means
A model may first fit the particular examples it has seen and only later learn a solution that works more broadly. Training accuracy alone can therefore hide important changes in generalization. Grokking highlights the possible delay between fitting a finite dataset and learning a more transferable pattern. However, the interpretation depends on how the task, training split, evaluation examples, and performance measures are defined. Later improvement on one withheld distribution does not demonstrate unlimited extrapolation or general intelligence.
How it works
Researchers study training and held-out learning curves over long runs, often on tasks with a known underlying rule. They vary data size, regularization, initialization, architecture, and optimization to investigate when delayed generalization appears. Explanations can involve competition between memorizing and more structured solutions, changes in learned representations, or particular optimization dynamics. Different studies analyze different settings, so there is no single universally established mechanism that must explain every curve called grokking. A run that merely improves slowly from the start is not necessarily the same phenomenon.
Three practical examples
- Algorithmic research: train a model on some modular-arithmetic examples and measure whether it eventually applies the rule to withheld combinations.
- Interpretability studies: compare internal representations before and after a delayed improvement to investigate the computation the model learns.
- Training-method experiments: test whether regularization or initialization changes the separation between achieving high training accuracy and strong held-out accuracy.
Think of it this way
Think of a learner who can reproduce practice answers before becoming able to solve unfamiliar problems using a common method. The analogy helps distinguish fitting examples from transferring a rule. Its limit is that a neural-network learning curve does not reveal conscious insight, intent, or a human experience of understanding.
Worked example
Consider a fictional modular-addition task where inputs a and b are integers from 0 through 10 and the target is (a plus b) modulo 11. There are 11 times 11 = 121 ordered input pairs. Reserve 40 for evaluation and train on the other 81. The pair (7, 8) has target 4 because 15 leaves remainder 4 after division by 11. Merely storing the 81 training answers does not specify the answers for all 40 withheld pairs.
Imagine a run with 81 of 81 training answers correct but only 8 of 40 evaluation answers correct at an early checkpoint: 100 percent versus 20 percent. Much later, suppose training accuracy remains 100 percent while evaluation accuracy rises to 39 of 40, or 97.5 percent. The 77.5-percentage-point held-out increase after a long training plateau illustrates a grokking-shaped result. These counts are constructed, not observed experimental results. The exact split, checkpoints, seeds, and selection process would need reporting, and success modulo 11 would not establish that the same model handles a new modulus.
Illustrative case study
A fictional research group sees a late jump in validation accuracy and prepares to describe it as grokking. Before doing so, it checks for data leakage, changes in preprocessing, and accidental switching of evaluation files. It then repeats the experiment across seeds and keeps a separate final test set for reporting. The group describes the delayed-generalization pattern precisely, without claiming that waiting longer will necessarily improve unrelated production models.
Common misconceptions and mistakes
Grokking does not mean that every overfit model will eventually generalize. Training longer can waste resources or worsen performance in other settings. A sudden accuracy change may partly reflect a thresholded metric even when the underlying loss changes more smoothly, so several diagnostics are useful. Repeatedly selecting settings using a supposedly untouched test set also weakens the evidence. The phenomenon is not the same as an inference-time reasoning step, a model remembering a fact, or a human suddenly understanding an explanation.
Business use
For business teams, grokking is mainly a reason to understand training dynamics carefully, not a blanket recommendation to extend every training run. If a task plausibly benefits from studying delayed generalization, design a bounded experiment with clear metrics, checkpoints, and compute costs. Compare the extra training expense with alternative data, model, or regularization choices. Production acceptance should still rely on representative unseen cases and operational requirements. A scientifically interesting late transition can remain too expensive, unstable, or task-specific to justify a deployment choice.
People also ask
Does grokking require perfect training accuracy?
Studies commonly involve near-perfect fitting before delayed generalization, but operational definitions should state their chosen criteria rather than impose one universal threshold.
Is it limited to arithmetic tasks?
No. Later research reports related behavior beyond small algorithmic datasets, although occurrence depends on the setup.
Does it prove humanlike comprehension?
No. It is evidence about generalization behavior on specified tests, not conscious experience or unrestricted understanding.
Check your understanding
A model reaches 100 percent training accuracy and remains at poor validation accuracy for the rest of the run. Has grokking been demonstrated?
Answer: No. The delayed improvement in generalization has not occurred merely because the training data were fitted.
Related terms
- Generalization
- Overfitting
- Regularization
- Validation set
- Inductive bias
- memorization
- training dynamics
- algorithmic reasoning
Learn next
compare training and validation loss as well as accuracy across checkpoints on a small rule-based task. Keep evaluation data separate, repeat seeds, and distinguish generalization to withheld examples from extrapolation to a genuinely different task.
More in Deep learning
- Generative topographic map - A generative topographic map, usually discussed as generative topographic mapping or GTM, is a probabilistic nonlinear latent-variable model for...
- Gradient clipping - Gradient clipping is a training technique that limits the magnitude of gradients before an optimizer uses them to update model parameters.
- Graph neural network - A graph neural network, or GNN, is a neural model designed to learn from data represented as a graph of nodes and edges.
- Grossberg network - Grossberg network is a broad label associated with neural models developed by Stephen Grossberg, rather than one uniquely specified modern architecture.
- Group method of data handling - The group method of data handling, or GMDH, is a family of inductive modeling methods that generate candidate models, estimate their parameters from data...
- Hard Sigmoid Function - The hard sigmoid function is a piecewise-linear activation that approximates the S-shaped logistic sigmoid using a straight middle segment and flat lower...
Sources
Power and colleagues, Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets: https://arxiv.org/abs/2201.02177 Liu and colleagues, Omnigrok: Grokking Beyond Algorithmic Data: https://arxiv.org/abs/2210.01117
Previous: GRIM test Next: Grossberg network