Skip to content

The Head Complexity of Boolean Functions in Single-Layer Attention

Sep 2026 · 1 citation
Computer Science

TL;DR

A compactness theorem shows that any function computable at all can be computed with embedding dimension and precision bounded by the discrete data of the task, namely, head count, alphabet size, and length.

Abstract

What can a single layer of self-attention compute? We study head complexity: the minimum number of attention heads required to compute a function in a one-layer attention-only model. We establish an exact hierarchy under this measure: $k$ heads compute $k$-bit parity but cannot compute $(k+1)$-bit parity. The lower bound is unconditional in the two resources a transformer might otherwise exploit; it holds at unbounded embedding dimension and unbounded numerical precision. The proof rests on an alternating-sum obstruction: after clearing the softmax denominators, every monomial in the resulting decision polynomial omits at least one of the $k+1$ input bits, forcing its correlation with parity to vanish. The same obstruction yields lower bounds for related tasks, including the well-studied multi-hop induction-head task. We also establish compactness bounds for embedding dimension and numerical precision. Specifically, a compactness theorem shows that any function computable at all can be computed with embedding dimension and precision bounded by the discrete data of the task, namely, head count, alphabet size, and length. Thus, potentially unbounded dimension or precision provably cannot substitute for heads. Finally, we derive nearly matching universal bounds for general binary functions: $2^n$ heads suffice to compute every $n$-bit binary function, with one head per monomial in its multilinear expansion, while a counting argument shows almost all such functions require $\Omega(2^n/n^2)$ heads. This lower bound matches the upper bound to within a $\operatorname{poly}(n)$ factor, even when dimension and precision are unbounded. Together, these results characterize head requirements for Boolean computation in this model.

View source

Similar papers

Preprint Aug 2026

The Limits of Binding in Dual Encoders

Binding failure in deployed dual encoders is thus not a dimension or smoothness limit today, but an incentive and code-structure limit, with a proved depth ceiling that remains once those are fixed.

Kin Ian Lo · 0 citations
Preprint Sep 2026

Exact Local Optimality Does Not Compose: The Complexity of Chronological Realization

We study a controlled, normalized multi-menu positive-realization problem. A normalized realization reproduces declared root--word responses using common row-stochastic transition matrices and a single terminal effect. We compare three realization complexities: independent local realizations, a static shared carrier wi...

Yi-Xin Zhao · 0 citations
Preprint Oct 2026

On the Computational Complexity of Problems: Formalizing Sensitivity to Uncertainty and Parametric Complexity Classes

Worst-case analysis, the setting of the $P \stackrel{?}{=} NP$ question, measures the cost of a problem as a function of input size alone. Yet problems that are exponential in general often become polynomial, even linear, once a checkable property of the input is known: Partition, for instance, is decidable in linear t...

Yannis Tzitzikas · 0 citations
Preprint Sep 2026

Parity Tests under Ties: A One-Test Lifting Theorem

In the unrestricted polynomial decision-tree model, only the number of polynomial sign tests is charged. A parity test asks for the sign of a product of pairwise differences. Such tests underlie low-depth randomized algorithms for maximum finding and top-$k$ selection, but their usual analysis assumes distinct inputs b...

Ron Kupfer · 0 citations
Preprint Sep 2026

Shift-Accumulate Attention: Multiplier-Free Query--Key Products for Transformer Decoding

Power-of-two (PoT) quantisation turns a multiplication into a bit shift, so far only for the post-softmax attention--value product. The earlier and larger product, S=QK^T, has not been reformulated the same way. We quantise the key cache to a signed power-of-two fixed-point code, so that every scalar multiplication in...

Khubaib Ahmed, Amna Noor, A. Haq · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.