Understanding Addition in Transformers
Not on the map. Why?
Abstract (arXiv)
Understanding the inner workings of machine learning models like Transformers is vital for their safe and ethical use. This paper provides a comprehensive analysis of a one-layer Transformer model trained to perform n-digit integer addition. Our findings suggest that the model dissects the task into parallel streams dedicated to individual digits, employing varied algorithms tailored to different positions within the digits. Furthermore, we identify a rare scenario characterized by high loss, which we explain. By thoroughly elucidating the model's algorithm, we provide new insights into its functioning. These findings are validated through rigorous testing and mathematical modeling, thereby contributing to the broader fields of model understanding and interpretability. Our approach opens the door for analyzing more complex tasks and multi-layer Transformer models.
Key facts. Cited by 34 papers in the map (data through 7 Oct 2026). Builds on 12 of its 21 references that are in the map. First posted on arXiv 19 Oct 2023.
Builds on
12 of 21 references.
References · 12
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,400
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
- 2023Large Language Modelscited by 774
- 2017Network Dissection: Quantifying Interpretability of Deep Visual Representationscited by 703
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
- 2019Deep symbolic regression: Recovering mathematical expressions from data via risk-seeking policy gradientscited by 294
- 2019A Multiscale Visualization of Attention in the Transformer Modelcited by 292
- 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networkscited by 126
- 2023Interpreting Learned Feedback Patterns in Large Language Modelscited by 4
- 2019Creative AI Through Evolutionary Computationcited by 3
Built on by
Citing papers per year: 2024: 15; 2025: 9; 2026: 10.
34 papers.
Sort:
By area:
- 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 415
- 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Modelscited by 39
- 2025Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challengescited by 30
- 2024Hypothesis Testing the Circuit Hypothesis in LLMscited by 29
- 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structurecited by 22
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Modelscited by 22
- 2024Opening the AI black box: program synthesis via mechanistic interpretabilitycited by 19
- 2024Algorithmic Capabilities of Random Transformerscited by 17
- 2024Transformers Learn Low Sensitivity Functions: Investigations and Implicationscited by 13
- 2025Extrapolation by Association: Length Generalization Transfer in Transformerscited by 13
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Taskscited by 10
- 2024What Does It Mean to Be a Transformer? Insights from a Theoretical Hessian Analysiscited by 9
22 more
- 2024InversionView: A General-Purpose Method for Reading Information from Neural Activationscited by 7
- 2024Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformerscited by 7
- 2024Understanding Addition and Subtraction in Transformerscited by 6
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformerscited by 6
- 2024Counting in Small Transformers: The Delicate Interplay between Attention and Feed-Forward Layerscited by 5
- 2024Clustering and Alignment: Understanding the Training Dynamics in Modular Additioncited by 5
- 2024Validating Mechanistic Interpretations: An Axiomatic Approachcited by 4
- 2025Path Channels and Plan Extension Kernels: a Mechanistic Description of Planning in a Sokoban RNNcited by 4
- 2025Learning the symmetric group: large from smallcited by 3
- 2025Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMscited by 3
- 2025Efficient Knowledge Probing of Large Language Models by Adapting Pre-trained Embeddingscited by 3
- 2026The Long Delay to Arithmetic Generalization: When Learned Representations Outrun Behaviorcited by 3
- 2025From Prediction to Understanding: Will AI Foundation Models Transform Brain Science?cited by 2
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizercited by 2
- 2025Learning Modular Exponentiation with Transformerscited by 0
- 2026Breaking the Data Barrier in Learning Symbolic Computation: A Case Study on Variable Ordering Suggestion for Cylindrical Algebraic Decompositioncited by 0
- 2026The Anxiety of Influence: Bloom Filters in Transformer Attention Headscited by 0
- 2026Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directionscited by 0
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTscited by 0
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Pathcited by 0
- 2026Sparsity Moves Computation: How FFN Architecture Reshapes Attention in Small Transformerscited by 0
- 2026Pretraining Curricula Enable Selective Fine-tuningcited by 0
- 2026Pretraining Curricula Enable Selective Fine-tuning6 Jul 2026
- 2026Sparsity Moves Computation: How FFN Architecture Reshapes Attention in Small Transformers10 May 2026
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizer6 May 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026The Long Delay to Arithmetic Generalization: When Learned Representations Outrun Behavior30 Mar 2026
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTs27 Mar 2026
- 2026Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directions22 Feb 2026
- 2026The Anxiety of Influence: Bloom Filters in Transformer Attention Heads19 Feb 2026
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Models20 Jan 2026
- 2026Breaking the Data Barrier in Learning Symbolic Computation: A Case Study on Variable Ordering Suggestion for Cylindrical Algebraic Decomposition20 Jan 2026
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformers3 Oct 2025
- 2025From Prediction to Understanding: Will AI Foundation Models Transform Brain Science?21 Sep 2025
22 more
- 2025Efficient Knowledge Probing of Large Language Models by Adapting Pre-trained Embeddings8 Aug 2025
- 2025Learning Modular Exponentiation with Transformers30 Jun 2025
- 2025Path Channels and Plan Extension Kernels: a Mechanistic Description of Planning in a Sokoban RNN11 Jun 2025
- 2025Extrapolation by Association: Length Generalization Transfer in Transformers10 Jun 2025
- 2025Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMs9 Jun 2025
- 2025Learning the symmetric group: large from small18 Feb 2025
- 2025Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challenges3 Feb 2025
- 2024Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformers18 Nov 2024
- 2024Hypothesis Testing the Circuit Hypothesis in LLMs16 Oct 2024
- 2024What Does It Mean to Be a Transformer? Insights from a Theoretical Hessian Analysis14 Oct 2024
- 2024Algorithmic Capabilities of Random Transformers6 Oct 2024
- 2024Clustering and Alignment: Understanding the Training Dynamics in Modular Addition18 Aug 2024
- 2024Validating Mechanistic Interpretations: An Axiomatic Approach18 Jul 2024
- 2024Counting in Small Transformers: The Delicate Interplay between Attention and Feed-Forward Layers16 Jul 2024
- 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Models13 Jun 2024
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks4 Jun 2024
- 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structure31 May 2024
- 2024InversionView: A General-Purpose Method for Reading Information from Neural Activations27 May 2024
- 2024Mechanistic Interpretability for AI Safety -- A Review22 Apr 2024
- 2024Transformers Learn Low Sensitivity Functions: Investigations and Implications11 Mar 2024
- 2024Opening the AI black box: program synthesis via mechanistic interpretability7 Feb 2024
- 2024Understanding Addition and Subtraction in Transformers4 Feb 2024
- 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 415
- 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Modelscited by 39
- 2024Hypothesis Testing the Circuit Hypothesis in LLMscited by 29
- 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structurecited by 22
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Modelscited by 22
- 2024Opening the AI black box: program synthesis via mechanistic interpretabilitycited by 19
- 2024Algorithmic Capabilities of Random Transformerscited by 17
- 2024Transformers Learn Low Sensitivity Functions: Investigations and Implicationscited by 13
- 2025Extrapolation by Association: Length Generalization Transfer in Transformerscited by 13
- 2024What Does It Mean to Be a Transformer? Insights from a Theoretical Hessian Analysiscited by 9
- 2024InversionView: A General-Purpose Method for Reading Information from Neural Activationscited by 7
- 2024Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformerscited by 7
12 most cited of 30 All 30 (JSON)
- 2026Pretraining Curricula Enable Selective Fine-tuning6 Jul 2026
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizer6 May 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026The Long Delay to Arithmetic Generalization: When Learned Representations Outrun Behavior30 Mar 2026
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTs27 Mar 2026
- 2026Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directions22 Feb 2026
- 2026The Anxiety of Influence: Bloom Filters in Transformer Attention Heads19 Feb 2026
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Models20 Jan 2026
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformers3 Oct 2025
- 2025From Prediction to Understanding: Will AI Foundation Models Transform Brain Science?21 Sep 2025
- 2025Efficient Knowledge Probing of Large Language Models by Adapting Pre-trained Embeddings8 Aug 2025
- 2025Learning Modular Exponentiation with Transformers30 Jun 2025
12 newest of 30 All 30 (JSON)