Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    Grokking: why AI models sometimes generalise long after memorising

    Grokking is when a neural network, after memorising its training data, keeps training and only much later jumps from chance-level to perfect performance on new examples.[1] It was reported in 2022 on small algorithmic tasks; later work reverse-engineered the algorithm one grokked model learned and found the jump was the end of a gradual process, not a sudden switch.[2][3] The evidence comes mostly from small models and preprints.

    Editor reviewedUpdated Explainer6 claims · 0% primaryAI safety and alignment, Frontier AI, Artificial intelligence
    Reading level: 3 passages differ; the rest is the same for everyone.

    Reading order: How neural networks work first, then How mechanistic interpretability works. This page sits between Superposition and sparse-autoencoders in the AI-safety course. The results here come from small research models and are mostly preprints.

    What grokking is

    Normally a model that memorises its training examples without learning the underlying rule is stuck: it does well on what it has seen and badly on anything new. In 2022 researchers reported that if they kept training such a model on small maths-style puzzles, it sometimes suddenly “got it”, jumping from guessing to perfect answers on new examples, long after it had memorised the training set. They called this grokking.[1]

    Power and colleagues trained networks on small algorithmically generated datasets and observed validation performance rising from chance to perfect generalisation well past the point of overfitting.[1] They also found that smaller datasets need increasing amounts of optimisation before generalisation appears.[4]

    What happens inside: the modular-addition study

    A follow-up study opened up small transformers that had grokked a clock-style addition task. The researchers found the network had learned a neat trick: it turned adding numbers into rotating around a circle, using waves (Fourier transforms).[2] Watching training step by step, they saw the general method being built gradually, while the memorised answers were cleaned away later. The “sudden” jump in test scores was the end of that slow process.[3]

    Nanda and colleagues fully reverse-engineered the learned algorithm: discrete Fourier transforms and trigonometric identities that convert modular addition into rotation about a circle.[2] Using progress measures derived from that mechanism, they split training into three continuous phases, memorisation, circuit formation and cleanup, and concluded grokking arises from gradual amplification of structured mechanisms followed by removal of memorising components.[3]

    A loss-landscape explanation

    Another group explained grokking by looking at how training and test errors change with the overall size of a model’s weights. They argued the two behave differently, and that this mismatch is what causes the delay.[5] They said the same idea explains why grokking depends on how much data there is and on a common training setting called weight decay.[6]

    The Omnigrok preprint attributes grokking to a mismatch between training and test loss as functions of weight norm. It reports inducing grokking on image, language and molecule tasks and removing it on algorithmic datasets.[5] The authors say the picture accounts for grokking’s dependence on data size and weight decay.[6]

    What is known and what is open

    Known: grokking has been reported on small algorithmic tasks,[1] and in at least one case the general algorithm behind it has been read directly from the weights.[2] Open: how far these findings carry to large models trained on messy real-world data, beyond the image, language and molecule tasks one preprint tested.[5] Whether sudden-looking jumps in other models also hide gradual internal progress is a question that runs through How mechanistic interpretability works and debates about frontier AI.

    Next in the crash course

    Questions readers ask

    What does grokking mean in machine learning?

    It describes a network trained on a small algorithmic dataset that improves from chance-level to perfect generalisation well after it has already overfitted the training data.[1]

    Is grokking a sudden leap in understanding?

    It looks sudden on test scores, but one detailed study found it comes from the gradual strengthening of a general mechanism inside the network, followed by removal of the memorising parts.[3]

    Does grokking happen in large language models?

    It was reported in 2022 on small algorithmic datasets. One preprint reported inducing grokking on image, language and molecule tasks. These studies do not establish that it explains large-model behaviour.[1][5]

    Why does grokking matter for AI safety?

    It is a case where researchers could watch a model switch from memorising to a general algorithm and read that algorithm from its weights, which is a test bed for interpretability methods.[2][3]

    Sources

    · 6 claims from 3 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      A 2022 paper by OpenAI researchers Power and colleagues reported that neural networks trained on small algorithmically generated datasets sometimes grok a pattern, improving from chance-level to perfect generalisation well past the point of overfitting. reportedas of 2022-01-06

    2. [2]

      Nanda and colleagues fully reverse-engineered the algorithm learned by small transformers that grok modular addition, reporting that it uses discrete Fourier transforms and trigonometric identities to turn addition into rotation about a circle. reportedas of 2023-10-19

    3. [3]

      Nanda and colleagues split training into three continuous phases, memorisation, circuit formation and cleanup, and concluded that grokking arises from gradual amplification of structured mechanisms followed by removal of memorising components, not a sudden shift. reportedas of 2023-10-19

    4. [4]

      Power and colleagues found that smaller datasets require increasing amounts of optimisation for generalisation. reportedas of 2022-01-06

    5. [5]

      The Omnigrok preprint attributes grokking to a mismatch between training and test losses as a function of weight norm, reported inducing grokking on image, language and molecule tasks, and reported eliminating it on algorithmic datasets. reportedas of 2023-03-23

    6. [6]

      The Omnigrok authors say their mechanism explains aspects of grokking including its dependence on data size and weight decay. reportedas of 2023-03-23

    Revision history (1)
    1. Page created.

    Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Sep 6, 2027.

    Cite this page

    "Grokking: why AI models sometimes generalise long after memorising." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/grokking-explained

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.