Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. On the Relationship between Self-Attention and Convolutional Layers
 
conference paper not in proceedings

On the Relationship between Self-Attention and Convolutional Layers

Cordonnier, Jean-Baptiste  
•
Loukas, Andreas
•
Jaggi, Martin  
2020
Eighth International Conference on Learning Representations - ICLR 2020

Recent trends of incorporating attention mechanisms in vision have led re- searchers to reconsider the supremacy of convolutional layers as a primary build- ing block. Beyond helping CNNs to handle long-range dependencies, Ramachandran et al. (2019) showed that attention can completely replace convolution and achieve state-of-the-art performance on vision tasks. This raises the question: do learned attention layers operate similarly to convolutional layers? This work pro- vides evidence that attention layers can perform convolution and, indeed, they often learn to do so in practice. Specifically, we prove that a multi-head self-attention layer with sufficient number of heads is at least as expressive as any convolutional layer. Our numerical experiments then show that self-attention layers attend to pixel-grid patterns similarly to CNN layers, corroborating our analysis. Our code is publicly available.

  • Files
  • Details
  • Metrics
Type
conference paper not in proceedings
Author(s)
Cordonnier, Jean-Baptiste  
Loukas, Andreas
Jaggi, Martin  
Date Issued

2020

Total of pages

18

Subjects

self-attention

•

transformers

•

convolution

•

expressivity

•

ml-ai

URL

Code

https://github.com/epfml/attention-cnn

Interactive website

https://epfml.github.io/attention-cnn/

OpenReview

https://openreview.net/forum?id=HJlnC1rKPB
Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
MLO  
LTS2  
Event nameEvent placeEvent date
Eighth International Conference on Learning Representations - ICLR 2020

Addis Ababa, Ethiopia

April 26-30, 2020

Available on Infoscience
January 10, 2020
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/164507
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés