Understanding Addition in Transformers

Philip Quirke, Fazl Barez
2/12/2026

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Understanding the inner workings of machine learning models like Transformers is vital for their safe and ethical use. This paper presents an in-depth analysis of a one-layer Transformer model trained for integer addition. We reveal that the model divides the task into parallel, digit-specific streams and employs distinct algorithms for different digit positions. Our study also finds that the model starts calculations late but executes them rapidly. A rare use case with high loss is identified and explained. Overall, the model's algorithm is explained in detail. These findings are validated through rigorous testing and mathematical modeling, contributing to the broader works in Mechanistic Interpretability, AI safety, and alignment. Our approach opens the door for analyzing more complex tasks and multi-layer Transformer models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{quirke2026understanding,
  title  = {Understanding Addition in Transformers},
  author = {Philip Quirke and Fazl Barez},
  year   = {2026},
  eprint = {2310.13121},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.13121},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.13121.svg)](https://codeofpaper.com/paper/2310.13121)

Discussion