Clustering and Alignment: Understanding the Training Dynamics in Modular Addition
Not on the map. Why?
Abstract (arXiv)
Recent studies have revealed that neural networks learn interpretable algorithms for many simple problems. However, little is known about how these algorithms emerge during training. In this article, I study the training dynamics of a small neural network with 2-dimensional embeddings on the problem of modular addition. I observe that embedding vectors tend to organize into two types of structures: grids and circles. I study these structures and explain their emergence as a result of two simple tendencies exhibited by pairs of embeddings: clustering and alignment. I propose explicit formulae for these tendencies as interaction forces between different pairs of embeddings. To show that my formulae can fully account for the emergence of these structures, I construct an equivalent particle simulation where I show that identical structures emerge. I discuss the role of weight decay in my setup and reveal a new mechanism that links regularization and training dynamics. To support my findings, I also release an interactive demo available at https://modular-addition.vercel.app/.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 13 of its 19 references that are in the map. First posted on arXiv 18 Aug 2024.
Builds on
13 of 19 references.
References · 13
- 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,400
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
- 2022Towards Understanding Grokking: An Effective Theory of Representation Learningcited by 229
- 2022Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational Limitcited by 184
- 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 153
- 2018Three Mechanisms of Weight Decay Regularizationcited by 112
- 2023Grokking modular arithmeticcited by 77
- 2023Why Do We Need Weight Decay in Modern Deep Learning?cited by 70
- 2023Understanding Addition in Transformerscited by 34
- 2023Learning the greatest common divisor: explaining transformer predictionscited by 33
- 2022How Much Does Attention Actually Attend? Questioning the Importance of Attention in Pretrained Transformerscited by 20
- 2024When Representations Align: Universality in Representation Learning Dynamicscited by 10
Built on by
Citing papers per year: 2024: 1; 2025: 2; 2026: 2.
5 papers.
- 2025The Geometry of Grokking: Norm Minimization on the Zero-Loss Manifoldcited by 8
- 2024Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformerscited by 7
- 2026Beyond Neural Collapse: Task-Intrinsic Geometry Governs Neural Representations in Modular Arithmeticcited by 2
- 2025Correspondence Between Ising Machines and Neural Networkscited by 1
- 2026Deciphering Two Training Clocks in Grokking via Deep Linear Network Theory with Conditional ReLU Reductioncited by 1
- 2026Beyond Neural Collapse: Task-Intrinsic Geometry Governs Neural Representations in Modular Arithmetic8 Jun 2026
- 2026Deciphering Two Training Clocks in Grokking via Deep Linear Network Theory with Conditional ReLU Reduction4 Jun 2026
- 2025The Geometry of Grokking: Norm Minimization on the Zero-Loss Manifold2 Nov 2025
- 2025Correspondence Between Ising Machines and Neural Networks2 Nov 2025
- 2024Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformers18 Nov 2024