Research map / Large language models / Agents, code and math
Arithmetic Without Algorithms: Language Models Solve Math with a Bag of Heuristics
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Uses causal circuit analysis and neuron-level heuristic classification to show that pretrained LLMs perform arithmetic via a "bag of heuristics" rather than a robust algorithm or pure memorization.
Problem
Whether LLMs solve arithmetic reasoning with generalizable algorithms or by memorizing input-output patterns, and what mechanism implements arithmetic answers inside pretrained models.
Approach
Identifies the arithmetic circuit via activation patching, decomposes circuit MLP neurons into key-value heuristics, classifies neurons into human-defined heuristic types (range, modulo, pattern, identical operands, multi-result), and shows ablating heuristic neurons by type or by prompt reduces accuracy; the unordered combination of heuristics explains most accuracy and emerges early in training.
Key results
- Llama3-8B circuit achieves 0.96 average faithfulness across the four operators, and only ~200 neurons per layer (~1.5%) are needed for high faithfulness.
- 91% of the 3,200 top neurons (200 per layer across 16 layers, per operator) are classified as arithmetic heuristics.
- Heuristic neurons from the final Pythia-6.9B checkpoint explain on average 79% of heuristic contribution at intermediate checkpoints, and ablating 25 heuristic neurons per layer drives near-zero accuracy at all training stages.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Ablate neurons classified as a specific heuristic (ablation) | Llama3-8B arithmetic circuit · Correct arithmetic prompts associated with the ablated heuristic | accuracy: average drop of 29% out of 95% average pre-ablation accuracy | Hurt |
| Ablate neurons classified as a specific heuristic (ablation) | Llama3-8B arithmetic circuit · Prompts associated with the heuristic versus prompts not associated with it | accuracy | Mixed |
| Ablate the highest-scoring neurons from heuristics associated with each prompt rather than an equal number from unassociated heuristics (ablation) | Arithmetic models · Arithmetic prompts | accuracy | Hurt |
| Ablate 25 prompt-associated heuristic neurons per layer (ablation) | Pythia-6.9B checkpoints · Arithmetic prompts across training stages | accuracy: near-zero accuracy | Hurt |
| Use neurons mutual with the final checkpoint as the heuristic set (ablation) | Pythia-6.9B intermediate checkpoints · Arithmetic prompts across training | share of total heuristics' contribution to accuracy: 79% | Helped |
| Ablate prompt-associated heuristic neurons instead of a similar number of random heuristic neurons (ablation) | Pythia-6.9B checkpoints · Correct arithmetic prompts, including earlier checkpoints | accuracy | Hurt |
| Use the arithmetic circuit rather than the full model | Llama3-8B · Arithmetic prompts across four operators | faithfulness: 0.96 | Helped |
| Keep only 200 high-effect neurons per layer | Llama3-8B middle- and late-layer MLP circuit · Arithmetic prompts | faithfulness: only 200 neurons (roughly 1.5%) per layer are needed to achieve high faithfulness | Helped |
| Keep the top 1% of MLP0 neurons in the circuit | Llama3-8B arithmetic circuit · Arithmetic prompts | faithfulness: 1% | Helped |
Surprising findings
- Ablating neurons of a heuristic type causes an average 29% accuracy drop out of 95% pre-ablation accuracy, so no single heuristic is sufficient.
- Incorrect prompts do not have fewer associated heuristic neurons than correct ones; failures are attributed to weaker total logit contribution instead.
Limitations
- Heuristic types are human-defined and may impose human biases on model abstractions.
- Analysis is limited to LLMs whose tokenizers merge multiple digits; single-digit tokenization could yield different conclusions.
- Heuristic classification threshold was chosen manually with estimated false classifications, with no ground-truth neuron-to-heuristic labels.
Experimental setup
Datasets: synthetic arithmetic prompts (operands in [0,300], four operators)
Benchmarks: synthetic arithmetic prompts
Metrics: faithfulness accuracy normalized logit knockout accuracy drop probe accuracy
Baselines: Fourier-feature account of addition (Zhou et al.) Nanda et al. modular addition circuit
Builds on: activation patching key-value memories logit lens TransformerLens
Closest papers by meaning
- Interpreting and Improving Large Language Models in Arithmetic Calculation (ICML 2024 · similarity 0.92)
- Frugal LMs Trained to Invoke Symbolic Solvers Achieve Parameter-Efficient Arithmetic Reasoning (AAAI 2024 · similarity 0.90)
- Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Process (ICLR 2025 · similarity 0.88)
- Learning Theorem Rationale for Improving the Mathematical Reasoning Capability of Large Language Models (AAAI 2025 · similarity 0.88)
- A Careful Examination of Large Language Model Performance on Grade School Arithmetic (NeurIPS 2024 · similarity 0.88)
- Advancing Mathematical Reasoning in Language Models: The Impact of Problem-Solving Data, Data Synthesis Methods, and Training Stages (ICLR 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
