The Geometric Inductive Bias of Grokking: Bypassing Phase Transitions via Architectural Topology
Abstract
Prior work on grokking—delayed generalization after memorization—has sought to shorten this delay through data augmentation or optimizer design. We take an architectural approach: rather than analyzing trained networks post-hoc, we modify architectural topology before training to test whether specific degrees of freedom prolong the memorization phase. We identify two independent factors in standard Transformers—unbounded residual magnitude and data-dependent attention routing—and introduce targeted interventions for each. A fully bounded spherical topology, enforcing L2 normalization throughout the residual stream and bounding the output logits, accelerates generalization on modular addition and multiplication over Zp. On addition, the model generalizes even without weight decay, and test accuracy begins to rise before training accuracy reaches 100%. Independently, replacing learned attention with uniform aggregation also advances generalization on addition, removing data-dependent routing while retaining positional information in the value pathway. However, on non-Abelian S5 and A_5 permutation composition used as negative controls, the same spherical constraint shows no consistent acceleration over LayerNorm with matched heads in the tested settings and no generalization without weight decay. This contrast shows that the acceleration depends on the task and architectural configuration. These results suggest that geometric priors useful for cyclic arithmetic need not provide the same benefit across the heterogeneous structures present in general-purpose domains.