mlsanityData to 7 Oct 2026

Investigating the Limitations of Transformers with Simple Arithmetic Tasks

arXiv 2102.13019 ↗First posted 25 Feb 2021cs.CL cs.AI cs.LGcited by 136

Not on the map. Why?

Cited by 29 in LLM reasoning, but placed by its own abstract, which didn’t fit.

Abstract (arXiv)

The ability to perform arithmetic tasks is a remarkable trait of human intelligence and might form a critical component of more complex reasoning tasks. In this work, we investigate if the surface form of a number has any influence on how sequence-to-sequence language models learn simple arithmetic tasks such as addition and subtraction across a wide range of values. We find that how a number is represented in its surface form has a strong influence on the model's accuracy. In particular, the model fails to learn addition of five-digit numbers when using subwords (e.g., "32"), and it struggles to learn with character-level representations (e.g., "3 2"). By introducing position tokens (e.g., "3 10e1 2"), the model learns to accurately add and subtract numbers up to 60 digits. We conclude that modern pretrained language models can easily learn arithmetic from very few examples, as long as we use the proper surface representation. This result bolsters evidence that subword tokenizers and positional encodings are components in current transformer designs that might need improvement. Moreover, we show that regardless of the number of parameters and training examples, models cannot learn addition rules that are independent of the length of the numbers seen during training. Code to reproduce our experiments is available at https://github.com/castorini/transformers-arithmetic

Key facts. Cited by 136 papers in the map (data through 7 Oct 2026). Builds on 36 of its 49 references that are in the map. First posted on arXiv 25 Feb 2021.

Builds on

36 of 49 references.

References · 36

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2018Deep contextualized word representationscited by 2,285
  6. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  7. 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,046
  8. 2019DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphscited by 883
  9. 2018Universal Transformerscited by 613
  10. 2020Scaling Laws for Autoregressive Generative Modelingcited by 510
  11. 2020Generative Language Modeling for Automated Theorem Provingcited by 379
  12. 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
24 more
  1. 2019Deep Learning for Symbolic Mathematicscited by 266
  2. 2021Scaling Laws for Transfercited by 265
  3. 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
  4. 2019oLMpics -- On what Language Model Pre-training Capturescited by 161
  5. 2019Do NLP Models Know Numbers? Probing Numeracy in Embeddingscited by 157
  6. 2020Injecting Numerical Reasoning Skills into Language Modelscited by 133
  7. 2015Neural GPUs Learn Algorithmscited by 118
  8. 2020Birds have four legs?! NumerSense: Probing Numerical Commonsense Knowledge of Pre-trained Language Modelscited by 110
  9. 2015Inferring Algorithmic Patterns with Stack-Augmented Recurrent Netscited by 76
  10. 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
  11. 2018Neural Arithmetic Logic Unitscited by 69
  12. 2020Do Language Embeddings Capture Scales?cited by 63
  13. 2019NumNet: Machine Reading Comprehension with Numerical Reasoningcited by 59
  14. 2019Encoding word order in complex embeddingscited by 53
  15. 2019Giving BERT a Calculator: Finding Operations and Arguments with Reading Comprehensioncited by 51
  16. 2020The EOS Decision and Length Extrapolationcited by 46
  17. 2019EQUATE: A Benchmark Evaluation Framework for Quantitative Reasoning in Natural Language Inferencecited by 39
  18. 2019Enhancing the Transformer with Explicit Relational Encoding for Math Problem Solvingcited by 34
  19. 2015Grid Long Short-Term Memorycited by 19
  20. 2019Text2Math: End-to-end Parsing Text into Math Expressionscited by 13
  21. 2020Towards Question Format Independent Numerical Reasoning: A Set of Prerequisite Taskscited by 10
  22. 2020Probing for Multilingual Numerical Understanding in Transformer-Based Language Modelscited by 10
  23. 2016Extensions and Limitations of the Neural GPUcited by 7
  24. 2019Quantity Tagger: A Latent-Variable Sequence Labeling Approach to Solving Addition-Subtraction Word Problemscited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 8; 2022: 17; 2023: 24; 2024: 47; 2025: 24; 2026: 16.

136 papers.

Sort:

By area:

  1. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  2. 2022PAL: Program-aided Language Modelscited by 635
  3. 2023ToolQA: A Dataset for LLM Question Answering with External Toolscited by 273
  4. 2022Transformers Learn Shortcuts to Automatacited by 260
  5. 2022Reasoning with Language Model Prompting: A Surveycited by 251
  6. 2025Reasoning with Latent Thoughts: On the Power of Looped Transformerscited by 223
  7. 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 199
  8. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  9. 2022LIFT: Language-Interfaced Fine-Tuning for Non-Language Machine Learning Taskscited by 146
  10. 2022mGPT: Few-Shot Learners Go Multilingualcited by 141
  11. 2023How well do Large Language Models perform in Arithmetic tasks?cited by 130
  12. 2023Teaching Arithmetic to Small Transformerscited by 121
38 more
  1. 2024Tokenization counts: the impact of tokenization on arithmetic in frontier LLMscited by 112
  2. 2022Teaching Algorithmic Reasoning via In-context Learningcited by 111
  3. 2023Goat: Fine-tuned LLaMA Outperforms GPT-4 on Arithmetic Taskscited by 84
  4. 2021Representing Numbers in NLP: a Survey and a Visioncited by 83
  5. 2024A Primer on the Inner Workings of Transformer-based Language Modelscited by 83
  6. 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
  7. 2022Limitations of Language Models in Arithmetic and Symbolic Inductioncited by 71
  8. 2023GPT Can Solve Mathematical Problems Without a Calculatorcited by 68
  9. 2023Auto-Regressive Next-Token Predictors are Universal Learnerscited by 65
  10. 2024Getting the most out of your tokenizer for pre-training and domain adaptationcited by 65
  11. 2023Length Generalization in Arithmetic Transformerscited by 64
  12. 2021Linear algebra with transformerscited by 62
  13. 2025SuperBPE: Space Travel for Language Modelscited by 58
  14. 2023Positional Description Matters for Transformers Arithmeticcited by 56
  15. 2024BioT5+: Towards Generalized Biological Understanding with IUPAC Integration and Multi-task Tuningcited by 54
  16. 2024Interpreting and Improving Large Language Models in Arithmetic Calculationcited by 43
  17. 2024Evaluating Large Language Models on Time Series Feature Understanding: A Comprehensive Taxonomy and Benchmarkcited by 38
  18. 2024Pre-trained Large Language Models Use Fourier Features to Compute Additioncited by 38
  19. 2023The first step is the hardest: Pitfalls of Representing and Tokenizing Temporal Data for Large Language Modelscited by 34
  20. 2024OmniPred: Language Models as Universal Regressorscited by 34
  21. 2023Learning the greatest common divisor: explaining transformer predictionscited by 33
  22. 2023MultiTabQA: Generating Tabular Answers for Multi-Table Question Answeringcited by 32
  23. 2024Language Models Encode Numbers Using Digit Representations in Base 10cited by 32
  24. 2024PatternBoost: Constructions in Mathematics with a Little Help from AIcited by 32
  25. 2024Global Lyapunov functions: a long-standing open problem in mathematics, with symbolic transformerscited by 29
  26. 2022SALSA: Attacking Lattice Cryptography with Transformerscited by 28
  27. 2021Symbolic Brittleness in Sequence Models: on Systematic Generalization in Symbolic Mathematicscited by 27
  28. 2022On Neural Architecture Inductive Biases for Relational Taskscited by 26
  29. 2023Mathematical Language Models: A Surveycited by 24
  30. 2024Language Models Do Hard Arithmetic Tasks Easily and Hardly Do Easy Arithmetic Taskscited by 24
  31. 2024How Numerical Precision Affects Arithmetical Reasoning Capabilities of LLMscited by 24
  32. 2024Tools Fail: Detecting Silent Errors in Faulty Toolscited by 23
  33. 2022AA-TransUNet: Attention Augmented TransUNet For Nowcasting Taskscited by 22
  34. 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structurecited by 22
  35. 2025FoNE: Precise Single-Token Number Embeddings via Fourier Featurescited by 21
  36. 2024Position: Understanding LLMs Requires More Than Statistical Generalizationcited by 20
  37. 2022What is my math transformer doing? -- Three results on interpretability and generalizationcited by 19
  38. 2024Understanding LLM Embeddings for Regressioncited by 19

50 most cited of 136 All 136 (JSON)