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 \mapsto 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 $\le 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
Large Language Models (LLMs) have demonstrated remarkable proficiency in complex mathematical reasoning, often solving graduate-level calculus or competition-level word problems. However, a persistent "LLM Paradox" remains: these same models frequently stumble on basic multi-digit arithmetic. This study investigates whether LLM success in arithmetic stems from genuine rule induction—internalizing the algorithm of addition—or merely sophisticated token-level pattern matching.
Methodology
To probe the depth of LLM understanding, we developed a diagnostic framework centered on two-integer addition (ranging from $0$ to $2^{64}$). We evaluated 12 leading models, including GPT-4o, Claude-3.5-Sonnet, and the Llama and Qwen families, across three fundamental properties:
- Digit-Scaling Consistency: We tested whether accuracy decreases monotonically as operand length increases, as would be expected from a consistent algorithmic execution.
- Representation Invariance: We assessed whether models could perform addition when digits were bijectively mapped to arbitrary symbols (e.g., $7 \mapsto Y$). True rule induction should be invariant to the specific symbols used.
- Algebraic Integrity: We checked for violations of commutativity ($A+B = B+A$), a core axiom of addition.
Our benchmark dataset consists of 100,000 unique problems, categorized into baseline pairs, digit-scaling sets (3 to 20 digits), and symbolic variants.
Results: The Pattern Matching Reality
The evaluation revealed a stark contrast between numeric performance and rule-based reasoning.
The Symbolic Collapse
While models achieved high numeric accuracy (73.8%–99.8%), their performance evaporated when faced with symbolic remapping. For instance, Claude-3.5-Sonnet's accuracy plummeted from 99.81% on standard numbers to just 7.51% on symbolic tasks. This suggests that "reasoning" is heavily tied to specific digit tokens rather than the underlying logic of addition.
Non-Monotonic Scaling and Commutativity
Instead of a steady decline in accuracy with increasing digits, many models exhibited a "drop-rebound" pattern. Performance often dipped for 4–6 digit numbers but improved for 8–10 digit numbers, likely reflecting the prevalence of specific lengths (like phone numbers) in training data. Furthermore, models frequently violated commutativity, failing to provide consistent answers when operand order was swapped in up to 20% of cases.
The Failure of Explicit Rules
Surprisingly, providing models with explicit addition rules (e.g., "add the ones place, carry the one") often degraded performance by nearly 30%. Models struggled to operationalize abstract instructions, defaulting to brittle statistical heuristics. While specialized reasoning models like DeepSeek-R1 showed improved abstraction, they still exhibited significant gaps in symbolic tasks.
Discussion and Conclusion
Our findings demonstrate that current LLMs address elementary addition via pattern matching rather than robust rule induction. The "Symbolic Collapse" and commutativity violations prove that these models rely on surface-level associations.
Future research should focus on architectural innovations and training methodologies that encourage models to learn abstract, execution-grounded rules. Developing benchmarks that strip away familiar context, such as our symbolic diagnostic, will be essential for measuring genuine progress toward mathematical reasoning in artificial intelligence.
The dataset and code are available at https://github.com/kuri-leo/llm-arithmetic-diagnostic.
Summary updated