The Effect of Attention Head Count on Transformer Approximation
Not on the map. Why?
Abstract (arXiv)
Transformer has become the dominant architecture for sequence modeling, yet a detailed understanding of how its structural parameters influence expressive power remains limited. In this work, we study the approximation properties of transformers, with particular emphasis on the role of the number of attention heads. Our analysis begins with the introduction of a generalized D-retrieval task, which we prove to be dense in the space of continuous functions, thereby providing the basis for our theoretical framework. We then establish both upper and lower bounds on the parameter complexity required for ε-approximation. Specifically, we show that transformers with sufficiently many heads admit efficient approximation, whereas with too few heads, the number of parameters must scale at least as O(1/εcT), for some constant c and sequence length T. To the best of our knowledge, this constitutes the first rigorous lower bound of this type in a nonlinear and practically relevant setting. We further examine the single-head case and demonstrate that an embedding dimension of order O(T) allows complete memorization of the input, where approximation is entirely achieved by the feed-forward block. Finally, we validate our theoretical findings with experiments on both synthetic data and real-world tasks, illustrating the practical relevance of our results.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 17 of its 25 references that are in the map. First posted on arXiv 8 Oct 2025.
Builds on
17 of 25 references.
References · 17
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2017Billion-scale similarity search with GPUscited by 2,497
- 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,605
- 2018Universal Transformerscited by 647
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
- 2023Looped Transformers as Programmable Computerscited by 237
- 2020Low-Rank Bottleneck in Multi-head Attention Modelscited by 89
- 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 83
5 more
- 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 47
- 2023Memorization Capacity of Multi-Head Attention in Transformerscited by 40
- 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
- 2023Approximation Rate of the Transformer Architecture for Sequence Modelingcited by 28
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modelingcited by 25
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026Attention-based representations for multi-task computationcited by 1
- 2026InfoFlow: A Framework for Multi-Layer Transformer Analysiscited by 0
- 2026Foundation-Preserving Optimization in Generalized Eigenspacecited by 0
- 2026Three Tokens Force Exponential Feature Rank in Nonnegative Kernel Attentioncited by 0
- 2026Three Tokens Force Exponential Feature Rank in Nonnegative Kernel Attention11 Aug 2026
- 2026Attention-based representations for multi-task computation4 Aug 2026
- 2026Foundation-Preserving Optimization in Generalized Eigenspace28 May 2026
- 2026InfoFlow: A Framework for Multi-Layer Transformer Analysis18 May 2026