# Formally Verified Autoresearch for Analyzing the Expressivity of Multi-Head Attention

DevFeed: [Formally Verified Autoresearch for Analyzing the Expressivity of Multi-Head Attention](<https://devfeed.tech/articles/formally-verified-autoresearch-for-analyzing-the-expressivity-of-multi-head-attention-93466.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.25341>)

Author: Karthik Viswanathan, Plamen Dimitrov, Stefano Rocca, Sarayu Sirikonda

Published: 2026-10-21T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [Lean](<https://devfeed.tech/topics/lean.md>), [Formal verification](<https://devfeed.tech/topics/formal-verification.md>), [Automated reasoning](<https://devfeed.tech/topics/automated-reasoning.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>)

Tags: [attention](<https://devfeed.tech/tags/attention.md>), [boolean](<https://devfeed.tech/tags/boolean.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [computational-complexity](<https://devfeed.tech/tags/computational-complexity.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cc](<https://devfeed.tech/tags/cs-cc.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [formal-verification](<https://devfeed.tech/tags/formal-verification.md>), [frontier-model](<https://devfeed.tech/tags/frontier-model.md>), [function](<https://devfeed.tech/tags/function.md>), [lean](<https://devfeed.tech/tags/lean.md>), [lower-bound](<https://devfeed.tech/tags/lower-bound.md>), [mechanistic-interpretability](<https://devfeed.tech/tags/mechanistic-interpretability.md>), [transformer](<https://devfeed.tech/tags/transformer.md>), [transformer-architecture](<https://devfeed.tech/tags/transformer-architecture.md>)

## AI overview

The paper characterizes how many attention heads a Boolean function requires in a one-layer, attention-only transformer with additive positional embeddings. It gives an exact linear-fractional normal form and a general lower bound based on threshold degree, with a ten-bit example showing that bound can be strict. For symmetric Boolean functions, head complexity equals the number of value changes across consecutive Hamming-weight levels, even with positional embeddings. A frontier model generated and formally proved the results, which were machine-verified in Lean; human researchers set the high-level questions and reviewed the theorems. The authors make the formalization and research traces available. This is presented as a proof of concept for model-assisted, formally grounded research into transformer architectures.

## Source excerpt

arXiv:2610.25341v1 Announce Type: cross Abstract: Multi-head attention is a central component of the transformer architecture, yet how its expressivity depends on the number of heads remains poorly understood. We study a one-layer, attention-only transformer with additive positional embeddings and define the head complexity $H^\ast(f)$ of a Boolean function $f$ as the minimum number of attention heads required to represent it. We derive an exact linear-fractional normal form for head complexity, prove a general threshold-degree lower bound, and give an explicit ten-bit function for which this bound is strict. For symmetric Boolean functions, we independently show that head complexity equals the number of times the function changes value between consecutive Hamming-weight levels, even when positional embeddings are allowed. This agrees with the concurrent characterization of Hsu and Xu (arXiv:2608.04243) in a model without positional embeddings. The symmetric lower bound combines our general threshold-degree bound with the classical result of Aspnes et al. (1994). These results were discovered and formalized by a frontier model through conjecture generation, theorem proving, and machine verification, while human researchers asked the high-level questions and reviewed the generated theorems. We make the Lean formalization and research traces publicly available to support agent-assisted theorem proving and formal verification in mechanistic interpretability. This work provides a proof of concept for using the capabilities of frontier models, grounded by formal verification, to develop an understanding of transformer architectures.