Neural Networks and the Chomsky Hierarchy
Grégoire Delétang, Anian Ruoss, Jordi Grau-Moya, Tim Genewein, Li Kevin Wenliang, Elliot Catt, Chris Cundy, Marcus Hutter, Shane Legg, Joel Veness, Pedro A. Ortega
Abstract
Reliable generalization lies at the heart of safe ML and AI. However, understanding when and how neural networks generalize remains one of the most important unsolved problems in the field. In this work, we conduct an extensive empirical study (20'910 models, 15 tasks) to investigate whether insights from the theory of computation can predict the limits of neural network generalization in practice. We demonstrate that grouping tasks according to the Chomsky hierarchy allows us to forecast whether certain architectures will be able to generalize to out-of-distribution inputs. This includes negative results where even extensive amounts of data and training time never lead to any non-trivial generalization, despite models having sufficient capacity to fit the training data perfectly. Our results show that, for our subset of tasks, RNNs and Transformers fail to generalize on non-regular tasks, LSTMs can solve regular and counter-language tasks, and only networks augmented with structured memory (such as a stack or memory tape) can successfully generalize on context-free and context-sensitive tasks.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
97 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- What Algorithms can Transformers Learn? A Study in Length Generalization cites How Can Self-Attention Networks Recognize Dyck-n Languages?
- What Algorithms can Transformers Learn? A Study in Length Generalization cites Thinking Like Transformers
- What Algorithms can Transformers Learn? A Study in Length Generalization cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- What Algorithms can Transformers Learn? A Study in Length Generalization cites The Impact of Positional Encoding on Length Generalization in Transformers
- What Algorithms can Transformers Learn? A Study in Length Generalization cites Exploring Length Generalization in Large Language Models
- Thinking Like Transformers cites How Can Self-Attention Networks Recognize Dyck-n Languages?
- The Impact of Positional Encoding on Length Generalization in Transformers cites Thinking Like Transformers
- The Impact of Positional Encoding on Length Generalization in Transformers cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- The Impact of Positional Encoding on Length Generalization in Transformers cites Exploring Length Generalization in Large Language Models
- Repeat After Me: Transformers are Better than State Space Models at Copying cites What Algorithms can Transformers Learn? A Study in Length Generalization
- Repeat After Me: Transformers are Better than State Space Models at Copying cites Thinking Like Transformers
- Repeat After Me: Transformers are Better than State Space Models at Copying cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- Repeat After Me: Transformers are Better than State Space Models at Copying cites The Impact of Positional Encoding on Length Generalization in Transformers
- Repeat After Me: Transformers are Better than State Space Models at Copying cites Exploring Length Generalization in Large Language Models
- Exploring Length Generalization in Large Language Models cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
Cited by top-tier papers97
- xLSTM: Extended Long Short-Term MemoryMaximilian Beck, Korbinian Pöppel, Markus Spanring, Andreas Auer et al.NeurIPS 2024 · 703 citations
- The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das et al.NeurIPS 2023 · 444 citations
- Language Modeling Is CompressionGrégoire Delétang, Anian Ruoss, Paul-Ambroise Duquenne, Elliot Catt et al.ICLR 2024 · 243 citations
- What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin et al.ICLR 2024 · 189 citations
- Repeat After Me: Transformers are Better than State Space Models at CopyingSamy Jelassi, David Brandfonbrener, Sham M. Kakade, Eran MalachICML 2024 · 176 citations
Builds on8
- Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 citations
- Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz et al.NeurIPS 2022 · 267 citations
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 citations
- Learning Hierarchical Structures with Differentiable Nondeterministic StacksBrian DuSell, David ChiangICLR 2022 · 19 citations
- How Can Self-Attention Networks Recognize Dyck-n Languages?Javid Ebrahimi, Dhruv Gelda, Wei ZhangEMNLP Findings 2020 · 13 citations
Related papers
- On the Ability and Limitations of Transformers to Recognize Formal LanguagesSatwik Bhattamishra, Kabir Ahuja, Navin GoyalEMNLP 2020 · 7 citations
- Rule Extrapolation in Language Modeling: A Study of Compositional Generalization on OOD PromptsAnna Mészáros, Szilvia Ujváry, Wieland Brendel, Patrik Reizinger et al.NeurIPS 2024 · 9 citations
- Understanding Robust Generalization in Learning Regular LanguagesSoham Dan, Osbert Bastani, Dan RothICML 2022 · 5 citations
- Learning Universal PredictorsJordi Grau-Moya, Tim Genewein, Marcus Hutter, Laurent Orseau et al.ICML 2024 · 29 citations
- On Efficiently Representing Regular Languages as RNNsAnej Svete, Robin Chan, Ryan CotterellACL Findings 2024 · 1 citation
