mlsanityData to 7 Oct 2026

Understanding Addition and Subtraction in Transformers

arXiv 2402.02619 ↗First posted 4 Feb 2024cs.LG cs.CLcited by 6

Not on the map. Why?

Abstract (arXiv)

We use integer addition and subtraction as a controlled, exactly-solvable testbed for what can be said with confidence about the algorithm a low-loss transformer implements - logically and mechanically. We train small transformers (2-3 layers) from scratch, find the edge cases they fail (long carry and borrow cascades), and enrich the training data with them; most resulting models reach >99.999% accuracy on 5-15 digit problems in under an hour, solving cascades such as 555555555+444444448=+1000000003. Interpretability analysis of these accurate models - not an a-priori guess - surfaces the structure from which we derive novel, sound, exact left-to-right algorithms for both operations, matching the causal ordering transformers must use. We then put these algorithms back to the models: across 46 models varying in seed, depth, digit-length, and operation, the accurate ones share one circuit skeleton, and in representative models deeper causal analysis (activation and edge path-patching, with controls) confirms the multi-digit resolved-carry sub-task that earlier analyses left open - while ruling out several candidate mechanisms. The skeleton recurs across model sizes and operations, and mixed-model nodes are polysemantic across addition and subtraction whether initialized from an addition model or trained from scratch. We release the models, analysis, and a reproducible interpretability toolkit.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 9 of its 21 references that are in the map. First posted on arXiv 4 Feb 2024.

Builds on

9 of 21 references.

References · 9

  1. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  2. 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
  3. 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
  4. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
  5. 2023The Quantization Model of Neural Scalingcited by 137
  6. 2023Goat: Fine-tuned LLaMA Outperforms GPT-4 on Arithmetic Taskscited by 84
  7. 2023GPT Can Solve Mathematical Problems Without a Calculatorcited by 68
  8. 2023Memorization Capacity of Multi-Head Attention in Transformerscited by 39
  9. 2023Understanding Addition in Transformerscited by 34

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 0; 2026: 3.

6 papers.