An expressivity analysis of hierarchical modelling in deep transformers via bounded-depth grammars
Not on the map. Why?
Abstract (arXiv)
Deep neural networks are widely believed to derive their expressive power from their ability to form hierarchical representations, capturing progressively more abstract and compositional features across layers. In language modeling, transformers have emerged as the dominant architecture, with early layers capturing local syntactic patterns and later layers encoding more complex clause-level dependencies. While this intuition has shaped model design, there remains a lack of rigorous theoretical work demonstrating how deep transformers represent such hierarchical structures. In this work, we analyze the expressiveness of deep transformer models through the formal lens of bounded-depth, non-recursive context-free grammars. For this class of grammars, we explicitly construct transformers with positional attention whose depth grows linearly with grammar depth, while the neuron count scales with the number of derivation-tree shapes and quadratically with the number of production rules. Our theoretical results support the linear representation hypothesis by demonstrating that these architectures possess the structural capacity to encode abstract grammatical states into low-dimensional, linearly separable subspaces within the residual stream.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 47 of its 60 references that are in the map. First posted on arXiv 16 Jun 2026.
Builds on
47 of 60 references.
References · 47
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2016Understanding deep learning requires rethinking generalizationcited by 1,674
- 2022No Language Left Behind: Scaling Human-Centered Machine Translationcited by 1,312
- 2018Self-Attention with Relative Position Representationscited by 1,120
35 more
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
- 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 716
- 2020Beyond English-Centric Multilingual Machine Translationcited by 561
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2023Attribution Patching Outperforms Automated Circuit Discoverycited by 209
- 2020Synthesizer: Rethinking Self-Attention in Transformer Modelscited by 205
- 2016Why and When Can Deep -- but Not Shallow -- Networks Avoid the Curse of Dimensionality: a Reviewcited by 155
- 2023What Formal Languages Can Transformers Express? A Surveycited by 124
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 93
- 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
- 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 83
- 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
- 2018Small ReLU networks are powerful memorizers: a tight analysis of memorization capacitycited by 78
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2019Improving Transformer Models by Reordering their Sublayerscited by 52
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 49
- 2023Do Transformers Parse while Predicting the Masked Word?cited by 48
- 2024The Expressive Capacity of State Space Models: A Formal Language Perspectivecited by 46
- 2023Logical Languages Accepted by Transformer Encoders with Hard Attentioncited by 38
- 2020ETC: Encoding Long and Structured Inputs in Transformerscited by 34
- 2024Transformers Can Represent n-gram Language Modelscited by 32
- 2016Deep Learning and Hierarchal Generative Modelscited by 25
- 2018A Provably Correct Algorithm for Deep Learning that Actually Workscited by 20
- 2024How transformers learn structured data: insights from hierarchical filteringcited by 18
- 2020A Survey of Neural Networks and Formal Languagescited by 17
- 2025Large Language Models Encode Semantics and Alignment in Linearly Separable Representationscited by 17
- 2020On the Ability and Limitations of Transformers to Recognize Formal Languagescited by 13
- 2026How Many Features Can a Language Model Store Under the Linear Representation Hypothesis?cited by 12
- 2021Structured Context and High-Coverage Grammar for Conversational Question Answering over Knowledge Graphscited by 10
- 2024How Deep Networks Learn Sparse and Hierarchical Data: the Sparse Random Hierarchy Modelcited by 7
- 2023State space models can express n-gram languagescited by 3
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Protoreasoning in Tiny Transformerscited by 0
- 2026Protoreasoning in Tiny Transformers5 Aug 2026