The Effect of Attention Head Count on Transformer Approximation

arXiv stat.ML / 4/1/2026

💬 OpinionIdeas & Deep AnalysisModels & Research

Key Points

  • 本論文は、Transformerの近似能力を解析し、特に「注意ヘッド数(attention heads)」が表現力に与える影響を理論面で明らかにしようとする研究である。
  • 一般化したD-retrievalタスクを導入して連続関数空間で密(dense)であることを示し、理論的枠組みの基礎を与えている。
  • ヘッド数が十分多い場合は効率的なε近似が可能だが、ヘッド数が少なすぎる場合はパラメータ数が少なくともO(1/ε^{cT})のオーダーでスケールするという上界・下界を提示している。
  • 非線形かつ実務的に関連のある設定でこの種の厳密な下界を初めて与えると主張しており、さらに単一ヘッドの場合に埋め込み次元がO(T)なら入力の完全記憶が可能で近似は主にフィードフォワード側で達成されることを示している。
  • 合成データと実データタスクの実験により、理論結果の実用的妥当性を検証している。

Abstract

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 \epsilon-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/\epsilon^{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.