Lune

ICLR2024顶会

Stack Attention: Improving the Ability of Transformers to Model Hierarchical Patterns

Brian DuSell, David Chiang

摘要

Attention, specifically scaled dot-product attention, has proven effective for natural language, but it does not have a mechanism for handling hierarchical patterns of arbitrary nesting depth, which limits its ability to recognize certain syntactic structures. To address this shortcoming, we propose stack attention: an attention operator that incorporates stacks, inspired by their theoretical connections to context-free languages (CFLs). We show that stack attention is analogous to standard attention, but with a latent model of syntax that requires no syntactic supervision. We propose two variants: one related to deterministic pushdown automata (PDAs) and one based on nondeterministic PDAs, which allows transformers to recognize arbitrary CFLs. We show that transformers with stack attention are very effective at learning CFLs that standard transformers struggle on, achieving strong results on a CFL with theoretically maximal parsing difficulty. We also show that stack attention is more effective at natural language modeling under a constrained parameter budget, and we include results on machine translation.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 10 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scale 引用了 Pushdown Layers: Encoding Recursive Structure in Transformer Language Models
  • Pushdown Layers: Encoding Recursive Structure in Transformer Language Models 引用了 Learning Hierarchical Structures with Differentiable Nondeterministic Stacks
  • Do LLMs learn a true syntactic universal? 引用了 Pushdown Layers: Encoding Recursive Structure in Transformer Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper10

  1. Compositional Generalization Across Distributional Shifts with Sparse Tree OperationsPaul Soulos, Henry Conklin, Mattia Opper, Paul Smolensky 等NeurIPS 2024 · 8 次引用
  2. The Power of Hard Attention Transformers on Data Sequences: A formal language theoretic perspectivePascal Bergsträßer, Chris Köcher, Anthony Widjaja Lin, Georg ZetzscheNeurIPS 2024 · 7 次引用
  3. Recursive Transformer: Boosting Reasoning Ability with State StackKechi Zhang, Ge Li, Jia Li, Huangzhao Zhang 等NeurIPS 2025 · 1 次引用
  4. Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at ScaleXiang Hu, Pengyu Ji, Qingyang Zhu, Wei Wu 等ACL 2024 · 1 次引用
  5. Do LLMs learn a true syntactic universal?John T. Hale, Milos StanojevicEMNLP 2024 · 1 次引用

它引用的 Paper8

  1. SG-Net: Syntax-Guided Machine Reading ComprehensionZhuosheng Zhang, Yuwei Wu, Junru Zhou, Sufeng Duan 等AAAI 2020 · 192 次引用
  2. Learning Hierarchical Structures with Differentiable Nondeterministic StacksBrian DuSell, David ChiangICLR 2022 · 19 次引用
  3. Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence ModelsAaron Mueller, Robert Frank, Tal Linzen, Luheng Wang 等ACL Findings 2022 · 17 次引用
  4. Pushdown Layers: Encoding Recursive Structure in Transformer Language ModelsShikhar Murty, Pratyusha Sharma, Jacob Andreas, Christopher D. ManningEMNLP 2023
  5. When Do You Need Billions of Words of Pretraining Data?Yian Zhang, Alex Warstadt, Xiaocheng Li, Samuel R. BowmanACL 2021

相关 Paper

  1. Learning Bounded Context-Free-Grammar via LSTM and the Transformer: Difference and the ExplanationsHui Shi, Sicun Gao, Yuandong Tian, Xinyun Chen 等AAAI 2022 · 24 次引用
  2. Context-free Recognition with TransformersSelim Jerad, Anej Svete, Sophie Hao, Ryan Cotterell 等ICML 2026 · 3 次引用
  3. The Surprising Computational Power of Nondeterministic Stack RNNsBrian DuSell, David ChiangICLR 2023
  4. How Transformers Represent Hierarchies: A Local-to-Global MechanismZhiling Zhou, Tianhao Wang, Zhuoran YangICML 2026
  5. How Can Self-Attention Networks Recognize Dyck-n Languages?Javid Ebrahimi, Dhruv Gelda, Wei ZhangEMNLP Findings 2020 · 13 次引用
黄昏的海面,两侧是细线勾勒的悬崖