Reproduce “Theoretical Limitations of Self-Attention in Neural Sequence Models” on OpenResearch
Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Michael Hahn
Research shows that self-attention, the core component of Transformer models, has inherent theoretical limitations in recognizing formal languages. Hard attention models cannot recognize simple periodic finite-state languages (PARITY) or basic context-free languages (2DYCK), while soft attention models exhibit diminishing influence of individual inputs as sequence length increases, leading to suboptimal performance on these tasks for long sequences.
Key insights
- Self-attention cannot robustly model non-counter-free regular languages (e.g., PARITY), implying it cannot generally emulate arbitrary finite-state automata.
- Self-attention cannot robustly model basic hierarchical structures (e.g., 2DYCK), implying it cannot generally emulate stack-like memory.
- These theoretical limitations are asymptotic; achieving perfect accuracy for arbitrarily long sequences would require the number of layers or heads to scale with input length.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.