Multi-Head Attention: Collaborate Instead of Concatenate

By Jean-Baptiste Cordonnier, Andreas Loukas, Martin Jaggi. 2020

180 citations recorded by the source corpus.

Attention layers are widely used in natural language processing (NLP) and are beginning to influence computer vision architectures. However, they suffer from over-parameterization. For instance, it was shown that the majority of attention heads could be pruned without impacting accuracy. This work aims to enhance current understanding on how multiple heads interact. Motivated by the observation that trained attention heads share common key/query projections, we propose a collaborative multi-head attention layer that enables heads to learn shared projections. Our scheme improves the computational cost and number of parameters in an attention layer and can be used as a drop-in replacement in any transformer architecture. For instance, by allowing heads to collaborate on a neural machine translation task, we can reduce the key dimension by a factor of eight without any loss in performance. We also show that it is possible to re-parametrize a pre-trained multi-head attention layer into our collaborative attention layer. Even without retraining, collaborative multi-head attention manages to reduce the size of the key and query projections by half without sacrificing accuracy. Our code is public.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Model Architectures

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Tianyang Lin
  2. Yuxin Wang
  3. Xiangyang Liu
  4. Jean-Baptiste Cordonnier
  5. Yihe Dong
  6. Andreas Loukas
  7. Xipeng Qiu
  8. Szymon Migacz

In Computer Vision and Pattern Recognition

  1. Jean-Baptiste Cordonnier
  2. Yihe Dong
  3. Andreas Loukas
  4. Szymon Migacz
  5. Alex Fit-Florea
  6. Xipeng Qiu
  7. Swetha Mandava
  8. Tianyang Lin

In Model Architectures

  1. Jean-Baptiste Cordonnier
  2. Yihe Dong
  3. Andreas Loukas
  4. Xipeng Qiu
  5. Tianyang Lin
  6. Yuxin Wang
  7. Xiangyang Liu
  8. Szymon Migacz

Citations in the corpus