CoChat

Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned

Open access
Voita, Elena, Talbot, David, Moiseev, Fedor, Sennrich, Rico, Titov, Ivan · 2019 · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics

The DOI matches its Crossref record; 34 of the 38 references it cites were found in a registry or an index.

Abstract

Multi-head self-attention is a key component of the Transformer, a state-of-the-art architecture for neural machine translation.In this work we evaluate the contribution made by individual attention heads in the encoder to the overall performance of the model and analyze the roles played by them.We find that the most important and confident heads play consistent and often linguistically-interpretable roles.When pruning heads using a method based on stochastic gates and a differentiable relaxation of the L 0 penalty, we observe that specialized heads are last to be pruned.Our novel pruning method removes the vast majority of heads without seriously affecting performance.For example, on the English-Russian WMT dataset, pruning 38 out of 48 encoder heads results in a drop of only 0.15 BLEU. 1

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.18653/v1/p19-1580

Cites

34 of 34 references verified0 citation errors · 0 not checkable

Statistics

Figures

Figure 1 Importance (according to LRP), confidence, and function of self-attention heads. In each layer, heads are sorted by their relevance according to LRP. Model trained on 6m OpenSubtitles EN-RU data.
Figure 1 Importance (according to LRP), confidence, and function of self-attention heads. In each layer, heads are sorted by their relevance according to LRP. Model trained on 6m OpenSubtitles EN-RU data.CC-BY · From the PDF
Figure 2 Importance (according to LRP) and function of self-attention heads. In each layer, heads are sorted by their relevance according to LRP. Models trained on 2.5m WMT EN-DE (a, b) and EN-FR (c, d).
Figure 2 Importance (according to LRP) and function of self-attention heads. In each layer, heads are sorted by their relevance according to LRP. Models trained on 2.5m WMT EN-DE (a, b) and EN-FR (c, d).CC-BY · From the PDF
Image 3
CC-BY · From the PDF
Figure 4 Dependency scores for EN-RU, EN-DE, ENFR each trained on 2.5m WMT data.
Figure 4 Dependency scores for EN-RU, EN-DE, ENFR each trained on 2.5m WMT data.CC-BY · From the PDF
Figure 5 Attention maps of the rare words head. Models trained on WMT: (a) EN-RU, (b) EN-DE, (c) EN-FR
Figure 5 Attention maps of the rare words head. Models trained on WMT: (a) EN-RU, (b) EN-DE, (c) EN-FRCC-BY · From the PDF
Figure 6 Concrete distribution: (a) Concrete and its stretched and rectified version (Hard Concrete); (b) Hard Concrete distributions with different parameters.
Figure 6 Concrete distribution: (a) Concrete and its stretched and rectified version (Hard Concrete); (b) Hard Concrete distributions with different parameters.CC-BY · From the PDF
Figure 7 BLEU score as a function of number of retained encoder heads (EN-RU). Regularization applied by fine-tuning trained model.
Figure 7 BLEU score as a function of number of retained encoder heads (EN-RU). Regularization applied by fine-tuning trained model.CC-BY · From the PDF
Figure 8 Functions of encoder heads retained after pruning. Each column represents all remaining heads after varying amount of pruning (EN-RU; Subtitles).
Figure 8 Functions of encoder heads retained after pruning. Each column represents all remaining heads after varying amount of pruning (EN-RU; Subtitles).CC-BY · From the PDF
Figure 9 Number of active heads of different attention type for models with different sparsity rate
Figure 9 Number of active heads of different attention type for models with different sparsity rateCC-BY · From the PDF
Figure 10 Number of active heads in different layers of the decoder for models with different sparsity rate (EN-RU, WMT)
Figure 10 Number of active heads in different layers of the decoder for models with different sparsity rate (EN-RU, WMT)CC-BY · From the PDF

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cites

Show all 34 references

Research works printed but not linked: 3

  1. Hamidreza Ghader and Christof Monz. 2017. What does attention in neural machine translation pay at- tention to? In Proceedings of the Eighth Interna- tional Joint Conference on Natural Language Pro- cessing (Volume 1: Long Papers), pages 30-39. Asian Federation of Natural Language Processing.
  2. Rico Sennrich. 2017. How Grammatical is Character- level Neural Machine Translation? Assessing MT Quality with Contrastive Translation Pairs. In Pro- ceedings of the 15th Conference of the European Chapter of the Association for Computational Lin- guistics: Volume 2, Short Papers, pages 376-382, Valencia, Spain.
  3. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th An- nual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715- 1725, Berlin, Germany. Association for Computa- tional Linguistics. · DOI · Paper page

Cited by

Items 101–200 of 1,017

Metadata

Authors
Voita, E., Talbot, D., Moiseev, F., Sennrich, R., & Titov, I.
Affiliations
  • Yandex (Russia) (RU)
  • Moscow Institute of Physics and Technology (RU)
  • University of Zurich (CH)
  • University of Amsterdam (NL)
Corresponding author
Moiseev, Fedor
Venue
Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics
Published
2019
Pages
5797-5808
ISSN
0736-587X (ISSN-L)
OpenAlex
W2946794439
Cited by
1,146
References
38
Citations by year
2026: 101 · 2025: 184 · 2024: 182 · 2023: 201 · 2022: 123 · 2021: 190 · 2020: 129 · 2019: 36
FWCI
45.81
Type
conference paper
Language
en
Open access
Licence
cc-by
Locations
  • Proceedings of the conference - Association for Computational Linguistics. Meeting (publishedVersion, cc-by)
  • Zurich Open Repository and Archive (University of Zurich) (acceptedVersion, other-oa)
  • arXiv (Cornell University) (submittedVersion)
  • UvA-DARE (University of Amsterdam) (submittedVersion, cc-by)
  • Data Archiving and Networked Services (DANS) (submittedVersion, other-oa)
  • Edinburgh Research Explorer (University of Edinburgh) (submittedVersion, cc-by)
  • Zurich Open Repository and Archive (University of Zurich) (submittedVersion, cc-by)
  • arXiv (Cornell University)
  • Zurich Open Repository and Archive (University of Zurich)
Funders
  • National Science Foundation
  • Nederlandse Organisatie voor Wetenschappelijk Onderzoek (639.022.518)
  • H2020 European Research Council (678254)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
Keywords
multi-head self-attention, attention head pruning, Transformer encoder, neural machine translation, English-Russian translation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.