Grokking From Abstraction to Intelligence
Abstract
Grokking in modular arithmetic has established itself as the quintessential fruit fly experiment, serving as a critical domain for investigating the mechanistic origins of model generalization. Despite its significance, existing research remains narrowly focused on specific local circuits or optimization tuning, largely overlooking the global structural evolution that fundamentally drives this phenomenon. We propose that grokking originates from a spontaneous simplification of internal model structures governed by the principle of parsimony. We integrate causal, spectral, and algorithmic complexity measures alongside Singular Learning Theory to reveal that the transition from memorization to generalization corresponds to the physical collapse of redundant manifolds and deep information compression, offering a novel perspective for understanding the mechanisms of model overfitting and generalization.
Figures & tables
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Item | Specification |
|---|---|
| Task | Modular arithmetic over ; operations ; for exclude . |
| Input/target format | Input tokens: (length 4); target token . |
| Vocabulary | , . |
| Dataset construction | Enumerate all valid input pairs. Total pairs: for and for . |
| Train/test split | Random split by input pairs with a fixed PRNG seed. Default split: 50%/50%. For : 4704 train / 4705 test; for : 4656 train / 4656 test. Split seed = 0. |
| Evaluation | Report train and test accuracy (exact match) and cross-entropy loss. Evaluate every 100 steps and additionally at checkpoints 0.1k/1k/10k/100k steps. |
| Item | Specification |
|---|---|
| Architecture family | Decoder-only Transformer (GPT-2 style), 48 layers. |
| Context length | (inputs are length-4 token sequences). |
| Model width | Embedding/hidden size ; MLP size (MLP ratio 4). |
| Attention | Num heads ; head dim . |
| Dropout | Attention/MLP dropout = 0.0. |
| Normalization | Pre-LN with LayerNorm. |
| Item | Default training hyperparameters |
|---|---|
| Optimizer | AdamW. |
| AdamW params | . |
| Learning rate | Peak LR ; min LR . |
| LR schedule | Linear warmup for 1000 steps (1% of total), then cosine decay to . |
| Batch size | Global batch size = 512 sequences; gradient accumulation = 1. |
| Weight decay | for the main experiments; applied as decoupled weight decay (AdamW). |
| Analysis / ablation | What is varied and what is reported |
|---|---|
| Seed sensitivity | For each key figure, repeat over the seed set in Table 3 ; plot mean trajectory and shaded std (train/test). |
| Weight decay sweep | ; report grokking onset distribution across seeds and the fraction of runs that grok. |
| Learning-rate sweep | (schedule unchanged); report whether grokking occurs and time-to-grok. |
| Warmup sweep | Warmup steps (total steps fixed at 100k); report impact on memorization length and generalization onset. |
| Batch-size sweep | Global batch size ; keep total steps fixed; report variance and onset shift. |
| Early-stopping check | Not used in main experiments; when enabled for a control, monitor test accuracy with patience 10,000 steps. |
Grokking
Grokking is delayed generalization in which neural networks memorize training data before abruptly learning a rule that works on unseen examples.
See all 77 papers