Parity, Sensitivity, and Transformers
Not on the map. Why?
Abstract (arXiv)
Understanding what neural architectures can and cannot compute is a central challenge in the theory of AI. One of the fundamental problems in this context is the PARITY task, which asks whether the number of 1s in a binary input sequence is even or odd. PARITY is one of the central tasks studied in the theory of computation, yet it remains surprisingly unclear under which conditions transformers can or cannot solve it. In this paper, we show that the minimal number of layers a transformer needs to compute PARITY is two. In particular, we solve the open problem asking whether a one-layer transformer can compute PARITY. We answer it negatively by showing that average sensitivity of a one-layer transformer grows slower than that of PARITY. Furthermore, we show a new construction for transformer that computes PARITY, which improves on the existing constructions by removing a number of impractical assumptions. In particular, the existing transformers for PARITY rely on such impractical assumptions as length-dependent positional encoding, hardmax, layernorm without a regularisation parameter, or incompatibility with causal masking. We show that these assumptions can be removed, at the cost of increasing the number of layers from two to four. Specifically, we show that PARITY can be computed by a four-layer transformer using softmax attention, length-independent and polynomially bounded positional encoding, no layernorm, and compatible with both causal and non-causal masking.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 20 of its 30 references that are in the map. First posted on arXiv 5 Feb 2026.
Builds on
20 of 30 references.
References · 20
- 2017Attention Is All You Needcited by 59,932
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
- 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 256
- 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 191
- 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
- 2023Representational Strengths and Limitations of Transformerscited by 132
- 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 110
- 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
- 2024Why are Sensitive Functions Hard for Transformers?cited by 74
- 2023Tighter Bounds on the Expressivity of Transformer Encoderscited by 65
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
8 more
- 2024Theoretical limitations of multi-layer Transformercited by 43
- 2023Logical Languages Accepted by Transformer Encoders with Hard Attentioncited by 37
- 2024How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpadcited by 35
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformerscited by 28
- 2024Simulating Hard Attention Using Soft Attentioncited by 15
- 2025Ehrenfeucht-Haussler Rank and Chain of Thoughtcited by 6
- 2025The Transformer Cookbookcited by 5
- 2025A completely uniform transformer for paritycited by 3
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026Lower bounds for one-layer transformers that compute paritycited by 0
- 2026Provably Shorter Scratchpads in Hybrid DeltaNet-Attention Decoderscited by 0
- 2026Rethinking the Role of Positional Encoding: Sliding-Window Transformers without PE Remain Turing Completecited by 0
- 2026Transformer Heads Looking for Ordercited by 0
- 2026Transformer Heads Looking for Order22 Sep 2026
- 2026Rethinking the Role of Positional Encoding: Sliding-Window Transformers without PE Remain Turing Complete1 Jun 2026
- 2026Provably Shorter Scratchpads in Hybrid DeltaNet-Attention Decoders15 May 2026
- 2026Lower bounds for one-layer transformers that compute parity12 May 2026