LSTM Networks Can Perform Dynamic Counting
Not on the map. Why?
Abstract (arXiv)
In this paper, we systematically assess the ability of standard recurrent networks to perform dynamic counting and to encode hierarchical representations. All the neural models in our experiments are designed to be small-sized networks both to prevent them from memorizing the training sets and to visualize and interpret their behaviour at test time. Our results demonstrate that the Long Short-Term Memory (LSTM) networks can learn to recognize the well-balanced parenthesis language (Dyck-1) and the shuffles of multiple Dyck-1 languages, each defined over different parenthesis-pairs, by emulating simple real-time k-counter machines. To the best of our knowledge, this work is the first study to introduce the shuffle languages to analyze the computational power of neural networks. We also show that a single-layer LSTM with only one hidden unit is practically sufficient for recognizing the Dyck-1 language. However, none of our recurrent networks was able to yield a good performance on the Dyck-2 language learning task, which requires a model to have a stack-like mechanism for recognition.
Key facts. Cited by 45 papers in the map (data through 7 Oct 2026). First posted on arXiv 9 Jun 2019.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 7; 2022: 7; 2023: 9; 2024: 9; 2025: 7; 2026: 6.
45 papers.
Sort:
By area:
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2021Representing Numbers in NLP: a Survey and a Visioncited by 83
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 68
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Taskcited by 43
- 2025Between Circuits and Chomsky: Pre-pretraining on Formal Languages Imparts Linguistic Biasescited by 36
- 2023Foundation Metrics for Evaluating Effectiveness of Healthcare Conversations Powered by Generative AIcited by 32
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architecturescited by 29
- 2024Counting Ability of Large Language Models and Impact of Tokenizationcited by 29
33 more
- 2024Language Models Need Inductive Biases to Count Inductivelycited by 25
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
- 2023Practical Computational Power of Linear Transformers and Their Recurrent and Self-Referential Extensionscited by 20
- 2024What Languages are Easy to Language-Model? A Perspective from Learning Probabilistic Regular Languagescited by 20
- 2024Bridging the Empirical-Theoretical Gap in Neural Network Formal Language Learning Using Minimum Description Lengthcited by 14
- 2022Benchmarking Compositionality with Formal Languagescited by 12
- 2023Counting and Algorithmic Generalization with Transformerscited by 11
- 2021Can RNNs learn Recursive Nested Subject-Verb Agreements?cited by 9
- 2021Formal Language Theory Meets Modern NLPcited by 9
- 2025Tokenization Constraints in LLMs: A Study of Symbolic and Arithmetic Reasoning Limitscited by 9
- 2021Recognizing and Verifying Mathematical Equations using Multiplicative Differential Neural Unitscited by 8
- 2021As Easy as 1, 2, 3: Behavioural Testing of NMT Systems for Numerical Translationcited by 8
- 2025Meta-Learning Neural Mechanisms rather than Bayesian Priorscited by 8
- 2021Learning Bounded Context-Free-Grammar via LSTM and the Transformer:Difference and Explanationscited by 7
- 2022Exploring the Long-Term Generalization of Counting Behavior in RNNscited by 7
- 2023Introducing Rhetorical Parallelism Detection: A New Task with Datasets, Metrics, and Baselinescited by 7
- 2021The Limitations of Limited Context for Constituency Parsingcited by 5
- 2022Implicit N-grams Induced by Recurrencecited by 4
- 2025Which Word Orders Facilitate Length Generalization in LMs? An Investigation with GCG-Based Artificial Languagescited by 4
- 2022What do Large Language Models Learn beyond Language?cited by 3
- 2023Theoretical Conditions and Empirical Failure of Bracket Counting on Long Sequences with Linear Recurrent Networkscited by 3
- 2023Benchmarking Neural Network Generalization for Grammar Inductioncited by 3
- 2024Stability Analysis of Various Symbolic Rule Extraction Methods from Recurrent Neural Networkcited by 3
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networkscited by 3
- 2025Three tiers of computation in transformers and in brain architecturescited by 1
- 2025Searching for the Most Human-like Emergent Languagecited by 1
- 2024NUMCoT: Numerals and Units of Measurement in Chain-of-Thought Reasoning using Large Language Modelscited by 0
- 2024Precision, Stability, and Generalization: A Comprehensive Assessment of RNNs learnability capability for Classifying Counter and Dyck Languagescited by 0
- 2025Hardness of Learning Regular Languages in the Next Symbol Prediction Settingcited by 0
- 2026What Kind of Language is Easy to Language-Model Under Curriculum Learning?cited by 0
- 2026Rubato: Transcribing Piano Music with Timestampscited by 0
- 2026Refit the Probe: Single-Direction Ablation Is Not a Necessity Testcited by 0
- 2026Causally Evaluating the Learnability of Formal Language Taskscited by 0
- 2026Causally Evaluating the Learnability of Formal Language Tasks8 Jun 2026
- 2026Refit the Probe: Single-Direction Ablation Is Not a Necessity Test30 May 2026
- 2026Rubato: Transcribing Piano Music with Timestamps22 May 2026
- 2026What Kind of Language is Easy to Language-Model Under Curriculum Learning?29 Apr 2026
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networks2 Feb 2026
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Task8 Jan 2026
- 2025Hardness of Learning Regular Languages in the Next Symbol Prediction Setting21 Oct 2025
- 2025Which Word Orders Facilitate Length Generalization in LMs? An Investigation with GCG-Based Artificial Languages14 Oct 2025
- 2025Searching for the Most Human-like Emergent Language3 Oct 2025
- 2025Tokenization Constraints in LLMs: A Study of Symbolic and Arithmetic Reasoning Limits20 May 2025
- 2025Meta-Learning Neural Mechanisms rather than Bayesian Priors20 Mar 2025
- 2025Three tiers of computation in transformers and in brain architectures5 Mar 2025
33 more
- 2025Between Circuits and Chomsky: Pre-pretraining on Formal Languages Imparts Linguistic Biases26 Feb 2025
- 2024Training Neural Networks as Recognizers of Formal Languages11 Nov 2024
- 2024Counting Ability of Large Language Models and Impact of Tokenization25 Oct 2024
- 2024Precision, Stability, and Generalization: A Comprehensive Assessment of RNNs learnability capability for Classifying Counter and Dyck Languages4 Oct 2024
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architectures13 Jun 2024
- 2024What Languages are Easy to Language-Model? A Perspective from Learning Probabilistic Regular Languages6 Jun 2024
- 2024NUMCoT: Numerals and Units of Measurement in Chain-of-Thought Reasoning using Large Language Models5 Jun 2024
- 2024Language Models Need Inductive Biases to Count Inductively30 May 2024
- 2024Bridging the Empirical-Theoretical Gap in Neural Network Formal Language Learning Using Minimum Description Length15 Feb 2024
- 2024Stability Analysis of Various Symbolic Rule Extraction Methods from Recurrent Neural Network4 Feb 2024
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammars3 Dec 2023
- 2023Introducing Rhetorical Parallelism Detection: A New Task with Datasets, Metrics, and Baselines30 Nov 2023
- 2023What Formal Languages Can Transformers Express? A Survey1 Nov 2023
- 2023Practical Computational Power of Linear Transformers and Their Recurrent and Self-Referential Extensions24 Oct 2023
- 2023Counting and Algorithmic Generalization with Transformers12 Oct 2023
- 2023Foundation Metrics for Evaluating Effectiveness of Healthcare Conversations Powered by Generative AI21 Sep 2023
- 2023Benchmarking Neural Network Generalization for Grammar Induction16 Aug 2023
- 2023Theoretical Conditions and Empirical Failure of Bracket Counting on Long Sequences with Linear Recurrent Networks7 Apr 2023
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understanding7 Mar 2023
- 2022Exploring the Long-Term Generalization of Counting Behavior in RNNs29 Nov 2022
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functions22 Nov 2022
- 2022What do Large Language Models Learn beyond Language?21 Oct 2022
- 2022Benchmarking Compositionality with Formal Languages17 Aug 2022
- 2022Exploring Length Generalization in Large Language Models11 Jul 2022
- 2022Neural Networks and the Chomsky Hierarchy5 Jul 2022
- 2022Implicit N-grams Induced by Recurrence5 May 2022
- 2021Learning Bounded Context-Free-Grammar via LSTM and the Transformer:Difference and Explanations16 Dec 2021
- 2021As Easy as 1, 2, 3: Behavioural Testing of NMT Systems for Numerical Translation18 Jul 2021
- 2021The Limitations of Limited Context for Constituency Parsing3 Jun 2021
- 2021Recognizing and Verifying Mathematical Equations using Multiplicative Differential Neural Units7 Apr 2021
- 2021Representing Numbers in NLP: a Survey and a Vision24 Mar 2021
- 2021Formal Language Theory Meets Modern NLP19 Feb 2021
- 2021Can RNNs learn Recursive Nested Subject-Verb Agreements?6 Jan 2021
- 2024Counting Ability of Large Language Models and Impact of Tokenizationcited by 29
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
- 2025Tokenization Constraints in LLMs: A Study of Symbolic and Arithmetic Reasoning Limitscited by 9
- 2024NUMCoT: Numerals and Units of Measurement in Chain-of-Thought Reasoning using Large Language Modelscited by 0
- 2025Tokenization Constraints in LLMs: A Study of Symbolic and Arithmetic Reasoning Limits20 May 2025
- 2024Training Neural Networks as Recognizers of Formal Languages11 Nov 2024
- 2024Counting Ability of Large Language Models and Impact of Tokenization25 Oct 2024
- 2024NUMCoT: Numerals and Units of Measurement in Chain-of-Thought Reasoning using Large Language Models5 Jun 2024
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2021Representing Numbers in NLP: a Survey and a Visioncited by 83
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 68
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Taskcited by 43
- 2025Between Circuits and Chomsky: Pre-pretraining on Formal Languages Imparts Linguistic Biasescited by 36
- 2023Foundation Metrics for Evaluating Effectiveness of Healthcare Conversations Powered by Generative AIcited by 32
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architecturescited by 29
- 2024Language Models Need Inductive Biases to Count Inductivelycited by 25
12 most cited of 41 All 41 (JSON)
- 2026Causally Evaluating the Learnability of Formal Language Tasks8 Jun 2026
- 2026Refit the Probe: Single-Direction Ablation Is Not a Necessity Test30 May 2026
- 2026Rubato: Transcribing Piano Music with Timestamps22 May 2026
- 2026What Kind of Language is Easy to Language-Model Under Curriculum Learning?29 Apr 2026
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networks2 Feb 2026
- 2026When Models Manipulate Manifolds: The Geometry of a Counting Task8 Jan 2026
- 2025Hardness of Learning Regular Languages in the Next Symbol Prediction Setting21 Oct 2025
- 2025Which Word Orders Facilitate Length Generalization in LMs? An Investigation with GCG-Based Artificial Languages14 Oct 2025
- 2025Searching for the Most Human-like Emergent Language3 Oct 2025
- 2025Meta-Learning Neural Mechanisms rather than Bayesian Priors20 Mar 2025
- 2025Three tiers of computation in transformers and in brain architectures5 Mar 2025
- 2025Between Circuits and Chomsky: Pre-pretraining on Formal Languages Imparts Linguistic Biases26 Feb 2025
12 newest of 41 All 41 (JSON)