mlsanityData to 7 Oct 2026

Positional Description Matters for Transformers Arithmetic

arXiv 2311.14737 ↗First posted 22 Nov 2023cs.CL cs.AI cs.LGcited by 56

Not on the map. Why?

Abstract (arXiv)

Transformers, central to the successes in modern Natural Language Processing, often falter on arithmetic tasks despite their vast capabilities --which paradoxically include remarkable coding abilities. We observe that a crucial challenge is their naive reliance on positional information to solve arithmetic problems with a small number of digits, leading to poor performance on larger numbers. Herein, we delve deeper into the role of positional encoding, and propose several ways to fix the issue, either by modifying the positional encoding directly, or by modifying the representation of the arithmetic task to leverage standard positional encoding differently. We investigate the value of these modifications for three tasks: (i) classical multiplication, (ii) length extrapolation in addition, and (iii) addition in natural language context. For (i) we train a small model on a small dataset (100M parameters and 300k samples) with remarkable aptitude in (direct, no scratchpad) 15 digits multiplication and essentially perfect up to 12 digits, while usual training in this context would give a model failing at 4 digits multiplication. In the experiments on addition, we use a mere 120k samples to demonstrate: for (ii) extrapolation from 10 digits to testing on 12 digits numbers while usual training would have no extrapolation, and for (iii) almost perfect accuracy up to 5 digits while usual training would be correct only up to 3 digits (which is essentially memorization with a training set of 120k samples).

Key facts. Cited by 56 papers in the map (data through 7 Oct 2026). Builds on 25 of its 25 references that are in the map. First posted on arXiv 22 Nov 2023.

Builds on

25 of 25 references.

References · 25

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  5. 2023Let's Verify Step by Stepcited by 3,598
  6. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  7. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  8. 2022Solving math word problems with process- and outcome-based feedbackcited by 871
  9. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
  10. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  11. 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 199
  12. 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 136
13 more
  1. 2023Teaching Arithmetic to Small Transformerscited by 121
  2. 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
  3. 2022Teaching Algorithmic Reasoning via In-context Learningcited by 111
  4. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 105
  5. 2022Limitations of Language Models in Arithmetic and Symbolic Inductioncited by 71
  6. 2023GPT Can Solve Mathematical Problems Without a Calculatorcited by 68
  7. 2023Length Generalization in Arithmetic Transformerscited by 64
  8. 2021The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalizationcited by 62
  9. 2021Linear algebra with transformerscited by 62
  10. 2021SHAPE: Shifted Absolute Position Embedding for Transformerscited by 37
  11. 2022Systematic Generalization and Emergent Structures in Transformers Trained on Structured Taskscited by 19
  12. 2022What is my math transformer doing? -- Three results on interpretability and generalizationcited by 19
  13. 2023Can neural networks do arithmetic? A survey on the elementary numerical skills of state-of-the-art deep learning modelscited by 18

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 28; 2025: 20; 2026: 8.

56 papers.

Sort:

By area:

  1. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
  2. 2024The pitfalls of next-token predictioncited by 156
  3. 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
  4. 2024Transformers Can Do Arithmetic with the Right Embeddingscited by 77
  5. 2024Can Language Models Learn to Skip Steps?cited by 59
  6. 2024How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpadcited by 35
  7. 2025Ignore the KL Penalty! Boosting Exploration on Critical Tokens to Enhance RL Fine-Tuningcited by 33
  8. 2024NumeroLogic: Number Encoding for Enhanced LLMs' Numerical Reasoningcited by 31
  9. 2025Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challengescited by 30
  10. 2024The CLRS-Text Algorithmic Reasoning Language Benchmarkcited by 28
  11. 2024Universal Length Generalization with Turing Programscited by 25
  12. 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structurecited by 22
38 more
  1. 2024On Positional Bias of Faithfulness for Long-form Summarizationcited by 22
  2. 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
  3. 2024LLMs Are Prone to Fallacies in Causal Inferencecited by 21
  4. 2025FoNE: Precise Single-Token Number Embeddings via Fourier Featurescited by 21
  5. 2024Do Language Models Exhibit the Same Cognitive Biases in Problem Solving as Human Learners?cited by 19
  6. 2024The SIFo Benchmark: Investigating the Sequential Instruction Following Ability of Large Language Modelscited by 18
  7. 2024Algorithmic Capabilities of Random Transformerscited by 17
  8. 2024Probabilistic Medical Predictions of Large Language Modelscited by 16
  9. 2025Lost at the Beginning of Reasoningcited by 15
  10. 2025Exposing Numeracy Gaps: A Benchmark to Evaluate Fundamental Numerical Abilities in Large Language Modelscited by 14
  11. 2025The Lookahead Limitation: Why Multi-Operand Addition is Hard for LLMscited by 13
  12. 2025Extrapolation by Association: Length Generalization Transfer in Transformerscited by 13
  13. 2024Transformers meet Neural Algorithmic Reasonerscited by 12
  14. 2024Your Context Is Not an Array: Unveiling Random Access Limitations in Transformerscited by 11
  15. 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Taskscited by 10
  16. 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
  17. 2025Quantitative Bounds for Length Generalization in Transformerscited by 8
  18. 2024ALTA: Compiler-Based Analysis of Transformerscited by 7
  19. 2025Efficient numeracy in language models through single-token number embeddingscited by 6
  20. 2024Quantifying artificial intelligence through algorithmic generalizationcited by 5
  21. 2024Automated Rewards via LLM-Generated Progress Functionscited by 4
  22. 2024Golden Touchstone: A Comprehensive Bilingual Benchmark for Evaluating Financial Large Language Modelscited by 4
  23. 2025QA-prompting: Improving Summarization with Large Language Models using Question-Answeringcited by 4
  24. 2025Reinforced Context Order Recovery for Adaptive Reasoning and Planningcited by 4
  25. 2026Seeing to Generalize: How Visual Data Corrects Binding Shortcutscited by 4
  26. 2024Provable Length Generalization in Sequence Prediction via Spectral Filteringcited by 3
  27. 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
  28. 2024Machine learning for modular multiplicationcited by 2
  29. 2025Context-aware Biases for Length Extrapolationcited by 2
  30. 2025Training LLMs Beyond Next Token Prediction -- Filling the Mutual Information Gapcited by 2
  31. 2024Learning interpretable positional encodings in transformers depends on initializationcited by 1
  32. 2025Discovering Learning-Friendly Generation Orders for Sequential Computationcited by 1
  33. 2025AuditAgent: Expert-Guided Multi-Agent Reasoning for Cross-Document Fraudulent Evidence Discoverycited by 1
  34. 2025Exact Learning of Arithmetic with Differentiable Agentscited by 1
  35. 2026A model of errors in transformerscited by 1
  36. 2026AI-rithmeticcited by 1
  37. 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)cited by 1
  38. 2024Positional Description for Numerical Normalizationcited by 0

50 most cited of 56 All 56 (JSON)