NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Are Sixteen Heads Really Better than One?

Paul Michel, Omer Levy, Graham Neubig

Abstract

Attention is a powerful and ubiquitous mechanism for allowing neural models to focus on particular salient pieces of information by taking their weighted average when making predictions. In particular, multi-headed attention is a driving force behind many recent state-of-the-art NLP models such as Transformer-based MT models and BERT. These models apply multiple attention mechanisms in parallel, with each attention "head" potentially focusing on different parts of the input, which makes it possible to express sophisticated functions beyond the simple weighted average. In this paper we make the surprising observation that even if models have been trained using multiple heads, in practice, a large percentage of attention heads can be removed at test time without significantly impacting performance. In fact, some layers can even be reduced to a single head. We further examine greedy algorithms for pruning down models, and the potential speed, memory efficiency, and accuracy improvements obtainable therefrom. Finally, we analyze the results with respect to which parts of the model are more reliant on having multiple heads, and provide precursory evidence that training dynamics play a role in the gains provided by multi-head attention.

Introduction

The Transformer architecture revolutionized Natural Language Processing (NLP) through the introduction of Multi-Headed Attention (MHA). Theoretically, having multiple "heads" allows a model to simultaneously attend to different aspects of the input—for instance, one head might focus on syntactic structures while another tracks specific keywords. However, these models are computationally expensive and memory-intensive, leading researchers to question the necessity of such high parameter counts at inference time.

This study addresses a fundamental question: Do we actually need all these heads at test time? While MHA provides a massive boost during the training phase, it remains unclear if the model's final performance truly relies on the collective "wisdom" of 12 or 16 parallel heads, or if the architecture is simply over-parameterized.

Methodology

The researchers investigated head redundancy using two primary strategies across two major model types: a "large" Transformer trained on the WMT2014 English-to-French corpus (WMT) and a standard BERT-base model fine-tuned on MultiNLI.

  1. Individual Ablation: The team systematically "masked" individual attention heads by multiplying their output by a variable $\xi_h \in \{0, 1\}$. By setting $\xi_h = 0$, they could effectively remove a head at test time and measure the resulting change in performance (BLEU for translation, Accuracy for NLI).
  2. Iterative Pruning: To determine how many heads could be removed across the entire model, they developed a greedy pruning algorithm. They calculated an Importance Score ($I_h$) for each head based on the gradient of the loss with respect to the head's mask—a first-order Taylor expansion estimating the model's sensitivity to that head's removal.

To ensure the findings were robust, they conducted generalization checks on noisy translation data (MTNT) and several GLUE tasks (SST-2, CoLA, MRPC).

The Extent of Head Redundancy

The results revealed massive redundancy in both BERT and WMT. For the majority of layers, most heads can be removed individually with negligible impact on performance. In some instances, removing specific heads actually increased the model's score, suggesting that some heads may act as noise rather than useful signal after training is complete.

Performance impact of ablating individual heads in WMT (left) and BERT (right). The dashed red line represents the baseline performance with all heads active.

As shown in the distribution above, the vast majority of heads in both models are "expendable" at test time. While a few heads are critical (the outliers on the left of the histograms), most heads cluster around or even to the right of the baseline performance line.

Universal Importance and Generalization

A key finding of the study is that head importance is not merely an artifact of a specific test set. Heads that are identified as important for one dataset tend to be important for others within the same task domain. This suggests that these "load-bearing" heads have learned fundamental linguistic features.

Correlation of head ablation scores across different datasets for WMT (left) and BERT (right). The high Pearson correlation coefficients (0.56 and 0.68) indicate that head importance is consistent across domains.

This consistency allows for reliable pruning; a model pruned based on performance on a standard validation set is likely to maintain its efficiency and accuracy on out-of-distribution or noisy data.

Key Results and Efficiency Gains

  • Pruning Thresholds: The researchers found that up to 20% of heads in WMT and 40% of heads in BERT can be pruned before any noticeable performance degradation occurs.
  • Single-Head Layers: Many layers can be reduced to a single attention head at test time without significant loss. However, not all layers are equal; encoder-decoder attention layers in MT models were found to be far more sensitive to pruning than self-attention layers.
  • Inference Speedup: Pruning is not just a theoretical exercise. Removing 50% of the heads in a BERT-base model resulted in an inference speedup of up to 17.5% for higher batch sizes, offering a clear path toward more efficient production deployments.

Conclusion and Future Work

While this research proves that many heads are redundant at test time, the authors caution that this does not mean models can be trained with fewer heads from the start. The "extra" heads may be crucial for the optimization landscape during training—a concept related to the "Lottery Ticket Hypothesis." Future work will involve investigating training techniques that encourage sparsity from the outset and exploring why specific components, like encoder-decoder attention, remain so reliant on multi-headedness.

Summary updated

BibTeX
@inproceedings{michel2019are,
  author = {Paul Michel and Omer Levy and Graham Neubig},
  title = {{Are Sixteen Heads Really Better than One?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=wGHwyIqVnD2},
}
Figure