paper-with-me

홈 › Papers

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

2023-10-03 · 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.

📄 PDF Abstract BibTeX arXiv:2310.01749

Code (1)

bdusell/stack-attention 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingMachine Translation

Similar Papers 제목 키워드 기반

Dissociating Decodability and Causal Use in Bracket-Sequence Transformers

2026-04-24 · Aryan Sharma, Cutter Dawes, Shivam Raval arxiv

When trained on tasks requiring an understanding of hierarchical structure, transformers have been found to represent this hierarchy in distinct ways: in the geometry of the residual stream, and in stack-like attention p…

MHITNet: a minimize network with a hierarchical context-attentional filter for segmenting medical ct images

2022-11-01 · Hongyang He, Feng Ziliang, Yuanhang Zheng, Shudong Huang 외

In the field of medical CT image processing, convolutional neural networks (CNNs) have been the dominant technique.Encoder-decoder CNNs utilise locality for efficiency, but they cannot simulate distant pixel interactions…

Decoder

Less is More: Pay Less Attention in Vision Transformers

2021-05-29 · Zizheng Pan, Bohan Zhuang, Haoyu He, Jing Liu 외

Transformers have become one of the dominant architectures in deep learning, particularly as a powerful alternative to convolutional neural networks (CNNs) in computer vision. However, Transformer training and inference …

image-classificationImage ClassificationInstance Segmentationobject-detection+2

Towards 3D Acceleration for low-power Mixture-of-Experts and Multi-Head Attention Spiking Transformers

2024-12-07 · Boxun Xu, Junyoung Hwang, Pruek Vanna-iampikul, Yuxuan Yin 외

Spiking Neural Networks(SNNs) provide a brain-inspired and event-driven mechanism that is believed to be critical to unlock energy-efficient deep learning. The mixture-of-experts approach mirrors the parallel distributed…

Mixture-of-Experts

Hierarchical Classification of Financial Transactions Through Context-Fusion of Transformer-based Embeddings and Taxonomy-aware Attention Layer

2023-12-12 · Antonio J. G. Busson, Rafael Rocha, Rennan Gaio, Rafael Miceli 외

This work proposes the Two-headed DragoNet, a Transformer-based model for hierarchical multi-label classification of financial transactions. Our model is based on a stack of Transformers encoder layers that generate cont…

Hierarchical Multi-label ClassificationMulti-Label ClassificationMUlTI-LABEL-ClASSIFICATION