How Can Self-Attention Networks Recognize Dyck-n Languages?
Not on the map. Why?
Abstract (arXiv)
We focus on the recognition of Dyck-n (Dn) languages with self-attention (SA) networks, which has been deemed to be a difficult task for these networks. We compare the performance of two variants of SA, one with a starting symbol (SA^+) and one without (SA^-). Our results show that SA^+ is able to generalize to longer sequences and deeper dependencies. For D2, we find that SA^- completely breaks down on long sequences whereas the accuracy of SA^+ is 58.82%. We find attention maps learned by SA^+ to be amenable to interpretation and compatible with a stack-based language recognizer. Surprisingly, the performance of SA networks is at par with LSTMs, which provides evidence on the ability of SA to learn hierarchies without recursion.
Key facts. Cited by 51 papers in the map (data through 7 Oct 2026). First posted on arXiv 9 Oct 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 2; 2022: 4; 2023: 18; 2024: 15; 2025: 9; 2026: 3.
51 papers.
Sort:
By area:
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2021Thinking Like Transformerscited by 182
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 68
- 2024SynCode: LLM Generation with Grammar Augmentationcited by 66
- 2024On Limitations of the Transformer Architecturecited by 63
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
38 more
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
- 2024Theoretical limitations of multi-layer Transformercited by 43
- 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regressioncited by 41
- 2024Differentiation and Specialization of Attention Heads via the Refined Local Learning Coefficientcited by 39
- 2025Type-Constrained Code Generation with Language Modelscited by 32
- 2024Mission: Impossible Language Modelscited by 31
- 2023Failures Pave the Way: Enhancing Large Language Models through Tuning-free Rule Accumulationcited by 30
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
- 2023A Mathematical Abstraction for Balancing the Trade-off Between Creativity and Reality in Large Language Modelscited by 29
- 2024Separations in the Representational Capabilities of Transformers and Recurrent Architecturescited by 29
- 2024Language Models Need Inductive Biases to Count Inductivelycited by 25
- 2023Interpretability Illusions in the Generalization of Simplified Modelscited by 24
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
- 2025Can Language Models Learn Typologically Implausible Languages?cited 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
- 2023Why Softmax Attention Outperforms Linear Attentioncited by 15
- 2024Transformer-Based Models Are Not Yet Perfect At Learning to Emulate Structural Recursioncited by 14
- 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammarscited by 13
- 2025On the Query Complexity of Verifier-Assisted Language Generationcited by 10
- 2023Feature Interactions Reveal Linguistic Structure in Language Modelscited by 8
- 2025Can Interpretation Predict Behavior on Unseen Data?cited by 8
- 2023MLRegTest: A Benchmark for the Machine Learning of Regular Languagescited by 7
- 2024ALTA: Compiler-Based Analysis of Transformerscited by 7
- 2024Simulating Weighted Automata over Sequences and Trees with Transformerscited by 4
- 2024Validating Mechanistic Interpretations: An Axiomatic Approachcited by 4
- 2023State space models can express n-gram languagescited by 3
- 2024Stability Analysis of Various Symbolic Rule Extraction Methods from Recurrent Neural Networkcited by 3
- 2026Context-Free Recognition with Transformerscited by 3
- 2022Hybrid Decentralized Optimization: Leveraging Both First- and Zeroth-Order Optimizers for Faster Convergencecited by 2
- 2023Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languagescited by 2
- 2024A Transformer with Stack Attentioncited by 2
- 2025Circuits, Features, and Heuristics in Molecular Transformerscited by 2
- 2023Applying language models to algebraic topology: generating simplicial cycles using multi-labeling in Wu's formulacited by 1
- 2025Learning Model Successorscited by 0
- 2025Tracr-Injection: Distilling Algorithms into Pre-trained Language Modelscited by 0
- 2025Hardness of Learning Regular Languages in the Next Symbol Prediction Settingcited by 0
- 2026Language Re-generation: An investigation into information locality effects on reconstructioncited by 0
50 most cited of 51 All 51 (JSON)
- 2026Language Re-generation: An investigation into information locality effects on reconstruction11 Jul 2026
- 2026Tractable Hierarchical Control of Autoregressive Language Models1 Jun 2026
- 2026Context-Free Recognition with Transformers5 Jan 2026
- 2025Circuits, Features, and Heuristics in Molecular Transformers10 Dec 2025
- 2025Hardness of Learning Regular Languages in the Next Symbol Prediction Setting21 Oct 2025
- 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammars13 Aug 2025
- 2025Can Interpretation Predict Behavior on Unseen Data?8 Jul 2025
- 2025Tracr-Injection: Distilling Algorithms into Pre-trained Language Models15 May 2025
- 2025Type-Constrained Code Generation with Language Models12 Apr 2025
- 2025Can Language Models Learn Typologically Implausible Languages?17 Feb 2025
- 2025On the Query Complexity of Verifier-Assisted Language Generation17 Feb 2025
- 2025Learning Model Successors31 Jan 2025
38 more
- 2024Theoretical limitations of multi-layer Transformer4 Dec 2024
- 2024Training Neural Networks as Recognizers of Formal Languages11 Nov 2024
- 2024ALTA: Compiler-Based Analysis of Transformers23 Oct 2024
- 2024Differentiation and Specialization of Attention Heads via the Refined Local Learning Coefficient3 Oct 2024
- 2024Validating Mechanistic Interpretations: An Axiomatic Approach18 Jul 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
- 2024Language Models Need Inductive Biases to Count Inductively30 May 2024
- 2024A Transformer with Stack Attention7 May 2024
- 2024Simulating Weighted Automata over Sequences and Trees with Transformers12 Mar 2024
- 2024SynCode: LLM Generation with Grammar Augmentation3 Mar 2024
- 2024On Limitations of the Transformer Architecture13 Feb 2024
- 2024Stability Analysis of Various Symbolic Rule Extraction Methods from Recurrent Neural Network4 Feb 2024
- 2024Transformer-Based Models Are Not Yet Perfect At Learning to Emulate Structural Recursion23 Jan 2024
- 2024Mission: Impossible Language Models12 Jan 2024
- 2023Interpretability Illusions in the Generalization of Simplified Models6 Dec 2023
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammars3 Dec 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
- 2023What Algorithms can Transformers Learn? A Study in Length Generalization24 Oct 2023
- 2023Failures Pave the Way: Enhancing Large Language Models through Tuning-free Rule Accumulation24 Oct 2023
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languages21 Oct 2023
- 2023Why Softmax Attention Outperforms Linear Attention18 Oct 2023
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functions4 Oct 2023
- 2023Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languages2 Sep 2023
- 2023Feature Interactions Reveal Linguistic Structure in Language Models21 Jun 2023
- 2023State space models can express n-gram languages20 Jun 2023
- 2023A Mathematical Abstraction for Balancing the Trade-off Between Creativity and Reality in Large Language Models4 Jun 2023
- 2023Applying language models to algebraic topology: generating simplicial cycles using multi-labeling in Wu's formula1 Jun 2023
- 2023Randomized Positional Encodings Boost Length Generalization of Transformers26 May 2023
- 2023The Closeness of In-Context Learning and Weight Shifting for Softmax Regression26 Apr 2023
- 2023MLRegTest: A Benchmark for the Machine Learning of Regular Languages16 Apr 2023
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understanding7 Mar 2023
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functions22 Nov 2022
- 2022Transformers Learn Shortcuts to Automata19 Oct 2022
- 2022Hybrid Decentralized Optimization: Leveraging Both First- and Zeroth-Order Optimizers for Faster Convergence14 Oct 2022
- 2022Neural Networks and the Chomsky Hierarchy5 Jul 2022
- 2021Thinking Like Transformers13 Jun 2021
50 newest of 51 All 51 (JSON)
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2021Thinking Like Transformerscited by 182
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2022Simplicity Bias in Transformers and their Ability to Learn Sparse Boolean Functionscited by 68
- 2024SynCode: LLM Generation with Grammar Augmentationcited by 66
- 2024On Limitations of the Transformer Architecturecited by 63
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
12 most cited of 49 All 49 (JSON)
- 2026Language Re-generation: An investigation into information locality effects on reconstruction11 Jul 2026
- 2026Tractable Hierarchical Control of Autoregressive Language Models1 Jun 2026
- 2026Context-Free Recognition with Transformers5 Jan 2026
- 2025Circuits, Features, and Heuristics in Molecular Transformers10 Dec 2025
- 2025Hardness of Learning Regular Languages in the Next Symbol Prediction Setting21 Oct 2025
- 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammars13 Aug 2025
- 2025Can Interpretation Predict Behavior on Unseen Data?8 Jul 2025
- 2025Tracr-Injection: Distilling Algorithms into Pre-trained Language Models15 May 2025
- 2025Type-Constrained Code Generation with Language Models12 Apr 2025
- 2025Can Language Models Learn Typologically Implausible Languages?17 Feb 2025
- 2025Learning Model Successors31 Jan 2025
- 2024Theoretical limitations of multi-layer Transformer4 Dec 2024
12 newest of 49 All 49 (JSON)