Grokking, Visualized
A small transformer learned to add numbers on a 113-hour clock. For thousands of steps it seemed only to have memorised; meanwhile it was building a general algorithm, and then, suddenly, it understood. This site shows — with the real network's weights, activations, gradients and outputs at every moment of training — what it learned and how it got there, explained step by step from scratch.
Loss during training (log scale)
Training loss (blue) and test loss (red) at every 10th step; shaded bands are the three phases.
Loading…
How to read it · the math
Each curve is the average cross-entropy loss over its set of inputs. The vertical axis is a logarithmic scale, so each grid line is a factor of 10. Click anywhere to move the whole page to that step.
What to expect: Train loss falls during memorisation (until step 1,567 on the paper's run) while test loss rises, then, thousands of steps later, test loss collapses (grokking).
What you will find here
- 22 chapters that build everything from “what is a remainder?” to the paper's progress measures, defining every term and symbol before it is used, with worked examples and exact (short) quotes from the sources.
- One big dashboard with every visualization linked together: drag through training and watch the network's embeddings turn into circles, its neurons into waves, and its memorisation melt away.
- The real thing: the paper's own published training run [7], re-analysed with code that reproduces 26 of the 30 reported numbers and claims we checked, plus 22 networks we retrained ourselves: 16 of them (with and without weight decay) test the claims with preregistered statistics, the other 6 are descriptive controls.
Based on Nanda, Chan, Lieberum, Smith and Steinhardt, Progress measures for grokking via mechanistic interpretability (ICLR 2023) [1], the ARENA course chapter on grokking [3], and the videos by Neel Nanda with Jess Smith and Lawrence Chan, and by Welch Labs [8] [9] [10]. Built by Libor Burian. Code and data on GitHub.