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

A Group Theoretic Analysis of the Symmetries Underlying Base Addition and Their Learnability by Neural Networks

Cutter Dawes, Simon N. Segert, Kamesh Krishnamurthy, Jonathan D. CohenarXiv 2025 · DOI

Abstract

This study investigates the mathematical foundations of arithmetic addition through the lens of group theory to understand how neural networks achieve radical generalization. By formalizing the "carry" rule as a cocycle within a group extension, we explore a vast space of mathematically valid carry functions. Our findings reveal that the structural complexity and symmetry of these functions—measured via fractal dimension and associativity fractions—directly dictate the ease with which recurrent neural networks (RNNs) can learn and generalize the underlying algorithm. We demonstrate that the standard "carry the one" rule is a highly symmetric, low-complexity solution that facilitates near-perfect generalization from small training sets to significantly larger numerical sequences.

Introduction

A fundamental challenge in artificial intelligence is "radical generalization": the capacity for a model to learn a rule from small-scale examples and apply it flawlessly to arbitrarily large inputs. In the context of arithmetic, this requires a model to discover the underlying algorithmic kernel—the carry function—rather than simply memorizing digit patterns. While humans are taught a specific "carry the one" rule, group theory suggests that this is merely one of many possible ways to define consistent addition. This paper seeks to formalize the space of possible carry functions and determine why certain rules are more learnable by neural architectures than others.

Mathematical Framework: Addition as Group Extension

To analyze the structure of addition, we bridge abstract algebra and deep learning using Group Cohomology. We define base addition as a group extension of integers modulo $b$ ($\mathbb{Z}_b$). Within this framework, the carry function is treated as a cocycle—a mathematical object that ensures the resulting addition remains associative and consistent across multiple digits.

To quantify the complexity of different carry rules, we employ two primary measures:

  1. Fractal Dimension (Box-counting): This measures the geometric complexity of the carry table (a 2D matrix representing carry values for digit pairs). Higher dimensions indicate more "jagged" or complex patterns.
  2. Associativity Fraction: This measures the degree to which a given carry rule satisfies the associative property $(a+b)+c = a+(b+c)$. This serves as a proxy for the inherent symmetry of the operation.

Experimental Methodology

We trained Recurrent Neural Networks (specifically GRUs and LSTMs) to perform column addition using synthetic datasets across bases 3, 4, and 5. The models were trained on all possible pairs of 3-digit numbers and tested on their ability to generalize to 6-digit and 10-digit numbers—well outside the training distribution.

To optimize the models' ability to latch onto the underlying symmetry, we utilized an interleaved input format (e.g., $n_1, m_1, \text{result}_1, n_2, m_2 \dots$). This format leverages the RNN's weight-sharing over time to better process the serial nature of the carry operation. We also compared Symbolic (one-hot) embeddings with Semantic embeddings, where digits are represented as Gaussian envelopes to reflect ordinal distance.

Key Results and Insights

The Primacy of Symmetry

Our analysis confirms that the standard "1-carry" used by humans is a "Single Value" carry, which represents the most compact and symmetric form of the operation. There is a stark performance gap between these Single Value carries and more complex "Multiple Value" carries. Models trained on highly associative (symmetric) rules achieved near-perfect radical generalization, reaching 100% accuracy on 10-digit numbers despite only seeing 3-digit examples during training.

Complexity and Learnability

We found powerful correlations between the mathematical properties of a carry rule and a neural network's ability to master it:

  • Fractal Dimension: We observed a Spearman correlation of $\rho = -0.872$, indicating that as the geometric complexity of the carry table increases, model accuracy decreases significantly.
  • Associativity Fraction: We observed a Spearman correlation of $\rho = 0.887$, confirming that higher mathematical symmetry directly translates to higher learnability.

Formatting as Inductive Bias

The choice of data presentation proved as critical as the architecture itself. The interleaved digit format allowed the RNN to effectively discover the carry symmetry, suggesting that the way information is structured can act as a powerful inductive bias for algorithmic discovery.

Discussion and Limitations

This research provides a normative account for why certain arithmetic rules, like the standard carry, are favored: they are the simplest, most symmetric solutions in the space of possible operations. However, several avenues for future work remain:

  • Operational Scope: This study focused exclusively on addition. Future research should investigate if group theoretic insights apply to non-linear operations like multiplication.
  • Scaling: Due to the combinatorial growth of possible carry functions, this study was limited to small bases (up to base 5). Testing these theories on base 10 remains a computational challenge.
  • Architectural Diversity: While RNNs are naturally suited for serial addition, exploring how Transformers or Large Language Models (LLMs) implicitly learn these symmetries during pre-training is a vital next step.

In conclusion, by formalizing arithmetic through group cohomology, we demonstrate that the learnability of an algorithm is deeply intertwined with its mathematical symmetry. Neural networks, much like humans, possess an inductive bias toward simplicity and high associativity, allowing them to transcend pattern matching and achieve true algorithmic generalization.

Summary updated

BibTeX
@misc{dawes2025group,
  author = {Cutter Dawes and Simon N. Segert and Kamesh Krishnamurthy and Jonathan D. Cohen},
  title = {{A Group Theoretic Analysis of the Symmetries Underlying Base Addition and Their Learnability by Neural Networks}},
  year = {2025},
  eprint = {2507.10678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.10678},
}
Figure