atlas

Research map / Architectures and efficiency / Attention and transformers

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

ICLR 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes stack attention, replacing SDPA sublayers with differentiable stacks (superposition and nondeterministic vector PDA) so transformers can model hierarchical/CFL patterns without syntactic supervision.

Problem

Standard scaled dot-product attention lacks a mechanism for hierarchical patterns of arbitrary nesting depth, limiting transformers on context-free syntactic structures and making them data-inefficient for language.

Approach

Replace the SDPA sublayer with a differentiable stack: soft-selection over sequences of push/pop/no-op actions (superposition stack) or over VPDA runs (nondeterministic dVPDA), returning the top stack vector, enabling a causal latent syntax model trained end-to-end.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
replace one attention sublayer with superposition stack attentionTf · Penn Treebankperplexity: 115.11 -> 122.94Hurt
replace one attention sublayer with nondeterministic stack attentionTf · Penn Treebankperplexity: 115.11 -> 110.59Helped
replace one attention sublayer with superposition stack attentionTf · Penn Treebank testperplexity: 92.84 -> 98.67Hurt
replace one attention sublayer with nondeterministic stack attentionTf · Penn Treebank testperplexity: 92.84 -> 88.54Helped
use nondeterministic stack attention instead of standard attentionTf · UnmarkedReversal, PaddedReversal, and Hardest CFLcross-entropy differenceHelped
use nondeterministic stack attention instead of standard attentionTf · Hardest CFL, in-distribution lengthscross-entropy differenceHelped
use nondeterministic stack attention instead of standard attentionTf · MarkedReversal and Dyck, out-of-distribution lengthscross-entropy differenceHurt
use superposition stack attention instead of standard attentionTf · Penn Treebankperplexity: 115.11 -> 122.94Hurt
use superposition stack attention instead of standard attentionTf · Europarl de-en newstest2016, d_model 240perplexity: 12.54 -> 11.53Helped
use superposition stack attention instead of standard attentionTf · Europarl de-en newstest2017, d_model 240BLEU: 12.11 -> 12.81Helped
use superposition stack attention instead of standard attentionTf · Europarl de-en newstest2017, d_model 360BLEU: 12.69 -> 12.03Hurt
use nondeterministic stack attention instead of standard attentionTf · Europarl de-en newstest2017, d_model 240BLEU: 12.11 -> 11.50Hurt

Surprising findings

Limitations

Experimental setup

Datasets: Marked Reversal Unmarked Reversal Padded Reversal Dyck Hardest CFL Penn Treebank Europarl v7 de-en newstest2016 newstest2017

Benchmarks: Marked Reversal Unmarked Reversal Padded Reversal Dyck Hardest CFL Penn Treebank newstest2017

Metrics: cross-entropy difference (nats) perplexity BLEU

Baselines: Transformer with SDPA Tf+Sup (superposition stack attention) LSTM LSTM+Sup VRNS-RNN (LSTM+Nd) Transformer-XL

Builds on: superposition stack dVPDA (Dusell and Chiang 2023) stack-augmented LSTM scaled dot-product attention

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy