Modular Arithmetic: Language Models Solve Math Digit by Digit

๐Ÿ“… 2025-08-04
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
This work investigates the internal mechanisms underlying arithmetic reasoning in large language models (LLMs), specifically examining whether numbers are represented and processed digit-wise (e.g., units, tens) and whether position-specific neural circuits exist. Combining feature attribution analysis with causal interventions, the study systematically identifies digit-position-specific neuron subgroups within MLP layers across multiple model scales and tokenization schemes. The key contribution is the first empirical demonstration of interpretable, compositional, and robust digit-position-specific circuitsโ€”stable across model sizes and tokenization strategies. Targeted ablation and activation editing of these circuits causally alter predictions for corresponding digit positions, confirming their functional necessity in arithmetic computation. This work establishes a new paradigm for interpretable numerical reasoning research in LLMs, providing structured, mechanistic evidence for how positional digit information is encoded and utilized.

Technology Category

Application Category

๐Ÿ“ Abstract
While recent work has begun to uncover the internal strategies that Large Language Models (LLMs) employ for simple arithmetic tasks, a unified understanding of their underlying mechanisms is still lacking. We extend recent findings showing that LLMs represent numbers in a digit-wise manner and present evidence for the existence of digit-position-specific circuits that LLMs use to perform simple arithmetic tasks, i.e. modular subgroups of MLP neurons that operate independently on different digit positions (units, tens, hundreds). Notably, such circuits exist independently of model size and of tokenization strategy, i.e. both for models that encode longer numbers digit-by-digit and as one token. Using Feature Importance and Causal Interventions, we identify and validate the digit-position-specific circuits, revealing a compositional and interpretable structure underlying the solving of arithmetic problems in LLMs. Our interventions selectively alter the model's prediction at targeted digit positions, demonstrating the causal role of digit-position circuits in solving arithmetic tasks.
Problem

Research questions and friction points this paper is trying to address.

Understand digit-wise arithmetic mechanisms in LLMs
Identify digit-position-specific circuits in LLMs
Validate causal role of circuits in arithmetic tasks
Innovation

Methods, ideas, or system contributions that make the work stand out.

Digit-position-specific circuits in LLMs
Modular subgroups of MLP neurons
Feature Importance and Causal Interventions
๐Ÿ”Ž Similar Papers
No similar papers found.
Tanja Baeumel
Tanja Baeumel
PhD Student, German Research Center for Artificial Intelligence
Natural Language ProcessingLLM Interpretability
D
Daniil Gurgurov
German Research Center for AI (DFKI), Saarland University
Y
Yusser Al Ghussin
German Research Center for AI (DFKI), Saarland University
Josef van Genabith
Josef van Genabith
DFKI German Research Center for Artificial Intelligence, Saarland University
Natural Language ProcessingMachine TranslationComputational LinguisticsComputational Semantics
S
Simon Ostermann
German Research Center for AI (DFKI), Saarland University, Center for European Research in Trusted AI (CERTAIN)