mlsanityData to 13 Oct 2026

All for One: LLMs Solve Mental Math at the Last Token With Information Transferred From Other Tokens

arXiv 2509.09650 ↗First posted 11 Sep 2025cs.CLcited by 5

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) demonstrate proficiency across numerous computational tasks, yet their inner workings remain unclear. In theory, the combination of causal self-attention and multilayer perceptron layers allows every token to access and compute information based on all preceding tokens. In practice, to what extent are such operations present? In this paper, on mental math tasks (i.e., direct math calculation via next-token prediction without explicit reasoning), we investigate this question in three steps: inhibiting input-specific token computations in the initial layers, restricting the routes of information transfer across token positions in the next few layers, and forcing all computation to happen at the last token in the remaining layers. With two proposed techniques, Context-Aware Mean Ablation (CAMA) and Attention-Based Peeking (ABP), we identify an All-for-One subgraph (AF1) with high accuracy on a wide variety of mental math tasks, where meaningful computation occurs very late (in terms of layer depth) and only at the last token, which receives information of other tokens in few specific middle layers. Experiments on a variety of models and arithmetic expressions show that this subgraph is sufficient and necessary for high model performance, transfers across different models, and works on a variety of input styles. Ablations on different CAMA and ABP alternatives reveal their unique advantages over other methods, which may be of independent interest.

Key facts. Cited by 5 papers in the map (data through 13 Oct 2026). Builds on 26 of its 35 references that are in the map. First posted on arXiv 11 Sep 2025.

Builds on

26 of 35 references.

References · 26

  1. 2017Attention Is All You Needcited by 60,106
  2. 2022Locating and Editing Factual Associations in GPTcited by 2,650
  3. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,137
  4. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,994
  5. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,145
  6. 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,049
  7. 2023Progress measures for grokking via mechanistic interpretabilitycited by 831
  8. 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 517
  9. 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 420
  10. 2023In-Context Learning Creates Task Vectorscited by 305
  11. 2023Linearity of Relation Decoding in Transformer Language Modelscited by 195
  12. 2023Localizing Model Behavior with Path Patchingcited by 188
14 more
  1. 2024Do Large Language Models Latently Perform Multi-Hop Reasoning?cited by 169
  2. 2024Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristicscited by 96
  3. 2024Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalizationcited by 78
  4. 2024Hopping Too Late: Exploring the Limitations of Large Language Models on Multi-Hop Queriescited by 78
  5. 2024Spectral Filters, Dark Signals, and Attention Sinkscited by 55
  6. 2024How to think step-by-step: A mechanistic understanding of chain-of-thought reasoningcited by 53
  7. 2025Do Language Models Use Their Depth Efficiently?cited by 49
  8. 2024Identifying Semantic Induction Heads to Understand In-Context Learningcited by 47
  9. 2024Understanding and Patching Compositional Reasoning in LLMscited by 46
  10. 2024Interpreting and Improving Large Language Models in Arithmetic Calculationcited by 44
  11. 2024Summing Up the Facts: Additive Mechanisms Behind Factual Recall in LLMscited by 40
  12. 2023Memory Injections: Correcting Multi-Hop Reasoning Failures during Inference in Transformer-Based Language Modelscited by 21
  13. 2024An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMscited by 20
  14. 2023Arithmetic with Language Models: from Memorization to Computationcited by 12

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2025: 1; 2026: 4.

5 papers.