Transformer Working Memory Enables Regular Language Reasoning and Natural Language Length Extrapolation
Not on the map. Why?
Abstract (arXiv)
Unlike recurrent models, conventional wisdom has it that Transformers cannot perfectly model regular languages. Inspired by the notion of working memory, we propose a new Transformer variant named RegularGPT. With its novel combination of Weight-Sharing, Adaptive-Depth, and Sliding-Dilated-Attention, RegularGPT constructs working memory along the depth dimension, thereby enabling efficient and successful modeling of regular languages such as PARITY. We further test RegularGPT on the task of natural language length extrapolation and surprisingly find that it rediscovers the local windowed attention effect deemed necessary in prior work for length extrapolation.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 26 of its 46 references that are in the map. First posted on arXiv 5 May 2023.
Builds on
26 of 46 references.
References · 26
- 2017Attention Is All You Needcited by 60,361
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2016WaveNet: A Generative Model for Raw Audiocited by 1,722
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
- 2022Simplified State Space Layers for Sequence Modelingcited by 788
- 2018Universal Transformerscited by 647
14 more
- 2014Neural Turing Machinescited by 644
- 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 408
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2019Depth-Adaptive Transformercited by 236
- 2022Neural Networks and the Chomsky Hierarchycited by 217
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2017Parallelizing Linear Recurrent Neural Nets Over Sequence Lengthcited by 127
- 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 113
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
- 2021Adaptive Semiparametric Language Modelscited by 83
- 2021The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalizationcited by 62
- 2020Do Transformers Need Deep Long-Range Memorycited by 24
- 2022Characterizing Verbatim Short-Term Memory in Neural Language Modelscited by 8
Built on by
Citing papers per year: 2023: 3; 2024: 4; 2025: 3; 2026: 3.
13 papers.
Sort:
By area:
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
- 2023Guiding Language Model Reasoning with Planning Tokenscited by 58
- 2024Understanding Reasoning Ability of Language Models From the Perspective of Reasoning Paths Aggregationcited by 22
- 2024A Survey on Compositional Learning of AI Models: Theoretical and Experimental Practicescited by 15
- 2024A Theory for Length Generalization in Learning to Reasoncited by 11
- 2025A Review of Incorporating Psychological Theories in LLMscited by 6
- 2023Recursion in Recursion: Two-Level Nested Recursion for Length Generalization with Scalabilitycited by 5
- 2024Investigating Recurrent Transformers with Dynamic Haltcited by 5
- 2025CARMA: Enhanced Compositionality in LLMs via Advanced Regularisation and Mutual Information Alignmentcited by 3
- 2025Rethinking Memorization Measures and their Implications in Large Language Modelscited by 1
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspectivecited by 1
- 2026Length Generalization with Log-Depth Recurrent Unitscited by 1
1 more
- 2026Log-Depth Recurrent Language Modelingcited by 0
- 2026Log-Depth Recurrent Language Modeling23 Sep 2026
- 2026Length Generalization with Log-Depth Recurrent Units25 May 2026
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspective25 Apr 2026
- 2025Rethinking Memorization Measures and their Implications in Large Language Models20 Jul 2025
- 2025A Review of Incorporating Psychological Theories in LLMs28 Mar 2025
- 2025CARMA: Enhanced Compositionality in LLMs via Advanced Regularisation and Mutual Information Alignment16 Feb 2025
- 2024A Survey on Compositional Learning of AI Models: Theoretical and Experimental Practices13 Jun 2024
- 2024A Theory for Length Generalization in Learning to Reason31 Mar 2024
- 2024Understanding Reasoning Ability of Language Models From the Perspective of Reasoning Paths Aggregation5 Feb 2024
- 2024Investigating Recurrent Transformers with Dynamic Halt1 Feb 2024
- 2023Recursion in Recursion: Two-Level Nested Recursion for Length Generalization with Scalability8 Nov 2023
- 2023What Algorithms can Transformers Learn? A Study in Length Generalization24 Oct 2023
1 more
- 2023Guiding Language Model Reasoning with Planning Tokens9 Oct 2023
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
- 2024A Survey on Compositional Learning of AI Models: Theoretical and Experimental Practicescited by 15
- 2024A Theory for Length Generalization in Learning to Reasoncited by 11
- 2025A Review of Incorporating Psychological Theories in LLMscited by 6
- 2023Recursion in Recursion: Two-Level Nested Recursion for Length Generalization with Scalabilitycited by 5
- 2024Investigating Recurrent Transformers with Dynamic Haltcited by 5
- 2025CARMA: Enhanced Compositionality in LLMs via Advanced Regularisation and Mutual Information Alignmentcited by 3
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspectivecited by 1
- 2026Length Generalization with Log-Depth Recurrent Unitscited by 1
- 2026Log-Depth Recurrent Language Modelingcited by 0
- 2026Log-Depth Recurrent Language Modeling23 Sep 2026
- 2026Length Generalization with Log-Depth Recurrent Units25 May 2026
- 2026Fine-tuning vs. In-context Learning in Large Language Models: A Formal Language Learning Perspective25 Apr 2026
- 2025A Review of Incorporating Psychological Theories in LLMs28 Mar 2025
- 2025CARMA: Enhanced Compositionality in LLMs via Advanced Regularisation and Mutual Information Alignment16 Feb 2025
- 2024A Survey on Compositional Learning of AI Models: Theoretical and Experimental Practices13 Jun 2024
- 2024A Theory for Length Generalization in Learning to Reason31 Mar 2024
- 2024Investigating Recurrent Transformers with Dynamic Halt1 Feb 2024
- 2023Recursion in Recursion: Two-Level Nested Recursion for Length Generalization with Scalability8 Nov 2023
- 2023What Algorithms can Transformers Learn? A Study in Length Generalization24 Oct 2023