NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The Geometry and Topology of Modular Addition Representations

Gabriela Moisescu-Pareja, Gavin McCracken, Harley Wiltzer, Colin Daniels, Vincent Létourneau, Doina Precup, Jonathan Love

TL;DR

This paper investigates whether different neural network architectures for modular addition, specifically "Clock" and "Pizza" interpretations, learn fundamentally different internal representations. Using geometric and topological analyses, the authors demonstrate that these architectures, despite their architectural differences, learn topologically and geometrically equivalent representations, suggesting they implement the same underlying circuit.

What Problem Does This Paper Address?

The field of neural network interpretability often uses simplified tasks to understand how networks learn and represent information. Modular addition (e.g., a + b mod n) is a popular testbed because it's mathematically well-understood yet non-linearly separable, posing a challenge for neural networks. Two prominent interpretations, "Clock" and "Pizza," were proposed based on different architectural choices (specifically, attention mechanisms) to explain how networks solve this task. The core question this paper addresses is whether these distinct architectural interpretations actually lead to distinct internal computational circuits and representations, or if the differences are superficial.

Methods

The authors employ geometric and topological analyses to probe the learned representations within neural networks trained on modular addition. Key methods include:

  • Phase Alignment Distribution (PAD): This novel method analyzes how often neuron activations are maximized when input components are equal (i.e., a = b). This is done by training multiple models, sampling neurons, and identifying the input pair that yields the highest activation. Comparing PADs across architectures helps reveal similarities or differences in their learned representations.
  • Betti Numbers: These are topological invariants used to count "holes" of different dimensions in a manifold. By computing Betti numbers for the learned representations, the authors can distinguish between different topological structures (e.g., discs, circles, tori).
  • Maximum Mean Discrepancy (MMD): A statistical test used to measure the distance between two probability distributions. MMD is used here to quantify the similarity between the PADs of different architectures.
  • Geometric Analysis: The paper also leverages theoretical results about simple neurons and their phase distributions to predict whether representations should lie on a 2D disc (vector addition) or a 2D torus.

Datasets

The paper does not introduce new datasets. Instead, it trains and evaluates neural network models on the task of modular addition. The specific modular arithmetic task used is a + b mod n with n = 59. The models are trained on a 90%/10% train/test split.

Key Insights and Ideas

  • "Clock" and "Pizza" are (mostly) the same: The most striking insight is that the "Clock" and "Pizza" architectures, despite their proposed differences in attention mechanisms, learn topologically and geometrically equivalent representations. This suggests they are not implementing fundamentally different circuits for modular addition.
  • MLP-Concat is genuinely different: In contrast to "Clock" and "Pizza," a third architecture, "MLP-Concat," does produce a genuinely different representation, indicating a distinct circuit.
  • Phase distribution is key: The paper reinforces the idea that the distribution of learned phases in simple neurons dictates the resulting representation manifold (disc vs. torus).
  • Torus as the general case: The theoretical analysis suggests that a torus is the more general representation, and the disc (associated with vector addition) can be viewed as a projection of this torus. This provides a unifying geometric perspective.
  • Architectural bias shapes representation: The work highlights how architectural choices can strongly influence the geometry and topology of learned representations, guiding the network towards specific manifold structures.

Key Results

  • Topological Equivalence: Geometric and topological analyses (PAD, Betti numbers) show that "Clock" (Attention 1.0) and "Pizza" (Attention 0.0) architectures are topologically and geometrically equivalent. MMD scores between their PADs are very low (e.g., 0.0237 and 0.0181), indicating near-identical distributions.
  • Distinct MLP-Concat: MLP-Concat consistently shows significant differences from both "Clock" and "Pizza" across various metrics, including PAD and Betti number analysis.
  • Betti Number Progression: In early layers, MLP-Add and Attention variants tend towards disc-like representations, while MLP-Concat forms a torus. In later layers, all architectures converge towards circle-like representations (corresponding to the correct answer), but MLP-Concat reaches this faster.
  • Previous Metrics Fall Short: The paper demonstrates that previously proposed interpretability metrics (gradient symmetricity and distance irrelevance) are less effective at distinguishing between "Clock" and "Pizza" than the geometric and topological methods used in this study.

Limitations and Future Work

  • Modular Addition Specificity: The analysis is currently restricted to the modular addition task. While it provides insights into representation geometry, generalizing these findings to more complex tasks remains an open question.
  • Understanding "Why": The paper identifies that architectural bias shapes representation but suggests future work should explore why certain architectures lead to specific representational changes and others do not.
  • Universal Principles: The authors aim to find a guiding universal principle that unifies these representations, suggesting that the embeddings and logits are consistent, and the vector addition disc is a projection of the torus. Further exploration of this unifying principle is a promising direction.

Summary updated

BibTeX
@inproceedings{moisescupareja2026geometry,
  author = {Gabriela Moisescu-Pareja and Gavin McCracken and Harley Wiltzer and Colin Daniels and Vincent Létourneau and Doina Precup and Jonathan Love},
  title = {{The Geometry and Topology of Modular Addition Representations}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=2olkCiSELH},
}
Figure