On the geometry and topology of representations: the manifolds of modular addition
Gabriela Moisescu-Pareja, Gavin McCracken, Harley Wiltzer, Vincent Létourneau, Colin Daniels, Doina Precup, Jonathan Love
TL;DR
This paper shows that neural networks trained on the modular addition task $(a+b) \bmod n$ across architectures (MLP-Add, MLP-Concat, and uniform/trainable attention) learn representations that are topologically and geometrically equivalent. By modeling first-layer preactivations as combinations of simple sinusoidal components and invoking symmetry, the authors prove that the learned manifolds are either a vector-addition disc or a torus, with the disc arising as a projection of the torus. They empirically validate these predictions using phase distributions (Phase Alignment Distributions) and topological signatures (Betti numbers) across hundreds of networks, demonstrating that Clock and Pizza are not fundamentally distinct circuits but different factorizations of the same torus-to-circle map. The approach provides a scalable, quantitative toolkit (PADs and persistent homology) to compare learned representations and supports the universality hypothesis for modular addition, potentially informing interpretation and generalization to broader neural computation tasks.
Abstract
The Clock and Pizza interpretations, associated with architectures differing in either uniform or learnable attention, were introduced to argue that different architectural designs can yield distinct circuits for modular addition. In this work, we show that this is not the case, and that both uniform attention and trainable attention architectures implement the same algorithm via topologically and geometrically equivalent representations. Our methodology goes beyond the interpretation of individual neurons and weights. Instead, we identify all of the neurons corresponding to each learned representation and then study the collective group of neurons as one entity. This method reveals that each learned representation is a manifold that we can study utilizing tools from topology. Based on this insight, we can statistically analyze the learned representations across hundreds of circuits to demonstrate the similarity between learned modular addition circuits that arise naturally from common deep learning paradigms.
