Pushdown Layers: Encoding Recursive Structure in Transformer Language Models
Shikhar Murty, Pratyusha Sharma, Jacob Andreas, Christopher D. Manning
Abstract
Recursion is a prominent feature of human language, and fundamentally challenging for self-attention due to the lack of an explicit recursive-state tracking mechanism. Consequently, Transformer language models poorly capture long-tail recursive structure and exhibit sample-inefficient syntactic generalization. This work introduces Pushdown Layers, a new self-attention layer that models recursive state via a stack tape that tracks estimated depths of every token in an incremental parse of the observed prefix. Transformer LMs with Pushdown Layers are syntactic language models that autoregressively and synchronously update this stack tape as they predict new tokens, in turn using the stack tape to softly modulate attention over tokens—for instance, learning to “skip” over closed constituents. When trained on a corpus of strings annotated with silver constituency parses, Transformers equipped with Pushdown Layers achieve dramatically better and 3-5x more sample-efficient syntactic generalization, while maintaining similar perplexities. Pushdown Layers are a drop-in replacement for standard self-attention. We illustrate this by finetuning GPT2-medium with Pushdown Layers on an automatically parsed WikiText-103, leading to improvements on several GLUE text classification 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.
10 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
- Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scale cites Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patterns
- Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scale cites A Systematic Assessment of Syntactic Generalization in Neural Language Models
- Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patterns cites Learning Hierarchical Structures with Differentiable Nondeterministic Stacks
- Do LLMs learn a true syntactic universal? cites Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patterns
- Mission: Impossible Language Models cites A Systematic Assessment of Syntactic Generalization in Neural Language Models
- Mission: Impossible Language Models cites Neural Networks and the Chomsky Hierarchy
- Neural Networks and the Chomsky Hierarchy cites Learning Hierarchical Structures with Differentiable Nondeterministic Stacks
- Learning Hierarchical Structures with Differentiable Nondeterministic Stacks cites A Systematic Assessment of Syntactic Generalization in Neural Language Models
Cited by top-tier papers10
- Stack Attention: Improving the Ability of Transformers to Model Hierarchical PatternsBrian DuSell, David ChiangICLR 2024 · 15 citations
- Mission: Impossible Language ModelsJulie Kallini, Isabel Papadimitriou, Richard Futrell, Kyle Mahowald et al.ACL 2024 · 15 citations
- Thoughtbubbles: an Unsupervised Method for Parallel Thinking in Latent SpaceHoujun Liu, Shikhar Murty, Christopher Manning, Róbert CsordásICML 2026 · 3 citations
- Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at ScaleXiang Hu, Pengyu Ji, Qingyang Zhu, Wei Wu et al.ACL 2024 · 1 citation
- Do LLMs learn a true syntactic universal?John T. Hale, Milos StanojevicEMNLP 2024 · 1 citation
Builds on10
- A Systematic Assessment of Syntactic Generalization in Neural Language ModelsJennifer Hu, Jon Gauthier, Peng Qian, Ethan Wilcox et al.ACL 2020 · 124 citations
- Neural Networks and the Chomsky HierarchyGrégoire Delétang, Anian Ruoss, Jordi Grau-Moya, Tim Genewein et al.ICLR 2023 · 45 citations
- Learning Hierarchical Structures with Differentiable Nondeterministic StacksBrian DuSell, David ChiangICLR 2022 · 19 citations
- Characterizing intrinsic compositionality in transformers with Tree ProjectionsShikhar Murty, Pratyusha Sharma, Jacob Andreas, Christopher D. ManningICLR 2023 · 13 citations
- Guiding Attention for Self-Supervised Learning with TransformersAmeet Deshpande, Karthik NarasimhanEMNLP Findings 2020 · 13 citations
Related papers
- Recursive Transformer: Boosting Reasoning Ability with State StackKechi Zhang, Ge Li, Jia Li, Huangzhao Zhang et al.NeurIPS 2025 · 1 citation
- Can the Transformer Learn Nested Recursion with Symbol Masking?Jean-Philippe Bernardy, Adam Ek, Vladislav MaraevACL Findings 2021 · 2 citations
- GiLT: Augmenting Transformer Language Models with Dependency GraphsTianyu Huang, Yida Zhao, Chuyan Zhou, Kewei TuACL 2026
- On Efficiently Representing Regular Languages as RNNsAnej Svete, Robin Chan, Ryan CotterellACL Findings 2024 · 1 citation
- Staircase Attention for Recurrent Processing of SequencesDa Ju, Stephen Roller, Sainbayar Sukhbaatar, Jason WestonNeurIPS 2022 · 20 citations
