On the Practical Ability of Recurrent Neural Networks to Recognize Hierarchical Languages
Not on the map. Why?
Abstract (arXiv)
While recurrent models have been effective in NLP tasks, their performance on context-free languages (CFLs) has been found to be quite weak. Given that CFLs are believed to capture important phenomena such as hierarchical structure in natural languages, this discrepancy in performance calls for an explanation. We study the performance of recurrent models on Dyck-n languages, a particularly important and well-studied class of CFLs. We find that while recurrent models generalize nearly perfectly if the lengths of the training and test strings are from the same range, they perform poorly if the test strings are longer. At the same time, we observe that recurrent models are expressive enough to recognize Dyck words of arbitrary lengths in finite precision if their depths are bounded. Hence, we evaluate our models on samples generated from Dyck languages with bounded depth and find that they are indeed able to generalize to much higher lengths. Since natural language datasets have nested dependencies of bounded depth, this may help explain why they perform well in modeling hierarchical dependencies in natural language data despite prior works indicating poor generalization performance on Dyck languages. We perform probing studies to support our results and provide comparisons with Transformers.
Key facts. Cited by 22 papers in the map (data through 7 Oct 2026). First posted on arXiv 8 Nov 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 3; 2023: 3; 2024: 2; 2025: 7; 2026: 6.
22 papers.
Sort:
By area:
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2022A Review on Language Models as Knowledge Basescited by 156
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 68
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
- 2025How Linguistics Learned to Stop Worrying and Love the Language Modelscited by 50
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architecturescited by 29
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
- 2022Benchmarking Compositionality with Formal Languagescited by 12
- 2021Learning Bounded Context-Free-Grammar via LSTM and the Transformer:Difference and Explanationscited by 7
- 2023Recurrent Neural Language Models as Probabilistic Finite-state Automatacited by 6
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attentioncited by 1
- 2025Learning Model Successorscited by 0
10 more
- 2025MapFormer: Self-Supervised Learning of Cognitive Maps with Input-Dependent Positional Embeddingscited by 0
- 2025Language models as tools for investigating the distinction between possible and impossible natural languagescited by 0
- 2025Large language models have learned to use languagecited by 0
- 2025Large language models are not about natural languagecited by 0
- 2025Linguists should learn to love speech-based deep learning modelscited by 0
- 2026Are Language Models Models?cited by 0
- 2026Across the Levels of Analysis: Explaining Predictive Processing in Humans Requires More Than Machine-Estimated Probabilitiescited by 0
- 2026You Can't Fight in Here! This is BBS!cited by 0
- 2026Not-So-Strange Love: Language Models and Generative Linguistic Theories are More Compatible than They Appearcited by 0
- 2026Causally Evaluating the Learnability of Formal Language Taskscited by 0
- 2026Causally Evaluating the Learnability of Formal Language Tasks8 Jun 2026
- 2026Not-So-Strange Love: Language Models and Generative Linguistic Theories are More Compatible than They Appear11 May 2026
- 2026You Can't Fight in Here! This is BBS!10 Apr 2026
- 2026Across the Levels of Analysis: Explaining Predictive Processing in Humans Requires More Than Machine-Estimated Probabilities10 Apr 2026
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attention2 Feb 2026
- 2026Are Language Models Models?15 Jan 2026
- 2025Linguists should learn to love speech-based deep learning models16 Dec 2025
- 2025Large language models are not about natural language15 Dec 2025
- 2025Large language models have learned to use language13 Dec 2025
- 2025Language models as tools for investigating the distinction between possible and impossible natural languages10 Dec 2025
- 2025MapFormer: Self-Supervised Learning of Cognitive Maps with Input-Dependent Positional Embeddings24 Nov 2025
- 2025Learning Model Successors31 Jan 2025
10 more
- 2025How Linguistics Learned to Stop Worrying and Love the Language Models28 Jan 2025
- 2024Training Neural Networks as Recognizers of Formal Languages11 Nov 2024
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architectures13 Jun 2024
- 2023Recurrent Neural Language Models as Probabilistic Finite-state Automata8 Oct 2023
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functions4 Oct 2023
- 2023Faith and Fate: Limits of Transformers on Compositionality29 May 2023
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functions22 Nov 2022
- 2022Benchmarking Compositionality with Formal Languages17 Aug 2022
- 2022A Review on Language Models as Knowledge Bases12 Apr 2022
- 2021Learning Bounded Context-Free-Grammar via LSTM and the Transformer:Difference and Explanations16 Dec 2021
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
- 2024Training Neural Networks as Recognizers of Formal Languages11 Nov 2024
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2022A Review on Language Models as Knowledge Basescited by 156
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 68
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
- 2025How Linguistics Learned to Stop Worrying and Love the Language Modelscited by 50
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architecturescited by 29
- 2022Benchmarking Compositionality with Formal Languagescited by 12
- 2021Learning Bounded Context-Free-Grammar via LSTM and the Transformer:Difference and Explanationscited by 7
- 2023Recurrent Neural Language Models as Probabilistic Finite-state Automatacited by 6
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attentioncited by 1
- 2025Learning Model Successorscited by 0
- 2025MapFormer: Self-Supervised Learning of Cognitive Maps with Input-Dependent Positional Embeddingscited by 0
12 most cited of 21 All 21 (JSON)
- 2026Causally Evaluating the Learnability of Formal Language Tasks8 Jun 2026
- 2026Not-So-Strange Love: Language Models and Generative Linguistic Theories are More Compatible than They Appear11 May 2026
- 2026You Can't Fight in Here! This is BBS!10 Apr 2026
- 2026Across the Levels of Analysis: Explaining Predictive Processing in Humans Requires More Than Machine-Estimated Probabilities10 Apr 2026
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attention2 Feb 2026
- 2026Are Language Models Models?15 Jan 2026
- 2025Linguists should learn to love speech-based deep learning models16 Dec 2025
- 2025Large language models are not about natural language15 Dec 2025
- 2025Large language models have learned to use language13 Dec 2025
- 2025Language models as tools for investigating the distinction between possible and impossible natural languages10 Dec 2025
- 2025MapFormer: Self-Supervised Learning of Cognitive Maps with Input-Dependent Positional Embeddings24 Nov 2025
- 2025Learning Model Successors31 Jan 2025
12 newest of 21 All 21 (JSON)