HackerPapers

arXiv:2204.06618cs.CC

Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexity

Yiding Hao, Dana Angluin, Robert Frank

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

This paper analyzes three formal models of Transformer encoders that differ in the form of their self-attention mechanism: unique hard attention (UHAT); generalized unique hard attention (GUHAT), which generalizes UHAT; and averaging hard attention (AHAT). We show that UHAT and GUHAT Transformers, viewed as string acceptors, can only recognize formal languages in the complexity class AC$^0$, the class of languages recognizable by families of Boolean circuits of constant depth and polynomial size. This upper bound subsumes Hahn's (2020) results that GUHAT cannot recognize the DYCK languages or the PARITY language, since those languages are outside AC$^0$ (Furst et al., 1984). In contrast, the non-AC$^0$ languages MAJORITY and DYCK-1 are recognizable by AHAT networks, implying that AHAT can recognize languages that UHAT and GUHAT cannot.

arXiv comments
To appear in Transactions of the Association for Computational Linguistics
Journal reference
DOI
Subjects
cs.CCComputational Complexity cs.AIArtificial Intelligence cs.CLComputation and Language cs.FLFormal Languages and Automata Theory cs.LGMachine Learning

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Feb 2024 to Feb 2024.

Comments linking this paper, per year.

Discussed in comments1 thread

    • No, just a programmer that has to apply math. Transformers can only do what is called weak negation. if (not (goal X)), then (assert not x) One example I have seen is: "you can cross if you have no information on a train coming” VS: "you can cross if you have evidence that no…

      nyrikkiView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.