论文精选

单层注意力中布尔函数的头部复杂度

The Head Complexity of Boolean Functions in Single-Layer Attention

精选理由

这篇论文揭示了单层注意力模型中布尔函数计算的头部需求边界,为理解Transformer架构的计算能力提供了理论基础。

AI 摘要

该研究确定了单层自注意力模型中计算函数所需的最少注意力头数量。研究表明,k个头可以计算k位奇偶校验函数,但无法计算(k+1)位奇偶校验函数。该下界在无限嵌入维度和无限数值精度下仍然成立,且适用于包括多跳归纳头任务在内的相关任务。

原文 · arXiv cs.LG

The Head Complexity of Boolean Functions in Single-Layer Attention

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 $Ω(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.