The Geometric Inductive Bias of Grokking: Bypassing Phase Transitions via Architectural Topology
Organizations: Independent Researcher
Abstract
Mechanistic interpretability typically relies on post-hoc analysis of trained networks. We instead adopt an interventional approach: testing hypotheses a priori by modifying architectural topology to observe training dynamics. We study grokking - delayed generalization in Transformers trained on cyclic modular addition (Zp) - investigating if specific architectural degrees of freedom prolong the memorization phase. We identify two independent structural factors in standard Transformers: unbounded representational magnitude and data-dependent attention routing. First, we introduce a fully bounded spherical topology enforcing L2 normalization throughout the residual stream and an unembedding matrix with a fixed temperature scale. This removes magnitude-based degrees of freedom, reducing grokking onset time by over 20x without weight decay. Second, a Uniform Attention Ablation overrides data-dependent query-key routing with a uniform distribution, reducing the attention layer to a Continuous Bag-of-Words (CBOW) aggregator. Despite removing adaptive routing, these models achieve 100% generalization across all seeds and bypass the grokking delay entirely. To evaluate whether this acceleration is a task-specific geometric alignment rather than a generic optimization stabilizer, we use non-commutative S5 permutation composition as a negative control. Enforcing spherical constraints on S5 does not accelerate generalization. This suggests eliminating the memorization phase depends strongly on aligning architectural priors with the task's intrinsic symmetries. Together, these findings provide interventional evidence that architectural degrees of freedom substantially influence grokking, suggesting a predictive structural perspective on training dynamics.
Figures & tables
| Learning Rate | Architecture | Mean Grok Epoch | Std Dev | Min | Max | Failures | Peak Acc. |
|---|---|---|---|---|---|---|---|
| LayerNorm (Baseline) | 54,160 | 13,490 | 32,800 | 71,600 | 0 / 10 | 100% | |
| RMSNorm (Baseline) | 51,240 | 11,200 | 38,800 | 74,600 | 0 / 10 | 100% | |
| Bounded Sphere ( ) | 2,400 | 353 | 1,800 | 3,000 | 0 / 10 | 100% | |
| Bounded Sphere ( ) | 2,480 | 464 | 1,800 | 3,200 | 0 / 10 | 100% | |
| Bounded Sphere + Fourier Init ( ) | 2,120 | 368 | 1,600 | 2,600 | 0 / 10 | 100% | |
| Bounded Sphere + Fourier Init ( ) | 2,100 | 316 | 1,800 | 2,600 | 0 / 10 | 100% |
| Architecture | Mean 95% Epoch | Std Dev | Min | Max | Hits |
|---|---|---|---|---|---|
| LayerNorm (Baseline) | 28,220 | 3,676 | 19,600 | 32,400 | 10 / 10 |
| RMSNorm (Baseline) | 31,360 | 4,056 | 25,600 | 38,600 | 10 / 10 |
| Bounded Sphere ( ) | 2,320 | 223 | 2,000 | 2,800 | 10 / 10 |
| Bounded Sphere ( ) | 2,200 | 253 | 1,800 | 2,600 | 10 / 10 |
| Architecture (Uniform Attention) | Mean Peak Acc. | Max Peak Acc. | Success Rate (100% Acc) |
|---|---|---|---|
| LayerNorm Baseline (WD=1.0) | 100.00% | 100.00% | 10 / 10 |
| Bounded Sphere ( ) | 97.65% | 100.00% | 6 / 10 |
| Bounded Sphere ( ) | 100.00% | 100.00% | 10 / 10 |
| Architecture | Mean Grok Epoch | Std Dev | Min | Max | Failures |
|---|---|---|---|---|---|
| LayerNorm (Baseline) | 39,900 | 11,942 | 24,400 | 58,400 | 2 / 10 |
| RMSNorm (Baseline) | 38,250 | 23,600 | 19,000 | 91,600 | 2 / 10 |
| Bounded Sphere ( ) | Failed | – | – | – | 10 / 10 |
| Bounded Sphere ( ) | Failed | – | – | – | 10 / 10 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Architecture (Uniform Attention) | Mean Peak Acc. | Max Peak Acc. | Success Rate (100%) |
|---|---|---|---|
| LayerNorm Baseline (WD=1.0) | 99.12% | 99.42% | 0 / 5 |
| RMSNorm Baseline (WD=1.0) | 99.65% | 99.94% | 0 / 5 |
| Bounded Sphere ( ) | 2.84% | 3.42% | 0 / 5 |
| Bounded Sphere ( ) | 2.41% | 2.54% | 0 / 5 |
| Design Choice | nGPT | Ours (Intervention A) |
|---|---|---|
| Goal | Faster LM pretraining | Mechanistic hypothesis test |
| Weight matrix normalization | All matrices, all layers | None |
| Hidden state update | Learnable interpolation | Residual add + hard projection |
| Learnable step sizes | Per-dimension | None |
| Compensatory scaling | 6 parameter families | None |
| Unembedding scaling | Learnable per-token | Fixed scalar |