Are Arithmetic Heuristic Neurons Form-Invariant? A Mechanistic Analysis of Symbols, Text, and Code in LLMs

arXiv cs.CL Papers

Summary

This paper investigates whether arithmetic heuristic neurons in LLMs are form-invariant across symbolic arithmetic, natural language word problems, and Python code. Using activation patching, they find a shared circuit of neurons that is necessary and sufficient for arithmetic computation, and that cross-format failures arise from activation states rather than distinct circuits.

arXiv:2607.16693v1 Announce Type: new Abstract: Large language models often succeed on one formulation of a problem while failing on an equivalent formulation. Whether these failures arise from distinct internal circuits or different activation states of a shared circuit remains unknown. Recent mechanistic interpretability studies suggest that arithmetic in LLMs emerges from a "bag of heuristics," encoded by a sparse set of MLP neurons that represent distinct arithmetic strategies. We investigate whether arithmetic heuristic neurons are form-invariant across symbolic arithmetic, natural language word problems, and Python code in three Llama-3 models. In each format, we identify arithmetic heuristic neurons using a two-stage pipeline combining attribution patching and activation patching. A compact set of neurons is shared across all three formats, and targeted interventions show this shared circuit is both necessary and sufficient for late-layer arithmetic computation. Transferring the shared neurons' activations from a successful execution in one format to a failed execution in another recovers most incorrect predictions, exceeding 97% for addition and subtraction, indicating that cross-format failures arise from activation states rather than distinct circuits. Moreover, shared neurons consistently belong to the same heuristic families across formats, demonstrating that arithmetic computation in LLMs is largely form-invariant at the neuron level.
Original Article
View Cached Full Text

Cached at: 07/21/26, 06:43 AM

# Are Arithmetic Heuristic Neurons Form-Invariant? A Mechanistic Analysis of Symbols, Text, and Code in LLMs
Source: [https://arxiv.org/html/2607.16693](https://arxiv.org/html/2607.16693)
Sharath Naganna1,\*,†Tanvir Ahmed Sijan2,\*Uddipta Kalita3

1Indian Institute of Technology Bombay, Mumbai, India 2Jahangirnagar University, Dhaka, Bangladesh 3National Institute of Technology, Silchar, India sharathhn@cse\.iitb\.ac\.in\{sijantanv, uddiptain20\}@gmail\.com \*Equal contribution†Corresponding author

###### Abstract

Large language models often succeed on one formulation of a problem while failing on an equivalent formulation\. Whether these failures arise from distinct internal circuits or different activation states of a shared circuit remains unknown\. Recent mechanistic interpretability studies suggest that arithmetic in LLMs emerges from a "bag of heuristics," encoded by a sparse set of MLP neurons that represent distinct arithmetic strategies\. We investigate whether arithmetic heuristic neurons are form\-invariant across symbolic arithmetic, natural language word problems, and Python code in three Llama\-3 models\. In each format, we identify arithmetic heuristic neurons using a two\-stage pipeline combining attribution patching and activation patching\. A compact set of neurons is shared across all three formats, and targeted interventions show this shared circuit is both necessary and sufficient for late\-layer arithmetic computation\. Transferring the shared neurons’ activations from a successful execution in one format to a failed execution in another recovers most incorrect predictions, exceeding 97% for addition and subtraction, indicating that cross\-format failures arise from activation states rather than distinct circuits\. Moreover, shared neurons consistently belong to the same heuristic families across formats, demonstrating that arithmetic computation in LLMs is largely form\-invariant at the neuron level\.

Are Arithmetic Heuristic Neurons Form\-Invariant? A Mechanistic Analysis of Symbols, Text, and Code in LLMs

Sharath Naganna1,\*,†Tanvir Ahmed Sijan2,\*Uddipta Kalita31Indian Institute of Technology Bombay, Mumbai, India2Jahangirnagar University, Dhaka, Bangladesh3National Institute of Technology, Silchar, Indiasharathhn@cse\.iitb\.ac\.in\{sijantanv, uddiptain20\}@gmail\.com\*Equal contribution†Corresponding author

## 1Introduction

Large language models \(LLMs\) have demonstrated remarkable mathematical capabilities, achieving impressive performance on challenging arithmetic and mathematical reasoning benchmarks\(Cobbe et al\.,[2021](https://arxiv.org/html/2607.16693#bib.bib5); Hendrycks et al\.,[2020](https://arxiv.org/html/2607.16693#bib.bib15); Wei et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib33)\)\. These advances have established LLMs as powerful mathematical problem solvers, capable of tackling problems ranging from elementary arithmetic to graduate\-level mathematics\. Consequently, understanding how these models internally represent and perform mathematical computation has become an important research direction, motivating a growing body of work in mechanistic interpretability aimed at uncovering the neural mechanisms underlying arithmetic reasoning\(Stolfo et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib29); Wu et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib34); Marjieh et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib20)\)\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x1.png)Figure 1:Three prompt formats used in our experiments\. Each expresses the same arithmetic computation as symbolic arithmetic, Python code, or a natural language word problem\. The answer is always generated as a single token at the final position\.Recent mechanistic interpretability studies have begun identifying the internal neural circuits responsible for arithmetic computation in LLMs\. In particular,Nikankin et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib25)\)demonstrate that LLMs solve arithmetic problems using a “bag of heuristics,” where distinct neurons encode different arithmetic strategies and can be causally manipulated to influence model predictions\. While these findings provide compelling evidence that arithmetic behavior emerges from identifiable neural mechanisms, they are derived almost exclusively from canonical symbolic expressions\(Baeumel et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib1); Du et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib9); Nikankin et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib25)\)\. Consequently, it remains unclear whether the same arithmetic neurons generalize across alternative representations of the same computation or are specific to a particular input format\.

This question is particularly important because previous studies have shown that LLMs are highly sensitive to the formulation of mathematical problems, where even small changes to a problem’s surface form, such as paraphrasing, adding new statements, or altering the presentation while preserving the underlying computation, can lead to substantial performance degradation\(Li et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib17)\)\. LLMs also exhibit noticeable variance in their performance when responding to different instantiations of same problem\(Mirzadeh et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib22)\)\.

From a mechanistic perspective, however, the source of this sensitivity remains poorly understood\. While recent studies have shown that LLMs separate problem abstraction\(Cheng et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib4)\)and operand routing\(Mamidanna et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib19)\)from the final computation, it remains unclear whether the same neuron\-level arithmetic heuristics are recruited across fundamentally different input formats, namely symbolic equations, word problems, and code\.

Motivated by this gap, we investigate the following research questions:

- •RQ1: Are arithmetic heuristic neurons form\-invariant?Do mathematically equivalent problems expressed as symbolic equations, word problems, and code recruit the same arithmetic heuristic neurons?
- •RQ2: What causes cross\-format failures?Do performance differences across formats arise from distinct arithmetic circuits or different activation states of a shared circuit?

Code and data for reproducing our experiments are available\.111[https://github\.com/SharathHN/format\-invariant\-arithmetic](https://github.com/SharathHN/format-invariant-arithmetic)

![Refer to caption](https://arxiv.org/html/2607.16693v1/x2.png)Figure 2:Overview of the pipeline\.\(Left\) We identify the top\-k causal neurons independently for symbolic arithmetic, word problems, and code, computing their layer\-wise intersection to isolate the shared circuit\. \(Middle\) We evaluate whether these shared neurons are sufficient and necessary for arithmetic computation via Keep\-Only \(retaining only shared activations\) and Knockout \(ablating only shared activations\) interventions\. \(Right\) We transfer the activations of the shared neurons from a successful donor execution to a failed target execution, testing whether cross\-format failures stem from differences in activation states rather than distinct arithmetic circuits\.
## 2Related Work

### 2\.1Mechanistic Interpretability

Mechanistic interpretability \(MI\) aims to reverse\-engineer the internal mechanisms of language models by analyzing their learned weights and computational components\. In transformer\-based LLMs, computations are often understood in terms of circuits, small sets of interacting components, such as MLP neurons and attention heads, that collectively implement a specific function\(Baeumel et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib1); Gould et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib13)\)\. To identify these circuits, mechanistic interpretability relies heavily on causal mediation techniques\(Pearl,[2013](https://arxiv.org/html/2607.16693#bib.bib27)\), which localize model behavior to specific internal components\. Representative methods include activation patching\(Meng et al\.,[2022](https://arxiv.org/html/2607.16693#bib.bib21); Zhang et al\.,[2024a](https://arxiv.org/html/2607.16693#bib.bib36)\), path patching\(Goldowsky\-Dill et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib12); Wang et al\.,[2022](https://arxiv.org/html/2607.16693#bib.bib31)\), attribution patching\(Nanda,[2023](https://arxiv.org/html/2607.16693#bib.bib23); Syed et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib30); Hanna et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib14)\), and logit attribution\(nostalgebraist,[2020](https://arxiv.org/html/2607.16693#bib.bib26); Belrose et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib2)\)\.

### 2\.2Arithmatic Reasoning Interpretability

Recent mechanistic interpretability studies have begun to uncover how LLMs perform arithmetic reasoning\. Circuit analyses have identified specialized model components that play causal roles in arithmetic computation\(Stolfo et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib29); Zhang et al\.,[2024b](https://arxiv.org/html/2607.16693#bib.bib37)\), while subsequent work suggests that arithmetic emerges from collections of heuristic neurons\(Nikankin et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib25)\)rather than a single coherent algorithm\(Nanda et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib24); Zhong et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib38); Ding et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib8)\)\. Alternative explanations propose that LLMs rely on symbolic pattern matching\(Deng et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib7)\), dual\-pathway computation separating coarse and fine\-grained numerical processing\(Lindsey et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib18)\), or geometric representations of numbers that support arithmetic operations\(Kantamneni and Tegmark,[2025](https://arxiv.org/html/2607.16693#bib.bib16)\)\. More recently,Cheng et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib4)\)showed that LLMs solve arithmetic word problems through an abstract\-then\-compute mechanism, in which models first construct an abstract representation of the underlying arithmetic operation before executing the computation\. They further showed that these abstract representations are invariant to different natural language formulations of the same problem\. Relatedly,Mamidanna et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib19)\)identified a sparse attention subgraph that routes operands to the last token position for direct arithmetic\. However, they found this subgraph fails on word problems and code, suggesting that while the core routing mechanism generalizes across simple text prompts, complex formats require additional computational components for deeper semantic and syntactic parsing\.

Building upon this line of work, we investigate whether arithmetic heuristic neurons themselves are form\-invariant\. Specifically, we systematically identify and causally validate arithmetic heuristic neurons to determine whether the same neurons are recruited to perform equivalent computations across different formats, namely symbolic arithmetic, word problems, and code\.

## 3Background

### 3\.1MLPs as Key\-Value Memories

Transformer layers consist of two primary components: a multi\-head self\-attention module, which routes information across tokens, and a Multi\-Layer Perceptron \(MLP\), which performs nonlinear transformations independently at each token position\. Following the key\-value memory interpretation ofGeva et al\. \([2021](https://arxiv.org/html/2607.16693#bib.bib11),[2022](https://arxiv.org/html/2607.16693#bib.bib10)\), the MLP can be expressed as

𝐲=σ​\(𝐱𝐊\)​𝐕,\\mathbf\{y\}=\\sigma\(\\mathbf\{x\}\\mathbf\{K\}\)\\mathbf\{V\},\(1\)
where𝐱∈ℝd\\mathbf\{x\}\\in\\mathbb\{R\}^\{d\}and𝐲∈ℝd\\mathbf\{y\}\\in\\mathbb\{R\}^\{d\}denote the input and output representations,𝐊∈ℝd×dmlp\\mathbf\{K\}\\in\\mathbb\{R\}^\{d\\times d\_\{\\mathrm\{mlp\}\}\}and𝐕∈ℝdmlp×d\\mathbf\{V\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{mlp\}\}\\times d\}are the up\-projection and down\-projection weight matrices, respectively, andσ​\(⋅\)\\sigma\(\\cdot\)is a nonlinear activation function\. Omitting the bias terms, the MLP can be decomposed into individual neurons as

𝐲=∑i=1dmlpσ​\(𝐱⋅𝐊:,i\)​𝐕i,:=∑i=1dmlpHi​𝐕i,:,\\mathbf\{y\}=\\sum\_\{i=1\}^\{d\_\{\\mathrm\{mlp\}\}\}\\sigma\(\\mathbf\{x\}\\cdot\\mathbf\{K\}\_\{:,i\}\)\\mathbf\{V\}\_\{i,:\}=\\sum\_\{i=1\}^\{d\_\{\\mathrm\{mlp\}\}\}H\_\{i\}\\mathbf\{V\}\_\{i,:\},\(2\)
where

Hi=σ​\(𝐱⋅𝐊:,i\)H\_\{i\}=\\sigma\(\\mathbf\{x\}\\cdot\\mathbf\{K\}\_\{:,i\}\)\(3\)
denotes the activation of theii\-th neuron\. Under this formulation, each neuron is represented by a key vector𝐊:,i\\mathbf\{K\}\_\{:,i\}and a corresponding value vector𝐕i,:\\mathbf\{V\}\_\{i,:\}\. The key vector determines the neuron’s activation by measuring how well the input matches its learned pattern, while the value vector specifies the information written back to the residual stream\. Consequently, the MLP output is a weighted sum of the value vectors of all activated neurons\.

### 3\.2Arithmetic Neurons and Heuristics

Building upon the neuron interpretation of MLPs, recent mechanistic interpretability studies have identified a sparse subset of neurons that play a causal role in arithmetic computation\(Nikankin et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib25); Du et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib9)\)\. These*arithmetic neurons*are primarily located in the middle and later layers of Transformer models and are selectively activated during arithmetic reasoning\. LetMMdenote a language model andSarithS\_\{\\mathrm\{arith\}\}denote the set of arithmetic neurons identified within the model\. Prior work shows that ablating these neurons, producing a modified modelM∖SarithM\\setminus S\_\{\\mathrm\{arith\}\}, causes arithmetic performance to deteriorate dramatically while leaving many non\-arithmetic capabilities comparatively unaffected\.

Although arithmetic neurons collectively enable numerical reasoning, they do not all perform the same computation\. Instead,Nikankin et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib25)\)show that these neurons implement a diverse collection of arithmetic heuristics, where individual neurons respond to specific arithmetic patterns and may participate in multiple heuristic strategies\. These heuristics operate over either the operands or the expected result and includerange\(values within a numerical interval\),modulo\(specific modular congruencies\),pattern\(digit patterns\),identical operands\(o​p1=o​p2op\_\{1\}=op\_\{2\}\), andmulti\-result\(promoting a small set of division outputs\)\. They describe arithmetic computation as emerging from a “bag of heuristics,” in which many specialized neurons cooperate to produce the final prediction\.

## 4Experimental Setup

We conduct all experiments on three base Llama models:Llama\-3\-8B,Llama\-3\.2\-3BandLlama\-3\.2\-1B\. We select these models because their tokenizers represent every integer in the range\[0,999\]\[0,999\]as a single token, enabling precise neuron\-level analysis without complications arising from multi\-token numerical representations\. We present results for Llama\-3\-8B in the main paper\. Corresponding results for Llama\-3\.2 3B and 1B exhibit the same qualitative trends and are provided in Appendix[A](https://arxiv.org/html/2607.16693#A1)\.

#### Prompt Formats\.

FollowingNikankin et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib25)\), we construct semantically equivalent arithmetic problems in three input formats:symbolic arithmetic,Python code, andnatural language word problemsas shown in figure[1](https://arxiv.org/html/2607.16693#S1.F1)\. Each prompt expresses the same underlying computationaopba\\mathbin\{\\mathrm\{op\}\}bover the four arithmetic operators\{\+,−,×,÷\}\\\{\+,\-,\\times,\\div\\\}, where division follows Python’s integer floor semantics\.

Although the three formats differ substantially in sequence length, every prompt is constructed so that the numerical answer is generated as a*single token*at the final position\. Consequently, all mechanistic analyses are performed on the residual stream and MLP activations at the final \(answer\) token, providing a consistent basis for cross\-format comparison\.

#### Dataset Construction\.

All prompts are zero\-shot and*model\-conditioned*\. Following prior mechanistic interpretability studies\(Wang et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib32); Prakash et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib28); Nikankin et al\.,[2025](https://arxiv.org/html/2607.16693#bib.bib25)\), we retain only operand pairs that the model answers correctly, allowing subsequent analyses to isolate the circuits responsible for successful arithmetic computation\. For each operator and input format, operand pairs are sampled to maximize the diversity of unique numerical answers, yielding200200correctly solved prompts\. These are split into100100*training*prompts, used to estimate activation statistics and neuron importance, and100100*evaluation*prompts, reserved exclusively for causal intervention and faithfulness experiments\.

Division is a special case because valid single\-token integer quotients are far less diverse than for the other operators, causing the number of unique answers to saturate \(approximately 96, 163, and 164 for arithmetic, code, and word problems, respectively\)\. We therefore interpret them with caution\.

### 4\.1Layer Identification

To identify where arithmetic computation emerges, we train a format\-specific, operator\-invariant linear probe on the residual stream \(resid\_post\) at every layer and token position to predict the numerical answer\.Each probe is trained on roughly 9,000\-–10,000 correctly answered prompts for each model\-–format pair using an 80/20 train–test split \(see Appendix[B](https://arxiv.org/html/2607.16693#A2)for dataset statistics\)\.

Across all formats, the answer first becomes reliably linearly decodable at the*final*input token position for Llama 3 8B, with a consistent computation\-onset layer\. We additionally train pooled probes shared across all four arithmetic operators, which similarly recover a common answer direction within each format\. Based on these results, we restrict subsequent neuron analyses to the final \(answer\) token and to layersℓ≥16\\ell\\geq 16, capturing both the emergence of arithmetic computation and its execution\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x3.png)Figure 3:Linear probe accuracy across transformer layers\. Arithmetic answers become reliably linearly decodable at a consistent layer across symbolic arithmetic, code, and word problems, motivating our focus on the final token and late\-layer MLP neurons\.
### 4\.2Identifying Arithmetic Neurons

Having identified the computation\-onset layers, we next rank neurons according to their contribution to arithmetic computation\. Neuron importance can be estimated using either*gradient\-based*methods, such as attribution patching\(Syed et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib30); Hanna et al\.,[2024](https://arxiv.org/html/2607.16693#bib.bib14); Cheng et al\.,[2026](https://arxiv.org/html/2607.16693#bib.bib3)\), or*gradient\-free*methods, such as activation patching\(Wang et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib32); Conmy et al\.,[2023](https://arxiv.org/html/2607.16693#bib.bib6); Zhang and Nanda,[2024](https://arxiv.org/html/2607.16693#bib.bib35)\)\. Gradient\-based approaches are computationally efficient but provide only first\-order approximations, whereas gradient\-free methods estimate causal effects exactly but are substantially more expensive\.

To balance efficiency and accuracy, we adopt a two\-stage ranking procedure\. We first use attribution patching to identify the top20002000candidate neurons per layer, then rerank these candidates using exact activation patching\. This substantially reduces computational cost while preserving the ranking quality of gradient\-free interventions\.

#### Stage 1: Attribution patching\.

FollowingStolfo et al\. \([2023](https://arxiv.org/html/2607.16693#bib.bib29)\); Nikankin et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib25)\), neuron importance is quantified using the indirect effect

IE=12​\(P∗​\(r′\)−P​\(r′\)P​\(r′\)\+P​\(r\)−P∗​\(r\)P∗​\(r\)\),\\text\{IE\}=\\frac\{1\}\{2\}\\left\(\\frac\{P^\{\*\}\(r^\{\\prime\}\)\-P\(r^\{\\prime\}\)\}\{P\(r^\{\\prime\}\)\}\+\\frac\{P\(r\)\-P^\{\*\}\(r\)\}\{P^\{\*\}\(r\)\}\\right\),\(4\)
wherePPandP∗P^\{\*\}denote the output probabilities before and after intervention\. Attribution patching approximates this quantity using a first\-order Taylor expansion,

IE≈\(acorrupt−aclean\)⋅∂m∂a,\\text\{IE\}\\approx\(a^\{\\mathrm\{corrupt\}\}\-a^\{\\mathrm\{clean\}\}\)\\cdot\\frac\{\\partial m\}\{\\partial a\},\(5\)
wheremmdenotes the indirect\-effect objective evaluated on the clean run\. For each \(model, format, operator\), importance scores are averaged across the training prompts, and neurons are ranked byμ\+σ\\mu\+\\sigma\(mean plus one standard deviation\) to prioritize neurons with both high and consistent causal effects\.

#### Stage 2: Activation patching\.

We then rerank the top20002000candidates per layer using exact activation patching\. For each candidate neuron, its last\-token activation is replaced with the corresponding activation from a matched corrupt prompt, and Eq\.[4](https://arxiv.org/html/2607.16693#S4.E4)is evaluated exactly using the resulting output probabilities\. Average indirect effects over the training prompts are used to obtain the final ranking, from which the top200200neurons per layer are retained for all subsequent analyses\.

### 4\.3Circuit Faithfulness Evaluation

We evaluate whether the identified circuit is both*necessary*and*sufficient*for arithmetic computation using a faithfulness metric based on mean ablation\. Given a candidate circuit, every MLP neuron*outside*the circuit is replaced, at every token position, with its corresponding activation from a precomputed mean cache\. Attention heads and all MLP neurons in layers preceding the computation\-onset region \(ℓ<16\\ell<16\) remain unmodified\. We then measure how much of the correct\-answer signal is preserved under this intervention\.

FollowingSyed et al\. \([2024](https://arxiv.org/html/2607.16693#bib.bib30)\), we quantify performance using the normalized logit

nl=logit​\[r\]max⁡\(logit\),\\mathrm\{nl\}=\\frac\{\\mathrm\{logit\}\[r\]\}\{\\max\(\\mathrm\{logit\}\)\},whererrdenotes the correct answer token\. We evaluate three conditions: \(i\) the unmodified model \(*good*\), \(ii\) complete mean ablation of all attention heads and MLP neurons \(*bad*\), and \(iii\) mean ablation of only the non\-circuit MLP neurons \(*circuit*\)\. Circuit faithfulness is defined as the fraction of the performance gap recovered by the retained circuit:

Faithfulness=nlcircuit−nlbadnlgood−nlbad\.\\mathrm\{Faithfulness\}=\\frac\{\\mathrm\{nl\}\_\{\\mathrm\{circuit\}\}\-\\mathrm\{nl\}\_\{\\mathrm\{bad\}\}\}\{\\mathrm\{nl\}\_\{\\mathrm\{good\}\}\-\\mathrm\{nl\}\_\{\\mathrm\{bad\}\}\}\.\(6\)
#### Mean Cache\.

Mean ablation requires a neutral replacement activation for every model component\. We construct a*mean cache*from a large, evaluation\-disjoint set of operand pairs by averaging MLP neuron and attention\-head activations at each token position\. Because prompts differ in length across formats, activations are aligned relative to the final \(answer\) token before averaging\. During ablation, the cached activations are applied using the same alignment, ensuring that each token position is replaced with statistics computed from comparable positions across prompts\.

### 4\.4Cross\-Format Activation Transfer

To investigate why mathematically equivalent problems are sometimes solved correctly in one format but not another, we perform cross\-format activation patching on the shared arithmetic heuristic neurons\. For each operator and donor→\\rightarrowtarget format pair, we identify operand pairs that are solved correctly in the donor format but incorrectly in the target format, evaluating up to 600 matched pairs per transfer direction\.

We replace the shared neuron activations at the final \(answer\) token in the failed target execution with those from the corresponding successful donor execution, leaving all other activations unchanged\. We compare three settings:*matched*, where donor and target share the same operands;*mismatched*, where activations come from a different operand pair; and*random*, where an equally sized set of randomly selected neurons is patched\. We report the fraction of corrected target predictions and the normalized logit of the correct answer\.

### 4\.5Neuron Heuristic Families

To characterize*what*the identified neurons compute, we apply the heuristic\-classification framework ofNikankin et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib25)\)to the shared neurons\. For each neuron, the method quantifies how consistently its highest\-activating inputs follow an interpretable arithmetic pattern, such as operand range, result modulus, or result value\. Following the original authors’ approach, we evaluate both*indirect*and*direct*heuristics, identifying operand\-related features from raw activations and result\-related features from activations projected to the vocabulary space\. Unless otherwise stated, we use the recommended matching threshold of0\.60\.6\.

For each arithmetic operator, we classify the neurons in the three\-way shared circuit independently for the arithmetic, code, and word\-problem formats\. This allows us to examine whether neurons shared across formats also exhibit consistent functional roles by implementing the same heuristic family\. We quantify this using the mean pairwise Jaccard similarity between family sets and the exact family\-match rate across formats\. The distribution is shown in Appendix[D](https://arxiv.org/html/2607.16693#A4)\.

## 5Results

We present evidence that arithmetic computation is implemented by a shared set of form\-invariant heuristic neurons from four complementary perspectives\. We first quantify thesparsityof the shared circuit across symbolic arithmetic, code, and word problems\. We then establish itscausalrole throughnecessityandsufficiencyanalyses\. Next, we investigate whether failures in one format can be repaired using activations from a successful execution in another format\. Finally, we examine whether the shared neurons implement consistent arithmetic heuristics across formats\.

### 5\.1Sparsity: A compact arithmetic circuit is shared across formats

We first ask how much overlap exists between the arithmetic circuits identified independently from symbolic arithmetic, code, and word problems\. If arithmetic relied on a large pool of generic neurons, the overlap between the three formats would be expected to increase monotonically as progressively larger circuits are considered\.

Instead, Figure[4](https://arxiv.org/html/2607.16693#S5.F4)exhibits a consistent non\-monotonic pattern across all arithmetic operators\. The three\-way Jaccard overlap peaks when approximately5050–100100neurons per layer are retained, before gradually decreasing as additional neurons are included\. This suggests that the highest\-ranked neurons form a compact core circuit that is consistently recruited across formats, whereas neurons ranked lower become increasingly format\-specific\. Although the absolute overlap varies by operator, the same qualitative behavior is observed for addition, subtraction, multiplication, and division\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x4.png)Figure 4:Three\-way Jaccard overlap of the top\-kkneurons across symbolic arithmetic, code, and word problems as a function of circuit sizekk\.
### 5\.2Causality: Shared neurons are necessary and sufficient within the late\-layer MLPs

Neuron overlap alone does not establish that the shared neurons are responsible for arithmetic computation\. To evaluate their causal role, we compute the three\-way intersection of the top\-kkneurons identified independently from the three formats and perform two complementary interventions\.

In the*keep\-only*experiment, all neurons outside the shared circuit are mean\-ablated, testing whether the shared circuit alone is sufficient for arithmetic computation\. Conversely, the*knockout*experiment ablates only the shared circuit while leaving the remainder of the network intact, testing whether the shared neurons are necessary\.

#### Sufficiency\.

Figure[5](https://arxiv.org/html/2607.16693#S5.F5)shows that the shared circuit rapidly recovers model performance as the circuit size increases\. For addition and subtraction, faithfulness approaches the full\-model ceiling with approximately100100–500500neurons per layer, while multiplication and division exhibit a more gradual increase\. Across all operators and formats, the shared circuit consistently outperforms matched random\-neuron controls, demonstrating that a relatively small shared circuit is sufficient to recover nearly all arithmetic performance\.

#### Necessity\.

The complementary knockout experiment \(Figure[6](https://arxiv.org/html/2607.16693#S5.F6)\) shows that removing only the shared circuit causes a rapid degradation in faithfulness, whereas ablating an equally sized random set of neurons has little effect\.

Together, these interventions demonstrate that the neurons shared across symbolic arithmetic, code, and word problems are both causally necessary and sufficient for arithmetic computation within the late\-layer MLPs, while keeping the attention mechanism and earlier layers intact\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x5.png)Figure 5:Sufficiency analysis using keep\-only interventions\. Faithfulness is measured after ablating all neurons outside the shared circuit\. Random\-neuron controls are matched for circuit size\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x6.png)Figure 6:Necessity analysis using knockout interventions\. Faithfulness is measured after ablating only the shared circuit\. Random\-neuron controls are matched for circuit size\.

### 5\.3Cross\-format activation transfer recovers most incorrect predictions

The previous experiments establish that arithmetic computation relies on a shared set of causal neurons across formats\. We next ask whether cross\-format failures arise from differences in activation states rather than distinct arithmetic circuits\.

Figure[7](https://arxiv.org/html/2607.16693#S5.F7)and[8](https://arxiv.org/html/2607.16693#S5.F8)shows the recovery rates for code→\\rightarrowarithmetic and word→\\rightarrowarithmetic transfer across all four operators\. Transferring activations from matched donor executions substantially recovers previously incorrect predictions: addition and subtraction exceed 97% recovery at approximatelyk=50k=50neurons per layer, while multiplication recovers 80–85% of failures across both transfer directions\. Division also exhibits strong recovery for word→\\rightarrowarithmetic \(∼\\sim90%\) but more variable behaviour for code→\\rightarrowarithmetic, with recovery declining at larger values ofkk\. This suggests that larger intersections increasingly include neurons with code\-specific activation patterns that interfere with arithmetic readout\. In contrast, patching an equally sized set of randomly selected neurons yields near\-zero recovery across all operators and transfer directions, confirming that recovery is specific to the shared heuristic neurons\.

These results indicate that cross\-format failures primarily arise from differences in the activation states of a shared arithmetic circuit rather than from the recruitment of distinct circuits\. Restoring the shared\-neuron activations is sufficient to recover most failed predictions\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x7.png)Figure 7:Cross\-format activation transfer from code to arithmetic using three\-way shared neurons\. Matched donor activations recover most failed predictions, while random\-neuron controls remain near zero\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x8.png)Figure 8:Cross\-format activation transfer from word problems to arithmetic using three\-way shared neu\- rons\. Recovery remains high across operators, whereas random\-neuron controls show negligible improvement
### 5\.4Mechanistic consistency: Shared neurons implement the same heuristics

Across all formats, shared neurons are consistently assigned to the same heuristic families \(e\.g\., operand\-range detectors, result\-value neurons, and modular arithmetic heuristics\)\. We quantify this agreement using the*exact match rate*\(the fraction of neurons assigned the same heuristic family across all formats\),*pairwise Jaccard similarity*\(the average overlap in heuristic assignments between every pair of formats\), and*three\-way Jaccard similarity*\(intersection\-over\-union of heuristic assignments across all three formats\)\. As shown in Table[1](https://arxiv.org/html/2607.16693#S5.T1), the pairwise and three\-way Jaccard similarities average 0\.75 and 0\.64, respectively, indicating substantial agreement\. Permutation tests confirm that these similarities significantly exceed chance \(p<10−4p<10^\{\-4\}\)\. Although exact agreement is more stringent \(30\.6% on average\), nearly all shared neurons \(94–100% for addition, subtraction, and multiplication\) receive a heuristic label in every format\. Full statistics and heuristic\-family distributions are provided in Appendices[D](https://arxiv.org/html/2607.16693#A4)–[E](https://arxiv.org/html/2607.16693#A5)\.

OperatorExact \(%\)Pair Jaccard3\-way JaccardAddition53\.90\.830\.75Subtraction23\.50\.730\.62Multiplication20\.10\.760\.65Division24\.80\.670\.54Average30\.60\.750\.64Table 1:Functional consistency of shared Llama\-3\-8B arithmetic neurons across formats\. Exact denotes the fraction of shared neurons assigned the same heuristic family in all three formats, while Pair and 3\-way denote pairwise and three\-way Jaccard similarity of heuristic\-family assignments\.

## 6Conclusion

We investigated whether arithmetic heuristic neurons in LLMs are invariant to the surface form of mathematically equivalent problems\. Across symbolic arithmetic, word problems, and code, we found that arithmetic computation relies on a compact set of shared neurons that are both necessary and sufficient for correct computation\. Cross\-format activation patching showed that restoring their activation states recovers most failed predictions, indicating that cross\-format failures arise mostly from differences in activation state rather than distinct circuits\. Heuristic\-family analysis further showed that these neurons preserve consistent functional roles across representations\. Together, these findings demonstrate that arithmetic computation in LLMs is largely form\-invariant at the neuron level and mechanistic circuits identified in one representation can generalize across input modalities\. Future work may extend this analysis to more complex reasoning, such as algebraic manipulation and multi\-step problem solving\.

## Limitations

Our study focuses on elementary integer arithmetic in base Llama models and three carefully controlled input formats\. While this setting enables precise causal analysis, it remains unclear whether the observed form invariance extends to more complex mathematical reasoning, instruction\-tuned models, or broader language understanding tasks\.

Our causal interventions and heuristic analyses focus exclusively on MLP neurons at the final input token\. This focus is motivated by the key\-value memory interpretation of MLPs, which suggests that they are the primary components responsible for storing and retrieving arithmetic\-related representations\. Although prior work suggests that attention heads play a complementary role by routing operand information to this position, we leave investigating whether these routing mechanisms also exhibit cross\-format invariance to future work\.

Finally, we identify shared neurons using prompts that are answered correctly by the model, allowing us to isolate the circuits underlying successful computation\. While our cross\-format activation transfer experiments examine cases where this shared circuit succeeds in one format but fails in another, extending this analysis to broader reasoning failures and more diverse, unconstrained prompt distributions remains an important direction for future work\.

## References

- Baeumel et al\. \(2025\)Tanja Baeumel, Daniil Gurgurov, Yusser al Ghussin, Josef van Genabith, and Simon Ostermann\. 2025\.[Modular Arithmetic: Language Models Solve Math Digit by Digit](https://doi.org/10.48550/arXiv.2508.02513)\.*Preprint*, arXiv:2508\.02513\.
- Belrose et al\. \(2025\)Nora Belrose, Igor Ostrovsky, Lev McKinney, Zach Furman, Logan Smith, Danny Halawi, Stella Biderman, and Jacob Steinhardt\. 2025\.[Eliciting Latent Predictions from Transformers with the Tuned Lens](https://doi.org/10.48550/arXiv.2303.08112)\.*Preprint*, arXiv:2303\.08112\.
- Cheng et al\. \(2026\)Stephen Cheng, Sarah Wiegreffe, and Dinesh Manocha\. 2026\.[What drives representation steering? a mechanistic case study on steering refusal](https://arxiv.org/abs/2604.08524)\.*Preprint*, arXiv:2604\.08524\.
- Cheng et al\. \(2025\)Ziling Cheng, Meng Cao, Leila Pishdad, Yanshuai Cao, and Jackie CK Cheung\. 2025\.[Can LLMs Reason Abstractly Over Math Word Problems Without CoT? Disentangling Abstract Formulation From Arithmetic Computation](https://doi.org/10.18653/v1/2025.emnlp-main.723)\.In*Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*, pages 14306–14333, Suzhou, China\. Association for Computational Linguistics\.
- Cobbe et al\. \(2021\)Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman\. 2021\.[Training Verifiers to Solve Math Word Problems](https://doi.org/10.48550/arXiv.2110.14168)\.*Preprint*, arXiv:2110\.14168\.
- Conmy et al\. \(2023\)Arthur Conmy, Augustine N\. Mavor\-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga\-Alonso\. 2023\.[Towards automated circuit discovery for mechanistic interpretability](https://openreview.net/forum?id=89ia77nZ8u)\.In*Thirty\-seventh Conference on Neural Information Processing Systems*\.
- Deng et al\. \(2024\)Chunyuan Deng, Zhiqi Li, Roy Xie, Ruidi Chang, and Hanjie Chen\. 2024\.[Language Models are Symbolic Learners in Arithmetic](https://doi.org/10.48550/arXiv.2410.15580)\.*Preprint*, arXiv:2410\.15580\.
- Ding et al\. \(2024\)Xiaoman Delores Ding, Zifan Carl Guo, Eric J\. Michaud, Ziming Liu, and Max Tegmark\. 2024\.[Survival of the Fittest Representation: A Case Study with Modular Addition](https://doi.org/10.48550/arXiv.2405.17420)\.*Preprint*, arXiv:2405\.17420\.
- Du et al\. \(2025\)Wenyu Du, Rui Zheng, Tongxu Luo, Stephen Chung, and Jie Fu\. 2025\.[Fine\-Grained Manipulation of Arithmetic Neurons](https://doi.org/10.18653/v1/2025.blackboxnlp-1.27)\.In*Proceedings of the 8th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP*, pages 467–479, Suzhou, China\. Association for Computational Linguistics\.
- Geva et al\. \(2022\)Mor Geva, Avi Caciularu, Kevin Wang, and Yoav Goldberg\. 2022\.[Transformer Feed\-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space](https://doi.org/10.18653/v1/2022.emnlp-main.3)\.In*Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing*, pages 30–45, Abu Dhabi, United Arab Emirates\. Association for Computational Linguistics\.
- Geva et al\. \(2021\)Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy\. 2021\.[Transformer Feed\-Forward Layers Are Key\-Value Memories](https://doi.org/10.18653/v1/2021.emnlp-main.446)\.In*Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing*, pages 5484–5495, Online and Punta Cana, Dominican Republic\. Association for Computational Linguistics\.
- Goldowsky\-Dill et al\. \(2023\)Nicholas Goldowsky\-Dill, Chris MacLeod, Lucas Sato, and Aryaman Arora\. 2023\.[Localizing Model Behavior with Path Patching](https://doi.org/10.48550/arXiv.2304.05969)\.*Preprint*, arXiv:2304\.05969\.
- Gould et al\. \(2024\)Rhys Gould, Euan Ong, George Ogden, and Arthur Conmy\. 2024\.SUCCESSOR HEADS: RECURRING, INTERPRETABLE ATTENTION HEADS IN THE WILD\.
- Hanna et al\. \(2024\)Michael Hanna, Sandro Pezzelle, and Yonatan Belinkov\. 2024\.[Have faith in faithfulness: Going beyond circuit overlap when finding model mechanisms](https://openreview.net/forum?id=grXgesr5dT)\.In*ICML 2024 Workshop on Mechanistic Interpretability*\.
- Hendrycks et al\. \(2020\)Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt\. 2020\.[Measuring Massive Multitask Language Understanding](https://doi.org/10.48550/ARXIV.2009.03300)\.*arXiv preprint*\.
- Kantamneni and Tegmark \(2025\)Subhash Kantamneni and Max Tegmark\. 2025\.[Language Models Use Trigonometry to Do Addition](https://doi.org/10.48550/arXiv.2502.00873)\.*Preprint*, arXiv:2502\.00873\.
- Li et al\. \(2024\)Qintong Li, Leyang Cui, Xueliang Zhao, Lingpeng Kong, and Wei Bi\. 2024\.[GSM\-Plus: A Comprehensive Benchmark for Evaluating the Robustness of LLMs as Mathematical Problem Solvers](https://doi.org/10.48550/arXiv.2402.19255)\.*Preprint*, arXiv:2402\.19255\.
- Lindsey et al\. \(2025\)Jack Lindsey, Wes Gurnee, Emmanuel Ameisen, Brian Chen, Adam Pearce, Nicholas L\. Turner, Craig Citro, David Abrahams, Shan Carter, Basil Hosmer, Jonathan Marcus, Michael Sklar, Adly Templeton, Trenton Bricken, Callum McDougall, Hoagy Cunningham, Thomas Henighan, Adam Jermyn, Andy Jones, and 8 others\. 2025\.[On the biology of a large language model](https://transformer-circuits.pub/2025/attribution-graphs/biology.html)\.*Transformer Circuits Thread*\.
- Mamidanna et al\. \(2025\)Siddarth Mamidanna, Daking Rai, Ziyu Yao, and Yilun Zhou\. 2025\.[All for One: LLMs Solve Mental Math at the Last Token With Information Transferred From Other Tokens](https://doi.org/10.18653/v1/2025.emnlp-main.1565)\.In*Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*, pages 30747–30760, Suzhou, China\. Association for Computational Linguistics\.
- Marjieh et al\. \(2025\)Raja Marjieh, Veniamin Veselovsky, Thomas L\. Griffiths, and Ilia Sucholutsky\. 2025\.[What is a Number, That a Large Language Model May Know It?](https://doi.org/10.48550/arXiv.2502.01540)*Preprint*, arXiv:2502\.01540\.
- Meng et al\. \(2022\)Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov\. 2022\.Locating and editing factual associations in gpt\.In*Proceedings of the 36th International Conference on Neural Information Processing Systems*, NIPS ’22, Red Hook, NY, USA\. Curran Associates Inc\.
- Mirzadeh et al\. \(2025\)Iman Mirzadeh, Keivan Alizadeh, Hooman Shahrokhi, Oncel Tuzel, Samy Bengio, and Mehrdad Farajtabar\. 2025\.GSM\-SYMBOLIC: UNDERSTANDING THE LIMITA\- TIONS OF MATHEMATICAL REASONING IN LARGE LANGUAGE MODELS\.
- Nanda \(2023\)Neel Nanda\. 2023\.Attribution patching: Activation patching at industrial scale\.[https://www\.neelnanda\.io/mechanistic\-interpretability/attribution\-patching](https://www.neelnanda.io/mechanistic-interpretability/attribution-patching)\.Blog post\. Accessed: 2026\-07\-12\.
- Nanda et al\. \(2023\)Neel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith, and Jacob Steinhardt\. 2023\.[Progress measures for grokking via mechanistic interpretability](https://doi.org/10.48550/arXiv.2301.05217)\.*Preprint*, arXiv:2301\.05217\.
- Nikankin et al\. \(2025\)Yaniv Nikankin, Anja Reusch, Aaron Mueller, and Yonatan Belinkov\. 2025\.[Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics](https://doi.org/10.48550/arXiv.2410.21272)\.*Preprint*, arXiv:2410\.21272\.
- nostalgebraist \(2020\)nostalgebraist\. 2020\.Interpreting gpt: The logit lens\.[https://www\.lesswrong\.com/posts/AcKRB8wDpdaN6v6ru/interpreting\-gpt\-the\-logit\-lens](https://www.lesswrong.com/posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lens)\.Blog post\. Accessed: 2026\-07\-12\.
- Pearl \(2013\)Judea Pearl\. 2013\.[Direct and Indirect Effects](https://doi.org/10.48550/arXiv.1301.2300)\.*Preprint*, arXiv:1301\.2300\.
- Prakash et al\. \(2024\)Nikhil Prakash, Tamar Rott Shaham, Tal Haklay, Yonatan Belinkov, and David Bau\. 2024\.[Fine\-tuning enhances existing mechanisms: A case study on entity tracking](https://openreview.net/forum?id=8sKcAWOf2D)\.In*The Twelfth International Conference on Learning Representations*\.
- Stolfo et al\. \(2023\)Alessandro Stolfo, Yonatan Belinkov, and Mrinmaya Sachan\. 2023\.[A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysis](https://doi.org/10.18653/v1/2023.emnlp-main.435)\.In*Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing*, pages 7035–7052, Singapore\. Association for Computational Linguistics\.
- Syed et al\. \(2024\)Aaquib Syed, Can Rager, and Arthur Conmy\. 2024\.[Attribution patching outperforms automated circuit discovery](https://doi.org/10.18653/v1/2024.blackboxnlp-1.25)\.In*Proceedings of the 7th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP*, pages 407–416, Miami, Florida, US\. Association for Computational Linguistics\.
- Wang et al\. \(2022\)Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt\. 2022\.[Interpretability in the Wild: A Circuit for Indirect Object Identification in GPT\-2 small](https://doi.org/10.48550/arXiv.2211.00593)\.*Preprint*, arXiv:2211\.00593\.
- Wang et al\. \(2023\)Kevin Ro Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt\. 2023\.[Interpretability in the wild: a circuit for indirect object identification in GPT\-2 small](https://openreview.net/forum?id=NpsVSN6o4ul)\.In*The Eleventh International Conference on Learning Representations*\.
- Wei et al\. \(2023\)Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou\. 2023\.[Chain\-of\-Thought Prompting Elicits Reasoning in Large Language Models](https://doi.org/10.48550/arXiv.2201.11903)\.*Preprint*, arXiv:2201\.11903\.
- Wu et al\. \(2024\)Zhengxuan Wu, Atticus Geiger, Aryaman Arora, Jing Huang, Zheng Wang, Noah Goodman, Christopher Manning, and Christopher Potts\. 2024\.[Pyvene: A Library for Understanding and Improving PyTorch Models via Interventions](https://doi.org/10.18653/v1/2024.naacl-demo.16)\.In*Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 3: System Demonstrations\)*, pages 158–165, Mexico City, Mexico\. Association for Computational Linguistics\.
- Zhang and Nanda \(2024\)Fred Zhang and Neel Nanda\. 2024\.[Towards best practices of activation patching in language models: Metrics and methods](https://openreview.net/forum?id=Hf17y6u9BC)\.In*The Twelfth International Conference on Learning Representations*\.
- Zhang et al\. \(2024a\)Hugh Zhang, Jeff Da, Dean Lee, Vaughn Robinson, Catherine Wu, Will Song, Tiffany Zhao, Pranav Raja, Charlotte Zhuang, Dylan Slack, Qin Lyu, Sean Hendryx, Russell Kaplan, Michele \(Mike\) Lunati, and Summer Yue\. 2024a\.A careful examination of large language model performance on grade school arithmetic\.In*Proceedings of the 38th International Conference on Neural Information Processing Systems*, NIPS ’24, Red Hook, NY, USA\. Curran Associates Inc\.
- Zhang et al\. \(2024b\)Wei Zhang, Chaoqun Wan, Yonggang Zhang, Yiu\-ming Cheung, Xinmei Tian, Xu Shen, and Jieping Ye\. 2024b\.[Interpreting and Improving Large Language Models in Arithmetic Calculation](https://doi.org/10.48550/arXiv.2409.01659)\.*Preprint*, arXiv:2409\.01659\.
- Zhong et al\. \(2023\)Ziqian Zhong, Ziming Liu, Max Tegmark, and Jacob Andreas\. 2023\.[The clock and the pizza: Two stories in mechanistic explanation of neural networks](https://proceedings.neurips.cc/paper_files/paper/2023/file/56cbfbf49937a0873d451343ddc8c57d-Paper-Conference.pdf)\.In*Advances in Neural Information Processing Systems*, volume 36, pages 27223–27250\. Curran Associates, Inc\.

## Appendix AAdditional Results on Llama Models

The main paper presents detailed analyses for Llama\-3\-8B\. This appendix reports the corresponding experiments for Llama\-3\.2\-3B and Llama\-3\.2\-1B\. Across all analyses, both models exhibit the same qualitative trends as the primary model, supporting the robustness of our findings across model scales\.

### A\.1Layer Identification

Figures[9](https://arxiv.org/html/2607.16693#A1.F9)and[10](https://arxiv.org/html/2607.16693#A1.F10)show the layer\-wise linear probe accuracy for Llama\-3\.2\-3B and Llama\-3\.2\-1B, respectively\. Similar to Llama\-3\-8B, the answer becomes linearly decodable at a consistent late layer across symbolic arithmetic, code, and word problems\.

### A\.2Shared Arithmetic Circuits

Figures[11\(a\)](https://arxiv.org/html/2607.16693#A1.F11.sf1)and[11\(b\)](https://arxiv.org/html/2607.16693#A1.F11.sf2)report the three\-way Jaccard overlap between arithmetic, code, and word\-problem circuits\. Both models exhibit the same non\-monotonic overlap pattern observed for Llama\-3\-8B\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x9.png)Figure 9:Layer\-wise probe accuracy for Llama\-3\.2\-3B\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x10.png)Figure 10:Layer\-wise probe accuracy for Llama\-3\.2\-1B\.
### A\.3Circuit Faithfulness

Figures[13](https://arxiv.org/html/2607.16693#A1.F13)–[15](https://arxiv.org/html/2607.16693#A1.F15)present the keep\-only and knockout interventions for the two additional models\. Consistent with the main paper, the shared circuit remains both necessary and sufficient for arithmetic computation\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x11.png)\(a\)Llama\-3\.2\-3B
![Refer to caption](https://arxiv.org/html/2607.16693v1/x12.png)\(b\)Llama\-3\.2\-1B

Figure 11:Three\-way Jaccard overlap of the top\-kkneurons across arithmetic, code, and word formats for the additional Llama\-3 models\. Both models exhibit the same non\-monotonic overlap pattern observed for Llama\-3\-8B, with peak overlap occurring at relatively small circuit sizes\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x13.png)Figure 12:Knockout intervention for Llama\-3\.2\-3B\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x14.png)Figure 13:Keep\-only intervention for Llama\-3\.2\-3B\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x15.png)Figure 14:Keep\-only intervention for Llama\-3\.2\-1B\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x16.png)Figure 15:Knockout intervention for Llama\-3\.2\-1B\.
### A\.4Cross\-Format Activation Transfer

Figures[16](https://arxiv.org/html/2607.16693#A1.F16)and[17](https://arxiv.org/html/2607.16693#A1.F17)present representative cross\-format activation transfer experiments for the two additional models\. As in Llama\-3\-8B, transferring the shared heuristic\-neuron activations from successful donor executions substantially improves accuracy on failed target executions\.

![Refer to caption](https://arxiv.org/html/2607.16693v1/x17.png)\(a\)Code→\\rightarrowArithmetic
![Refer to caption](https://arxiv.org/html/2607.16693v1/x18.png)\(b\)Word→\\rightarrowArithmetic

Figure 16:Cross\-format activation transfer for Llama\-3\.2\-3B\.![Refer to caption](https://arxiv.org/html/2607.16693v1/x19.png)\(a\)Code→\\rightarrowArithmetic
![Refer to caption](https://arxiv.org/html/2607.16693v1/x20.png)\(b\)Word→\\rightarrowArithmetic

Figure 17:Cross\-format activation transfer for Llama\-3\.2\-1B\.

## Appendix BDataset Statistics and Linear Probe Evaluation

All prompts used for linear probing and circuit identification were filtered to retain only instances the models answered correctly\. Table[2](https://arxiv.org/html/2607.16693#A2.T2)reports the distribution of correct prompts available per model and format\. While addition, subtraction, and division yielded large pools of correct executions \(≥20,000\\geq 20,000\), multiplication served as the primary bottleneck for dataset size due to the restricted pool of operand pairs yielding an answer≤999\\leq 999\.

Table[3](https://arxiv.org/html/2607.16693#A2.T3)details the results of the format\-specific, pooled\-operator linear probes trained on the residual stream at the final token position\. The computation onset layer \(defined as the first layer where probe test accuracy exceeds 50%\) is strictly identical across all three formats within a given model\.

ModelFormatMul Correct / 2520Mul AccuracyAdd / Sub / Div CorrectLlama\-3\.2\-1BArithmetic52821\.0%≥20,000\\geq 20,000Llama\-3\.2\-1BCode184673\.3%≥20,000\\geq 20,000Llama\-3\.2\-1BWord121548\.2%≥20,000\\geq 20,000Llama\-3\.2\-3BArithmetic163765\.0%≥20,000\\geq 20,000Llama\-3\.2\-3BCode227590\.3%≥20,000\\geq 20,000Llama\-3\.2\-3BWord123649\.0%≥20,000\\geq 20,000Llama\-3\-8BArithmetic189975\.4%≥20,000\\geq 20,000Llama\-3\-8BCode244296\.9%≥20,000\\geq 20,000Llama\-3\-8BWord164565\.3%≥20,000\\geq 20,000Table 2:Correct\-prompt census across models and formats for answers in the range\[0,999\]\[0,999\]\. Multiplication is the most constrained operator, as the prompt pool is exhausted at 2,520 valid pairs\.ModelFormatTotalNNUnique AnsPeak AccPeak LayerOnset LayerLlama\-3\.2\-3BArithmetic9,1399880\.891L26L18Llama\-3\.2\-3BCode9,7759950\.964L27L18Llama\-3\.2\-3BWord8,7369940\.900L26L18Llama\-3\-8BArithmetic9,3999900\.924L29L19Llama\-3\-8BCode9,9439950\.967L29L19Llama\-3\-8BWord9,1449940\.933L29L19Llama\-3\.2\-1BArithmetic8,0289310\.733L15L14Llama\-3\.2\-1BCode9,3469920\.784L15L14Llama\-3\.2\-1BWord8,7129790\.695L15L14Table 3:Linear probe evaluation across formats\. The onset layer represents the first transformer layer where test accuracy exceeds 0\.50, demonstrating identical computation onset points across formats\.
## Appendix CAdditional Heuristic Consistency Results

Table[7](https://arxiv.org/html/2607.16693#A5.T7)reports the complete heuristic consistency statistics for Llama\-3\-8B, Llama\-3\.2\-3B and Llama\-3\.2\-1B\. The trends observed in the main paper are consistent across models: pairwise and three\-way heuristic agreement remain high for all arithmetic operators, although exact family agreement is more stringent\. Division exhibits lower agreement, likely reflecting the smaller and less diverse set of valid integer quotients\.

## Appendix DDistribution of Heuristic Families

To provide a granular understanding of the shared circuit’s composition, we expand the broad heuristic categories introduced in Section 3\.2 into specific functional families\. Following the algorithmic implementation ofNikankin et al\. \([2025](https://arxiv.org/html/2607.16693#bib.bib25)\), the classification process evaluates neurons based on both a specificscoring mechanism\(range, modulo, pattern, or exact value\) and a specifictarget\(a single operand, both operands, or the expected result\)\.

In our analysis, we group the parameterized heuristic labels into distinct functional families defined by the intersection of these targets and scorers\. This yields families such asoperand range,result range,both modulo, andresult value\(which activates for exact, zero\-padded target numbers\)\. We additionally include theidentical operands\(o​p1=o​p2op\_\{1\}=op\_\{2\}\) heuristics\. Table[4](https://arxiv.org/html/2607.16693#A4.T4),[5](https://arxiv.org/html/2607.16693#A4.T5), and[6](https://arxiv.org/html/2607.16693#A4.T6)summarizes the distribution of these heuristic families for the shared circuit\.

Heuristic FamilyArithmeticCodeWordResult Pattern808800758Result Modulo596606558Result Range387389411Operand Pattern222226292Operand Range16796175Both Range636161Both Modulo223440Result Value222832Operand Modulo171119Operand Value013Identical Operands064Table 4:Family distribution of shared neurons for Llama\-3\-8B \(addition\)\. A single neuron may be assigned multiple families\.Heuristic FamilyArithmeticCodeWordResult Pattern631691643Result Modulo490552536Result Range247350312Operand Range18974119Operand Pattern170147202Both Range545556Both Modulo152024Operand Modulo11816Result Value53223Identical Operands025Table 5:Family distribution of shared neurons for Llama\-3\.2\-3B \(addition\)\. A single neuron may be assigned multiple families\.Heuristic FamilyArithmeticCodeWordResult Modulo166183175Operand Pattern147160228Result Pattern12416087Result Range9215171Operand Range7845129Operand Modulo322236Both Range203212Both Modulo181619Operand Value037Result Value010Identical Operands001Table 6:Family distribution of shared neurons for Llama\-3\.2\-1B \(addition\)\. A single neuron may be assigned multiple families\.
## Appendix EStatistical Significance of Heuristic Agreement

To verify that the functional consistency of shared neurons exceeds random chance, we established a null distribution by randomly permuting the heuristic family assignments within each format independently\. Table[8](https://arxiv.org/html/2607.16693#A5.T8)reports the observed exact family match rates and mean pairwise Jaccard similarities against the null expectations\. Across all models and operators, the observed functional agreement significantly exceeds the maximum values observed under the null distribution \(p<10−4p<10^\{\-4\}\)\.

modeloperator\|C\|\|C\|labelled3\-way commonexact matchJaccard \(pair\)Jaccard \(3\-way\)Llama\-3\-8Baddition78459496\.0%53\.9%0\.830\.75Llama\-3\-8Bsubtraction80376196\.8%23\.5%0\.730\.62Llama\-3\-8Bmultiplication73373399\.9%20\.1%0\.760\.65Llama\-3\-8Bdivision76842488\.0%24\.8%0\.670\.54Llama\-3\.2\-3Baddition66149294\.5%44\.3%0\.790\.70Llama\-3\.2\-3Bsubtraction61856696\.8%14\.5%0\.680\.55Llama\-3\.2\-3Bmultiplication57357399\.8%15\.2%0\.740\.63Llama\-3\.2\-3Bdivision57428675\.5%18\.5%0\.590\.44Llama\-3\.2\-1Baddition33220385\.2%36\.0%0\.700\.58Llama\-3\.2\-1Bsubtraction37235496\.6%7\.9%0\.640\.50Llama\-3\.2\-1Bmultiplication299299100\.0%16\.7%0\.750\.64Llama\-3\.2\-1Bdivision26716869\.6%6\.0%0\.500\.31Table 7:Per\-operator heuristic consistency statistics for all models\.\|C\|\|C\|denotes the size of the shared circuit,*labelled*denotes the number of neurons assigned a heuristic family,*3\-way common*denotes the percentage of neurons receiving a heuristic assignment in all three formats,*Exact*denotes the percentage assigned the same heuristic family across all formats, and Pair/3\-way denote the corresponding heuristic\-family Jaccard similarities\.exact family matchmean pairwise Jaccardmodeloperatorobsnullnull maxppobsnullnull maxppLlama\-3\-8Baddition0\.5390\.0520\.087<1​e−4\\\!<1e\-40\.7000\.3150\.339<1​e−4\\\!<1e\-4Llama\-3\-8Bsubtraction0\.2350\.0090\.021<1​e−4\\\!<1e\-40\.7070\.4050\.421<1​e−4\\\!<1e\-4Llama\-3\-8Bmultiplication0\.2010\.0240\.048<1​e−4\\\!<1e\-40\.7570\.5680\.582<1​e−4\\\!<1e\-4Llama\-3\-8Bdivision0\.2480\.0210\.061<1​e−4\\\!<1e\-40\.4880\.1830\.207<1​e−4\\\!<1e\-4Llama\-3\.2\-3Baddition0\.4430\.0480\.089<1​e−4\\\!<1e\-40\.6580\.2980\.319<1​e−4\\\!<1e\-4Llama\-3\.2\-3Bsubtraction0\.1450\.0080\.027<1​e−4\\\!<1e\-40\.6410\.3830\.402<1​e−4\\\!<1e\-4Llama\-3\.2\-3Bmultiplication0\.1520\.0180\.042<1​e−4\\\!<1e\-40\.7430\.5670\.581<1​e−4\\\!<1e\-4Llama\-3\.2\-3Bdivision0\.1850\.0170\.054<1​e−4\\\!<1e\-40\.4140\.1510\.179<1​e−4\\\!<1e\-4Llama\-3\.2\-1Baddition0\.3600\.0420\.097<1​e−4\\\!<1e\-40\.5100\.2260\.257<1​e−4\\\!<1e\-4Llama\-3\.2\-1Bsubtraction0\.0790\.0140\.040<1​e−4\\\!<1e\-40\.6230\.4090\.431<1​e−4\\\!<1e\-4Llama\-3\.2\-1Bmultiplication0\.1670\.0210\.057<1​e−4\\\!<1e\-40\.7490\.5790\.597<1​e−4\\\!<1e\-4Llama\-3\.2\-1Bdivision0\.0600\.0070\.041<1​e−4\\\!<1e\-40\.3920\.1890\.219<1​e−4\\\!<1e\-4Table 8:Statistical significance of heuristic family agreement\. Observed \(*obs*\) exact match rates and pairwise Jaccard similarities are compared against a null distribution generated via random permutation of heuristic labels\. Across all settings, the observed agreement significantly exceeds chance \(p<10−4p<10^\{\-4\}\)\.

Similar Articles

LLM Neuroanatomy III - LLMs seem to think in geometry, not language

Reddit r/LocalLLaMA

Researcher analyzes LLM internal representations across 8 languages and multiple models, finding that concept thinking occurs in geometric space in middle transformer layers independent of input language, supporting a universal deep structure hypothesis similar to Chomsky's theory rather than Sapir-Whorf linguistic relativism.

Multiplication in Multimodal LLMs: Computation with Text, Image, and Audio Inputs

Hugging Face Daily Papers

This paper investigates the arithmetic limitations of multimodal LLMs on multi-digit multiplication across text, image, and audio modalities, introducing a controlled benchmark and a novel 'arithmetic load' metric (C) that better predicts model accuracy than traditional step-counting methods. Results show accuracy collapses as C grows, and that performance degradation is primarily computational rather than perceptual.