mlsanityData to 13 Oct 2026

Counting and Algorithmic Generalization with Transformers

arXiv 2310.08661 ↗First posted 12 Oct 2023cs.LGcited by 11

Not on the map. Why?

Abstract (arXiv)

Algorithmic generalization in machine learning refers to the ability to learn the underlying algorithm that generates data in a way that generalizes out-of-distribution. This is generally considered a difficult task for most machine learning algorithms. Here, we analyze algorithmic generalization when counting is required, either implicitly or explicitly. We show that standard Transformers are based on architectural decisions that hinder out-of-distribution performance for such tasks. In particular, we discuss the consequences of using layer normalization and of normalizing the attention weights via softmax. With ablation of the problematic operations, we demonstrate that a modified transformer can exhibit a good algorithmic generalization performance on counting while using a very lightweight architecture.

Key facts. Cited by 11 papers in the map (data through 13 Oct 2026). Builds on 10 of its 17 references that are in the map. First posted on arXiv 12 Oct 2023.

Builds on

10 of 17 references.

References · 10

  1. 2017Attention Is All You Needcited by 60,106
  2. 2018Universal Transformerscited by 632
  3. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 287
  4. 2015Neural GPUs Learn Algorithmscited by 120
  5. 2018On the Practical Computational Power of Finite Precision RNNs for Language Recognitioncited by 117
  6. 2019LSTM Networks Can Perform Dynamic Countingcited by 45
  7. 2016Extensions and Limitations of the Neural GPUcited by 7
  8. 2022Transformers discover an elementary calculation system exploiting local attention and grid-like problem representationcited by 7
  9. 2022Exploring the Long-Term Generalization of Counting Behavior in RNNscited by 7
  10. 2017Improving the Neural GPU Architecture for Algorithm Learningcited by 4

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2024: 3; 2025: 4; 2026: 4.

11 papers.