Pre-trained Large Language Models Use Fourier Features to Compute Addition
On the map: LLM reasoning → Mathematical reasoning
Abstract (arXiv)
Pre-trained large language models (LLMs) exhibit impressive mathematical reasoning capabilities, yet how they compute basic arithmetic, such as addition, remains unclear. This paper shows that pre-trained LLMs add numbers using Fourier features -- dimensions in the hidden state that represent numbers via a set of features sparse in the frequency domain. Within the model, MLP and attention layers use Fourier features in complementary ways: MLP layers primarily approximate the magnitude of the answer using low-frequency features, while attention layers primarily perform modular addition (e.g., computing whether the answer is even or odd) using high-frequency features. Pre-training is crucial for this mechanism: models trained from scratch to add numbers only exploit low-frequency features, leading to lower accuracy. Introducing pre-trained token embeddings to a randomly initialized model rescues its performance. Overall, our analysis demonstrates that appropriate pre-trained representations (e.g., Fourier features) can unlock the ability of Transformers to learn precise mechanisms for algorithmic tasks.
Key facts. Cited by 38 papers in the map (data through 7 Oct 2026). Placed in Mathematical reasoning, one of 17 directions in LLM reasoning. Builds on 29 of its 47 references that are in the map. First posted on arXiv 5 Jun 2024.
Builds on
29 of 47 references.
Closest ancestors · 2
Same direction, newest first
- 2022Limitations of Language Models in Arithmetic and Symbolic Induction9 Aug
- 2022NumGLUE: A Suite of Fundamental yet Challenging Mathematical Reasoning Tasks12 Apr
Other references · 27
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
- 2020Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domainscited by 2,170
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
- 2021Knowledge Neurons in Pretrained Transformerscited by 590
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 579
15 more
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Physics of Language Models: Part 3.1, Knowledge Storage and Extractioncited by 264
- 2023Mathematical Capabilities of ChatGPTcited by 263
- 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 199
- 2023A Toy Model of Universality: Reverse Engineering How Networks Learn Group Operationscited by 141
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 136
- 2023Teaching Arithmetic to Small Transformerscited by 121
- 2023Language Models Implement Simple Word2Vec-style Vector Arithmeticcited by 97
- 2021Representing Numbers in NLP: a Survey and a Visioncited by 83
- 2022Finding Skill Neurons in Pre-trained Transformer-based Language Modelscited by 65
- 2023Feature emergence via margin maximization: case studies in algebraic taskscited by 33
- 2023Harmonics of Learning: Universal Fourier Features Emerge in Invariant Networkscited by 23
- 2022Bispectral Neural Networkscited by 17
- 2023A polar prediction model for learning to represent visual transformationscited by 6
Built on by
Citing papers per year: 2024: 3; 2025: 21; 2026: 14.
38 papers.
Sort:
By area:
- 2024Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristicscited by 94
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Taskcited by 43
- 2024Language Models Encode Numbers Using Digit Representations in Base 10cited by 32
- 2025FoNE: Precise Single-Token Number Embeddings via Fourier Featurescited by 21
- 2025Probing for Arithmetic Errors in Language Modelscited by 17
- 2025Implicit Reasoning in Transformers is Reasoning through Shortcutscited by 14
- 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networkscited by 11
- 2025Understanding In-context Learning of Addition via Activation Subspacescited by 8
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retentioncited by 8
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learningcited by 7
- 2025Mechanistic Indicators of Understanding in Large Language Modelscited by 6
- 2025Modular Arithmetic: Language Models Solve Math Digit by Digitcited by 6
26 more
- 2024Composing Global Solutions to Reasoning Tasks via Algebraic Objects in Neural Netscited by 5
- 2026Convergent Evolution: How Different Language Models Learn Similar Number Representationscited by 5
- 2025CoCo-CoLa: Evaluating and Improving Language Adherence in Multilingual LLMscited by 4
- 2025Path Channels and Plan Extension Kernels: a Mechanistic Description of Planning in a Sokoban RNNcited by 4
- 2025Language Models Do Not Embed Numbers Continuouslycited by 4
- 2025In-Context Algebracited by 4
- 2026The Geometric Inductive Bias of Grokking: Bypassing Phase Transitions via Architectural Topologycited by 4
- 2025Investigating Compositional Reasoning in Time Series Foundation Modelscited by 3
- 2025Block Circulant Adapter for Large Language Modelscited by 3
- 2025Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMscited by 3
- 2025Pre-trained Language Models Learn Remarkably Accurate Representations of Numberscited by 3
- 2025Latent Concept Disentanglement in Transformer-based Language Modelscited by 3
- 2026Structuring Sparsity: Block-Sparse Featurizers Capture Visual Concept Manifoldscited by 3
- 2025Function Induction and Task Generalization: An Interpretability Study with Off-by-One Additioncited by 2
- 2025StreetMath: Study of LLMs' Approximation Behaviorscited by 2
- 2025Sequential Enumeration in Large Language Modelscited by 2
- 2026Shattered Compositionality: Counterintuitive Learning Dynamics of Transformers for Arithmeticcited by 2
- 2026Disentangling Geometry, Performance, and Training in Language Modelscited by 2
- 2025Language Models Learn Universal Representations of Numbers and Here's Why You Should Carecited by 1
- 2026TabFM: A Zero-Shot Foundation Model for Tabular Datacited by 1
- 2025Reverse Browser: Vector-Image-to-Code Generatorcited by 0
- 2026Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directionscited by 0
- 2026Language Models Compare Quantities Using Number-specific and Unit-specific Heuristicscited by 0
- 2026Causal and Interpretable Structures in LLM Compositional Taskscited by 0
- 2026A Polyphonic Conception of AI Understandingcited by 0
- 2026TabFM-Auto: Self-Evolving Pipelines for Tabular Foundation Modelscited by 0
- 2026TabFM-Auto: Self-Evolving Pipelines for Tabular Foundation Models29 Sep 2026
- 2026TabFM: A Zero-Shot Foundation Model for Tabular Data29 Sep 2026
- 2026A Polyphonic Conception of AI Understanding28 Sep 2026
- 2026Causal and Interpretable Structures in LLM Compositional Tasks28 Sep 2026
- 2026Structuring Sparsity: Block-Sparse Featurizers Capture Visual Concept Manifolds23 Jun 2026
- 2026Language Models Compare Quantities Using Number-specific and Unit-specific Heuristics2 Jun 2026
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retention28 May 2026
- 2026Convergent Evolution: How Different Language Models Learn Similar Number Representations22 Apr 2026
- 2026The Geometric Inductive Bias of Grokking: Bypassing Phase Transitions via Architectural Topology5 Mar 2026
- 2026Disentangling Geometry, Performance, and Training in Language Models24 Feb 2026
- 2026Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directions22 Feb 2026
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learning3 Feb 2026
26 more
- 2026Shattered Compositionality: Counterintuitive Learning Dynamics of Transformers for Arithmetic30 Jan 2026
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Task8 Jan 2026
- 2025In-Context Algebra18 Dec 2025
- 2025Sequential Enumeration in Large Language Models4 Dec 2025
- 2025Language Models Learn Universal Representations of Numbers and Here's Why You Should Care30 Oct 2025
- 2025StreetMath: Study of LLMs' Approximation Behaviors27 Oct 2025
- 2025Language Models Do Not Embed Numbers Continuously9 Oct 2025
- 2025Reverse Browser: Vector-Image-to-Code Generator5 Sep 2025
- 2025Modular Arithmetic: Language Models Solve Math Digit by Digit4 Aug 2025
- 2025Probing for Arithmetic Errors in Language Models16 Jul 2025
- 2025Function Induction and Task Generalization: An Interpretability Study with Off-by-One Addition14 Jul 2025
- 2025Mechanistic Indicators of Understanding in Large Language Models7 Jul 2025
- 2025Latent Concept Disentanglement in Transformer-based Language Models20 Jun 2025
- 2025Path Channels and Plan Extension Kernels: a Mechanistic Description of Planning in a Sokoban RNN11 Jun 2025
- 2025Pre-trained Language Models Learn Remarkably Accurate Representations of Numbers10 Jun 2025
- 2025Addition in Four Movements: Mapping Layer-wise Information Trajectories in LLMs9 Jun 2025
- 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networks6 Jun 2025
- 2025Understanding In-context Learning of Addition via Activation Subspaces8 May 2025
- 2025Block Circulant Adapter for Large Language Models1 May 2025
- 2025Implicit Reasoning in Transformers is Reasoning through Shortcuts10 Mar 2025
- 2025CoCo-CoLa: Evaluating and Improving Language Adherence in Multilingual LLMs18 Feb 2025
- 2025FoNE: Precise Single-Token Number Embeddings via Fourier Features13 Feb 2025
- 2025Investigating Compositional Reasoning in Time Series Foundation Models9 Feb 2025
- 2024Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics28 Oct 2024
- 2024Language Models Encode Numbers Using Digit Representations in Base 1015 Oct 2024
- 2024Composing Global Solutions to Reasoning Tasks via Algebraic Objects in Neural Nets2 Oct 2024
- 2024Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristicscited by 94
- 2025Implicit Reasoning in Transformers is Reasoning through Shortcutscited by 14
- 2025Investigating Compositional Reasoning in Time Series Foundation Modelscited by 3
- 2025StreetMath: Study of LLMs' Approximation Behaviorscited by 2
- 2025StreetMath: Study of LLMs' Approximation Behaviors27 Oct 2025
- 2025Implicit Reasoning in Transformers is Reasoning through Shortcuts10 Mar 2025
- 2025Investigating Compositional Reasoning in Time Series Foundation Models9 Feb 2025
- 2024Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics28 Oct 2024
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Taskcited by 43
- 2024Language Models Encode Numbers Using Digit Representations in Base 10cited by 32
- 2025FoNE: Precise Single-Token Number Embeddings via Fourier Featurescited by 21
- 2025Probing for Arithmetic Errors in Language Modelscited by 17
- 2025Alternating Gradient Flows: A Theory of Feature Learning in Two-layer Neural Networkscited by 11
- 2025Understanding In-context Learning of Addition via Activation Subspacescited by 8
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retentioncited by 8
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learningcited by 7
- 2025Mechanistic Indicators of Understanding in Large Language Modelscited by 6
- 2025Modular Arithmetic: Language Models Solve Math Digit by Digitcited by 6
- 2024Composing Global Solutions to Reasoning Tasks via Algebraic Objects in Neural Netscited by 5
- 2026Convergent Evolution: How Different Language Models Learn Similar Number Representationscited by 5
12 most cited of 33 All 33 (JSON)
- 2026TabFM: A Zero-Shot Foundation Model for Tabular Data29 Sep 2026
- 2026A Polyphonic Conception of AI Understanding28 Sep 2026
- 2026Causal and Interpretable Structures in LLM Compositional Tasks28 Sep 2026
- 2026Structuring Sparsity: Block-Sparse Featurizers Capture Visual Concept Manifolds23 Jun 2026
- 2026Language Models Compare Quantities Using Number-specific and Unit-specific Heuristics2 Jun 2026
- 2026Why Larger Models Learn More: Effects of Capacity, Interference, and Rare-Task Retention28 May 2026
- 2026Convergent Evolution: How Different Language Models Learn Similar Number Representations22 Apr 2026
- 2026The Geometric Inductive Bias of Grokking: Bypassing Phase Transitions via Architectural Topology5 Mar 2026
- 2026Disentangling Geometry, Performance, and Training in Language Models24 Feb 2026
- 2026Post-Routing Arithmetic in Llama-3: Last-Token Result Writing and Rotation-Structured Digit Directions22 Feb 2026
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learning3 Feb 2026
- 2026Shattered Compositionality: Counterintuitive Learning Dynamics of Transformers for Arithmetic30 Jan 2026
12 newest of 33 All 33 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2024Language Models Do Hard Arithmetic Tasks Easily and Hardly Do Easy Arithmetic Tasks
- 2025Language Models Use Trigonometry to Do Addition
- 2024Unraveling Arithmetic in Large Language Models: The Role of Algebraic Structures
- 2024How Numerical Precision Affects Arithmetical Reasoning Capabilities of LLMs
- 2026Disentangling Mathematical Reasoning in LLMs: A Methodological Investigation of Internal Mechanisms
- 2022Overcoming Barriers to Skill Injection in Language Modeling: Case Study in Arithmetic
- 2025Do Large Language Models Truly Grasp Addition? A Rule-Focused Diagnostic Using Two-Integer Arithmetic
- 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoning