Do Large Language Models Truly Grasp Addition? A Rule-Focused Diagnostic Using Two-Integer Arithmetic

Yan Yang, Lu Yu, Ruozhou Xu, Zhenzhong Lan

Abstract

Large language models (LLMs) achieve impressive results on advanced mathematics benchmarks but sometimes fail on basic arithmetic tasks, raising the question of whether they have truly grasped fundamental arithmetic rules or are merely relying on pattern matching. To unravel this issue, we systematically probe LLMs' understanding of two-integer addition (0 to $2^{64}$) by testing three crucial properties: commutativity ($A + B = B + A$), representation invariance via symbolic remapping (e.g., $7 \to Y$), and consistent accuracy scaling with operand length. Our evaluation of 12 leading LLMs reveals a stark disconnect: while models achieve high numeric accuracy (73.8-99.8%), they systematically fail these diagnostics. Specifically, accuracy plummets to 7.5% with symbolic inputs, commutativity is violated in up to 20% of cases, and accuracy scaling is non-monotonic. Interventions further expose this pattern-matching reliance: explicitly providing rules degrades performance by 29.49%, while prompting for explanations before answering merely maintains baseline accuracy. These findings demonstrate that current LLMs address elementary addition via pattern matching, not robust rule induction, motivating new diagnostic benchmarks and innovations in model architecture and training to cultivate genuine mathematical reasoning.

Introduction

A fundamental paradox has emerged in modern AI: Large Language Models (LLMs) can solve graduate-level calculus yet frequently stumble on multi-digit addition. This research, presented at EMNLP 2025, investigates whether LLMs have internalized the algorithmic rules of arithmetic or are simply sophisticated pattern matchers relying on token-level heuristics.

Methodology: Probing for Rule Induction

To isolate reasoning from memorization, the researchers stripped away linguistic complexity and focused on two-integer addition. They proposed that any model with a genuine grasp of addition must satisfy three core properties:

  1. Digit-scaling consistency: Performance should decrease predictably as numbers grow longer.
  2. Algebraic integrity (Commutativity): The model must consistently yield $A + B = B + A$.
  3. Representation invariance: The model should maintain performance when digits are replaced by arbitrary symbols (e.g., $1 \to \text{'a'}$), provided the mapping rules are defined.

The study utilized a new diagnostic dataset of 100,000 unique problems, ranging from 0 to $2^{64}$, across 12 leading models including GPT-4, Claude, Llama, and Qwen.

Key Findings

The Symbolic Collapse

The most striking evidence of pattern matching is "representation fragility." While top-tier models like Claude-3.5-Sonnet achieve near-perfect accuracy (99.8%) on standard numeric addition, their performance collapses to approximately 7.5% when digits are remapped to symbols.

Comparison of zero-shot numeric accuracy versus symbolic accuracy across various model families as digit counts increase.

As shown in the figure above, numeric accuracy often exhibits a "drop-rebound" pattern—dropping for 4-6 digit numbers but improving for 8-10 digits—suggesting models rely on common number lengths found in training data (like phone numbers). In contrast, symbolic accuracy declines monotonically, reflecting a failure to generalize the underlying algorithm to novel tokens.

Violations of Mathematical Logic

Models frequently fail basic logical tests. Commutativity is violated in up to 20% of cases, where a model provides different answers for $A+B$ and $B+A$. Furthermore, providing explicit rules (e.g., "add the ones place, carry the 1") often acted as "poison," degrading performance by nearly 30% as logical instructions conflicted with ingrained pattern-matching heuristics.

Examples of LLM success and failure cases in arithmetic tasks, highlighting issues with commutativity and symbolic mapping.

Conclusion

The systematic failure of LLMs on symbolic remapping and commutativity diagnostics suggests that current architectures prioritize surface-level pattern matching over robust rule induction. To move toward genuine reasoning, future research must focus on training objectives and architectures that explicitly reward algorithmic abstraction over memorized token sequences.

The dataset and generation code are available at https://github.com/kuri-leo/llm-arithmetic-diagnostic.

Summary updated

BibTeX
@misc{yang2025do,
  author = {Yan Yang and Lu Yu and Ruozhou Xu and Zhenzhong Lan},
  title = {{Do Large Language Models Truly Grasp Addition? A Rule-Focused Diagnostic Using Two-Integer Arithmetic}},
  year = {2025},
  eprint = {2504.05262},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.05262},
}
Figure