MoH: Multi-Head Attention as Mixture-of-Head Attention

Peng Jin, Bo Zhu, Li Yuan, Shuicheng Yan · DOI

Introduction

Since the introduction of the Transformer architecture, Multi-Head Attention (MHA) has served as the foundational mechanism for capturing complex dependencies in data. However, empirical evidence has long suggested that MHA is significantly redundant; many attention heads can be pruned post-training with negligible impact on accuracy. This redundancy stems from a "one-size-fits-all" approach where every token is processed by every head, regardless of the head's relevance to that specific token's context.

Mixture-of-Head Attention (MoH) addresses this inefficiency by reimagining individual attention heads as "experts" within a Mixture-of-Experts (MoE) framework. By allowing tokens to dynamically select only the most relevant heads, MoH reduces computational overhead while simultaneously improving model performance.

The Mixture-of-Head Framework

The theoretical foundation of MoH lies in the observation that MHA can be mathematically reformulated from a concatenation of head outputs into a summation form. This insight justifies treating each head's output as an independent contribution that can be selectively weighted or bypassed.

Comparison of standard Multi-Head Attention (a) and the proposed Mixture-of-Head Attention (b).

As illustrated in the architecture above, MoH introduces several key components:

  • Routed Heads: A router network predicts the top-$K$ most important heads for each token.
  • Shared Heads: A subset of heads remains "always-on" to capture universal patterns and ensure architectural stability.
  • Two-Stage Routing: A mechanism that balances the contributions of shared and routed heads using learned coefficients.

To facilitate the adoption of MoH in existing ecosystems, the authors developed a continue-tuning methodology. This allows pre-trained models, such as LLaMA3, to be converted into MoH models using a parameter-free router based on the $\ell_2$ norm of queries and a straight-through estimator to optimize head selection.

Experimental Results

The researchers evaluated MoH across vision and language domains, including ImageNet-1K classification, diffusion-based image generation, and large-scale language modeling.

Language Modeling and Continue-Tuning

One of the most significant results was achieved by continue-tuning LLaMA3-8B. The MoH-enhanced version achieved an average accuracy of 64.0% across 14 benchmarks—a 2.4% improvement over the original dense model—while activating only 75% of its attention heads during inference.

Accuracy trends for MMLU, HellaSwag, and TruthfulQA during the continue-tuning process of MoH models.

Vision and Efficiency

In vision tasks, MoH-ViT-B reached 84.9% Top-1 accuracy on ImageNet, surpassing the TransNeXt baseline while utilizing 25% fewer heads. Beyond accuracy, MoH offers tangible efficiency gains. By converting attention to sparse operations, the authors demonstrated inference speedups of up to 37% (measured in ms per sequence) when utilizing 50% of the available heads.

Conclusion and Future Work

MoH demonstrates that the inherent redundancy in Multi-Head Attention is not just a waste of computation, but an opportunity for specialization. By allowing heads to focus on specific semantic or logical categories, MoH achieves a "win-win" of higher accuracy and lower inference costs.

Future research will focus on lowering the "activation floor" (currently 50%–90% for peak performance), optimizing sparse-matrix kernels for modern GPU hardware, and exploring the scalability of MoH in massive multimodal models exceeding 70B parameters.

Summary updated

BibTeX
@inproceedings{jin2025moh,
  author = {Peng Jin and Bo Zhu and Li Yuan and Shuicheng Yan},
  title = {{MoH: Multi-Head Attention as Mixture-of-Head Attention}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=eYtgs9k75o},
}
Figure