Learning Hierarchical Structures with Differentiable Nondeterministic Stacks
Brian DuSell, David Chiang
Abstract
Learning hierarchical structures in sequential data -- from simple algorithmic patterns to natural language -- in a reliable, generalizable way remains a challenging problem for neural language models. Past work has shown that recurrent neural networks (RNNs) struggle to generalize on held-out algorithmic or syntactic patterns without supervision or some inductive bias. To remedy this, many papers have explored augmenting RNNs with various differentiable stacks, by analogy with finite automata and pushdown automata (PDAs). In this paper, we improve the performance of our recently proposed Nondeterministic Stack RNN (NS-RNN), which uses a differentiable data structure that simulates a nondeterministic PDA, with two important changes. First, the model now assigns unnormalized positive weights instead of probabilities to stack actions, and we provide an analysis of why this improves training. Second, the model can directly observe the state of the underlying PDA. Our model achieves lower cross-entropy than all previous stack RNNs on five context-free language modeling tasks (within 0.05 nats of the information-theoretic lower bound), including a task on which the NS-RNN previously failed to outperform a deterministic stack RNN baseline. Finally, we propose a restricted version of the NS-RNN that incrementally processes infinitely long sequences, and we present language modeling results on the Penn Treebank.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f4c21029-07f3-47a1-adb4-251e64affe1fCited by top-tier papers11
- Neural Networks and the Chomsky HierarchyGrégoire Delétang, Anian Ruoss, Jordi Grau-Moya, Tim Genewein et al.ICLR 2023 · 45 citations
- Stack Attention: Improving the Ability of Transformers to Model Hierarchical PatternsBrian DuSell, David ChiangICLR 2024 · 15 citations
- Beam Tree Recursive CellsJishnu Ray Chowdhury, Cornelia CarageaICML 2023 · 7 citations
- Recursion in Recursion: Two-Level Nested Recursion for Length Generalization with ScalabilityJishnu Ray Chowdhury, Cornelia CarageaNeurIPS 2023 · 7 citations
- Efficient Beam Tree RecursionJishnu Ray Chowdhury, Cornelia CarageaNeurIPS 2023 · 4 citations
Builds on1
Related papers
- The Surprising Computational Power of Nondeterministic Stack RNNsBrian DuSell, David ChiangICLR 2023
- Recursive Transformer: Boosting Reasoning Ability with State StackKechi Zhang, Ge Li, Jia Li, Huangzhao Zhang et al.NeurIPS 2025 · 1 citation
- Push, Pop, Parallelize: Stack-Augmented Linear Attention via the Delta RuleAnh T Nguyen, Saleh Momeni, Ashutosh Chaubey, Changnan Xiao et al.ICML 2026
- The Expressive Capacity of State Space Models: A Formal Language PerspectiveYash Raj Sarrof, Yana Veitsman, Michael HahnNeurIPS 2024 · 53 citations
- Understanding Robust Generalization in Learning Regular LanguagesSoham Dan, Osbert Bastani, Dan RothICML 2022 · 5 citations
