Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:1905.10650

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Computation and Language

arXiv:1905.10650 (cs)
[Submitted on 25 May 2019 (v1), last revised 4 Nov 2019 (this version, v3)]

Title:Are Sixteen Heads Really Better than One?

Authors:Paul Michel, Omer Levy, Graham Neubig
View a PDF of the paper titled Are Sixteen Heads Really Better than One?, by Paul Michel and 2 other authors
View PDF
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.
Comments: NeurIPS 2019
Subjects: Computation and Language (cs.CL)
Cite as: arXiv:1905.10650 [cs.CL]
  (or arXiv:1905.10650v3 [cs.CL] for this version)
  https://doi.org/10.48550/arXiv.1905.10650
arXiv-issued DOI via DataCite

Submission history

From: Paul Michel [view email]
[v1] Sat, 25 May 2019 18:27:28 UTC (2,072 KB)
[v2] Mon, 1 Jul 2019 21:22:49 UTC (2,073 KB)
[v3] Mon, 4 Nov 2019 15:49:01 UTC (2,113 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Are Sixteen Heads Really Better than One?, by Paul Michel and 2 other authors
  • View PDF
  • TeX Source
  • Other Formats
view license
Current browse context:
cs.CL
< prev   |   next >
new | recent | 2019-05
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

3 blog links

(what is this?)

DBLP - CS Bibliography

listing | bibtex
Paul Michel
Omer Levy
Graham Neubig
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack