cs.CLOct 14, 2026

Choosing the Number of Attention Heads from Intrinsic Dimension: A Small-Scale Study

Authors: Arjun Boya, Charan Sai Bandaru, Masthanaiah Pillimetla, Kavana Chidanandappa

Organizations: Institute of Cognitive Science University of Osnabrück · Department of Social Sciences and Technology Technical University of Munich

Abstract

The number of attention heads in a transformer is usually set by convention or grid search. We test a simple heuristic for setting it in advance: estimate the intrinsic dimension of token representations without labels, and use roughly that many heads. We estimate intrinsic dimension with a nested-dropout VAE trained on DistilBERT embeddings of WikiText-2, choosing the KL weight at the knee of the VAE's rate-distortion curve rather than by hand. This gives k∗=9.2k^*=9.2 (95% CI [8.6, 9.8]). In a small 4-layer transformer trained from scratch, 10 heads and 32 heads are statistically equivalent on SST-2 and on MRPC (paired TOST over 10 seeds, ±1\pm1 point margin), with 69% fewer attention parameters for the 10-head model. Training 10 heads from the start also slightly outperforms training 32 heads and pruning to 10 (0.6 points, p=0.008p=0.008). The evidence is narrow: two classification tasks, one small architecture, no pretrained models, and no formal link between intrinsic dimension and head count. We present the result as a practical heuristic worth testing at larger scale, not as a general principle.

Figures & tables

Appendix figures & tables1 asset

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Multi-Head Attention as Ensemble Nadaraya-Watson Estimation: Variance Reduction, Decorrelation, and Optimal Head Diversity

    May 18, 2026Ernest FokouéSelf-AttentionEnsemble Learning

  2. Performance-Efficiency Tradeoffs in Transformers: An Approximation Theory Perspective

    Oct 4, 2025Ruoxi Yu, Haotian Jiang, Jingpu Cheng +3Softmax AttentionAttention Head Analysis

  3. INCRT: An Incremental Transformer That Determines Its Own Architecture

    Apr 12, 2026Giansalvo CirrincioneTransformerNeural Architecture Search