In 2022, a small crew of researchers ran an experiment that ought to have been unremarkable. They educated a tiny neural community, far smaller than something that will get known as “AI” as we speak, on one of many easiest duties possible: modular addition, mainly clock math. What’s 8 plus 7 if the clock solely goes as much as 12? The reply is 3.
The community realized this nearly instantly. Inside a thousand coaching steps it was answering each follow query accurately.
Then the researchers examined it on questions it had by no means seen earlier than. It did barely higher than guessing.
That half is not shocking. It is a acquainted failure in machine studying: the mannequin had memorized the reply key as a substitute of studying the rule behind it. Usually, that is the place the story ends. Besides the researchers saved coaching the mannequin properly previous the purpose most individuals would name it completed. Hundreds extra steps. Then tens of hundreds.
Sooner or later, with no new information and nothing visibly completely different in regards to the setup, the mannequin’s efficiency on the unseen questions jumped from barely higher than random to almost good. At 1,000 steps it scored completely on coaching information however solely about 10 % on new issues. By 20,000 steps, it scored near one hundred pc on each, with no change to the way it was being educated in between [1].
It had been sitting there, trying completed by each regular measure, quietly turning into a totally completely different form of mannequin. The researchers named this grokking.

Cramming versus truly understanding
An analogy that captures it properly: image a scholar who crams the night time earlier than a take a look at. They’ll reply yesterday’s follow questions completely. Give them a brand new query that exams the identical thought in a barely completely different kind, and so they freeze, as a result of they memorized solutions fairly than the idea beneath them.
Now think about that scholar retains learning anyway, not new materials, simply the identical materials time and again. Weeks later, one thing clicks. They cease recalling flashcards and begin truly understanding the subject properly sufficient to unravel issues they’ve by no means seen.
That is roughly what grokking seems to be like from the surface. The unusual half is the timing. The clicking occurs lengthy after the scholar seems completed. Cease watching them proper when their quiz scores plateau, and also you’d conclude they seem to be a memorizer and transfer on, with no manner of realizing that actual understanding was nonetheless forming beneath.
What was truly taking place throughout that quiet stretch
That is the half that turns grokking from a curiosity into one thing value taking note of, as a result of researchers did not simply observe the impact. They opened the community up and reverse engineered what it was doing at every stage, much like taking aside a watch to take a look at the gears.
A follow-up examine in 2023 discovered one thing unexpectedly elegant. The community had taught itself to symbolize numbers as positions round a circle, then mixed these positions utilizing the arithmetic of rotation, basically rediscovering trigonometry to unravel clock math with out anybody displaying it what trigonometry was [2].
Image an precise clock face. The community realized to position every quantity at a degree across the circle. Including two numbers turned a matter of rotating to at least one place, rotating once more by the second quantity, and studying off wherever the hand landed. It is a clear, genuinely generalizable technique, the sort a mathematician may design on function. No person constructed it in. Gradient descent discovered it by itself.

Constructing that round construction took time. For a protracted stretch, two options existed aspect by aspect inside the identical community: a memorized shortcut that labored on acquainted questions however nowhere else, and an actual, normal technique nonetheless being assembled piece by piece beneath it. The overall technique solely took over as soon as it was full sufficient to outcompete the memorized one. From outdoors the community, that building section regarded like nothing taking place in any respect. From inside, it was all the story.
Why a flat line doesn’t suggest nothing is going on
This element is value sitting with. When you solely watch the scoreboard, accuracy on coaching information and accuracy on new information, grokking seems to be like a protracted flat stretch adopted by a sudden cliff. Anybody judging progress from the surface would quit proper earlier than the fascinating half begins. That is near what would have occurred right here underneath a regular early stopping rule, the sort constructed into most coaching setups particularly to save lots of time by slicing off fashions that seem to have stopped enhancing.
That raises a query value taking severely properly past toy math issues. What number of instances has one thing like this occurred quietly in bigger, extra necessary fashions, and easily been switched off earlier than anybody observed the clicking coming?
No person has a full reply but. Grokking has since been documented in a handful of different slender, rule-based duties, however whether or not something comparable occurs invisibly inside as we speak’s a lot bigger fashions remains to be an open query. It is one of many stranger implications of the entire phenomenon: memorization and actual understanding can look similar from the surface, proper up till the second they cease trying similar.
The place the identify comes from
Grokking is borrowed from Robert Heinlein’s novel Stranger in a Unusual Land, the place it describes understanding one thing so fully that you simply take in it intuitively fairly than merely realizing it. It is an odd phrase to connect to a math experiment, however it suits. The mannequin did not get progressively higher at faking the proper reply. At some particular, hidden level, it stopped faking and began realizing.
The lesson right here is not actually about transformers or modular arithmetic. It is that understanding would not at all times appear to be understanding whereas it is nonetheless forming. Generally it seems to be like nothing in any respect, proper up till it would not.
···
[1] A. Energy, Y. Burda, H. Edwards, I. Babuschkin and V. Misra, Grokking: Generalization Past Overfitting on Small Algorithmic Datasets (2022), arXiv:2201.02177
[2] N. Nanda, L. Chan, T. Lieberum, J. Smith and J. Steinhardt, Progress Measures for Grokking through Mechanistic Interpretability (2023), ICLR 2023
Observe: All photos had been created by the creator.















