How Can Self-Attention Networks Recognize Dyck-n Languages?
Javid Ebrahimi, Dhruv Gelda, Wei Zhang

TL;DR
This paper investigates how self-attention networks recognize Dyck-n languages, showing that with a starting symbol they can generalize to longer sequences and interpret attention maps, performing comparably to LSTMs.
Contribution
It demonstrates that self-attention networks with a starting symbol can effectively recognize Dyck-n languages and interpret learned attention maps, highlighting their ability to learn hierarchical structures.
Findings
SA$^+$ generalizes to longer sequences
SA$^-$ fails on long sequences for $ ext{D}_2$
Attention maps are interpretable and stack-like
Abstract
We focus on the recognition of Dyck-n () languages with self-attention (SA) networks, which has been deemed to be a difficult task for these networks. We compare the performance of two variants of SA, one with a starting symbol (SA) and one without (SA). Our results show that SA is able to generalize to longer sequences and deeper dependencies. For , we find that SA completely breaks down on long sequences whereas the accuracy of SA is 58.82. We find attention maps learned by to be amenable to interpretation and compatible with a stack-based language recognizer. Surprisingly, the performance of SA networks is at par with LSTMs, which provides evidence on the ability of SA to learn hierarchies without recursion.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFractal and DNA sequence analysis · Animal Vocal Communication and Behavior · Neural Networks and Applications
