[Paper Review] Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics
This paper reveals that large language models solve arithmetic reasoning not through learned algorithms or memorization, but via a 'bag of heuristics'—a sparse set of neurons each implementing simple, pattern-based rules that boost logits for specific numerical ranges or patterns. The mechanism emerges early in training and explains most model accuracy, challenging assumptions about algorithmic generalization in LLMs.
Do large language models (LLMs) solve reasoning tasks by learning robust generalizable algorithms, or do they memorize training data? To investigate this question, we use arithmetic reasoning as a representative task. Using causal analysis, we identify a subset of the model (a circuit) that explains most of the model's behavior for basic arithmetic logic and examine its functionality. By zooming in on the level of individual circuit neurons, we discover a sparse set of important neurons that implement simple heuristics. Each heuristic identifies a numerical input pattern and outputs corresponding answers. We hypothesize that the combination of these heuristic neurons is the mechanism used to produce correct arithmetic answers. To test this, we categorize each neuron into several heuristic types-such as neurons that activate when an operand falls within a certain range-and find that the unordered combination of these heuristic types is the mechanism that explains most of the model's accuracy on arithmetic prompts. Finally, we demonstrate that this mechanism appears as the main source of arithmetic accuracy early in training. Overall, our experimental results across several LLMs show that LLMs perform arithmetic using neither robust algorithms nor memorization; rather, they rely on a "bag of heuristics".
Motivation & Objective
- To investigate whether large language models (LLMs) solve arithmetic reasoning via robust algorithms or memorization of training data.
- To reverse-engineer the internal mechanism of LLMs' arithmetic reasoning at the neuron level.
- To determine when and how the heuristic-based mechanism emerges during training.
- To classify and quantify the role of individual neurons in arithmetic accuracy.
- To challenge the assumption that LLMs generalize through algorithmic reasoning by demonstrating reliance on heuristic patterns.
Proposed method
- Using causal analysis, the authors isolate a minimal circuit responsible for arithmetic reasoning in LLMs.
- They analyze individual neurons within the arithmetic circuit to identify those that activate for specific input patterns.
- Neurons are classified into heuristic types based on their activation patterns, such as result-range, pattern-based, or modulo-based rules.
- The contribution of each heuristic type to model accuracy is evaluated via ablation and faithfulness analysis.
- The emergence of heuristics is tracked across training stages to determine when the mechanism becomes dominant.
- Experiments are conducted across multiple LLMs (e.g., Llama3-8B, GPT-J) to ensure generalizability of findings.

Experimental results
Research questions
- RQ1Do LLMs solve arithmetic using robust, generalizable algorithms or memorization of training examples?
- RQ2What is the internal mechanism—specifically, the role of individual neurons—underlying arithmetic reasoning in LLMs?
- RQ3How do heuristic neurons contribute to model accuracy, and are they sufficient to explain performance?
- RQ4When does the 'bag of heuristics' mechanism emerge during training?
- RQ5To what extent do heuristic neurons generalize beyond the training distribution?
Key findings
- A sparse subset of neurons, each implementing a distinct heuristic, accounts for most of the model’s arithmetic accuracy.
- The mechanism is not algorithmic but a combination of unrelated heuristic rules, such as promoting logits for results in specific ranges or matching digit patterns.
- Heuristic neurons are active for specific input patterns—e.g., one neuron boosts logits for results between 240 and 270 when the answer falls in that range.
- The 'bag of heuristics' mechanism emerges early in training and becomes dominant, suggesting it is the primary mechanism from the outset.
- Faithfulness analysis confirms that the unordered combination of heuristic types explains the majority of model behavior on arithmetic prompts.
- Neurons that do not fit predefined heuristic types contribute minimally to accuracy, indicating the heuristic mechanism is both sufficient and necessary for correct performance.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.