Pith. sign in

REVIEW 2 cited by

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

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2310.01749 v2 pith:TT3YLMQU submitted 2023-10-03 cs.CL

classification cs.CL
keywords attentionstacktransformerscflseffectiveabilityarbitraryhierarchical
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

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.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. A Systematic Study of Compositional Syntactic Transformer Language Models

    cs.CL 2025-06 conditional novelty 6.0 of 10

    A systematic comparison of 16 compositional syntactic language model variants shows that binary trees with external composition and no sub-constituent masking give the best balance of speed and syntactic generalization.

  2. Emergent Stack Representations in Modeling Counter Languages Using Transformers

    cs.CL 2025-02 conditional novelty 4.0 of 10

    A small transformer trained on counter languages encodes the current stack depth in its final-layer activations, recoverable by simple probing classifiers.

Pith tools