Coverage versus within-epoch repetition at matched dose in transformer grokking
In a controlled transformer grokking experiment with matched per-example dose, unique training data coverage is the dominant factor driving the transition from memorization to generalization, while within-epoch repetition has no detectable effect on generalization speed but does delay memorization and improve sub-critical performance.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the author. For technical accuracy, refer to the original paper. Read full disclaimer
In the world of artificial intelligence, there is a persistent puzzle about how computers learn. When a machine is fed a massive amount of information, it often memorizes the specific facts first, reciting them back perfectly, before it ever figures out the underlying rules that govern them. This delay, where a system seems stuck in a state of rote learning before suddenly snapping into true understanding, is a phenomenon researchers call grokking. It raises a fundamental question for anyone building these systems: does a model learn better because it sees a wider variety of new examples, or because it sees the same examples over and over again? In the rush to train larger and more powerful models, practitioners often repeat data to fill up their training time, assuming that more exposure is always better. However, this assumption has rarely been tested in a controlled way that separates the sheer number of unique items a model sees from the frequency with which it encounters them.
A researcher at Dalian University of Technology set out to untangle these two factors using a small, manageable version of a modern AI model. The task was simple but precise: the model had to learn how to add two numbers together and then find the remainder when divided by a specific number, a process known as modular addition. There were exactly 529 unique problems to solve in this system. The researcher created a scenario where the model could be trained on anywhere from a quarter to nearly all of these unique problems. Crucially, the experiment was designed so that the total amount of work the computer did remained exactly the same in every case. This meant that if the model saw fewer unique problems, it had to see those same problems more times to reach the same total number of training steps. The researcher also varied how these repeated copies were arranged, sometimes placing identical copies right next to each other, and other times mixing them randomly throughout the training session.
The results were striking and clear. The factor that determined whether the model would ever succeed was the number of unique problems it saw, not how many times it repeated them. When the model was trained on a wide variety of problems, covering about eighty-five percent of the total set, it learned the rule quickly, often within a few thousand steps. As the variety of problems shrank, the time it took to learn stretched out significantly. When the model was shown only forty-five percent of the unique problems, it took nearly five times longer to reach the same level of understanding. Below a certain threshold, around thirty-five percent of the unique problems, the model almost never learned the rule, no matter how long it was trained. Even when the model was forced to repeat the limited set of problems many times, it failed to generalize. It could memorize the specific answers it had seen, but it could not figure out the pattern to solve new problems it had never encountered.
The study also looked closely at what happened when the model was given the same number of unique problems but repeated them more often. The data showed that repeating the examples did not speed up the moment the model finally understood the rule. Whether the copies were grouped together or scattered randomly, the timing of the breakthrough remained the same. This finding suggests that simply seeing a piece of data more frequently does not help the model cross the gap from memorization to generalization if the variety of data is insufficient. However, repetition did have a small side effect: it slightly slowed down the initial memorization phase and kept the model's internal mathematical weights slightly larger, hinting that the model was holding onto the memorized facts a bit more tightly.
Ultimately, this work clarifies a specific rule for this type of learning system. To move from simply remembering facts to understanding a rule, the model needs a broad foundation of unique examples. Repeating those examples, even in large quantities, cannot substitute for that breadth. If the training data lacks variety, the model will remain stuck in a state of memorization, unable to apply what it has learned to new situations. The transition to true understanding is gated by the coverage of the training set, not by the repetition of its contents. This insight offers a precise boundary for how data should be curated, suggesting that in constrained environments, the priority should be on gathering more distinct examples rather than cycling through the same ones repeatedly.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.