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. Reports, Documentation, and Standards
  4. Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
 
report

Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention

Katharopoulos, Angelos
•
Vyas, Apoorv
•
Pappas, Nikolaos
Show more
2020

Transformers achieve remarkable performance in several tasks but due to their quadratic complexity, with respect to the input’s length, they are prohibitively slow for very long sequences. To address this limitation, we express the self-attention as a linear dot-product of kernel feature maps and make use of the associativity property of matrix products to reduce the complexity from O(N^2) to O(N), where N is the sequence length. We show that this formulation permits an iterative implementation that dramatically accelerates autoregressive transformers and reveals their relationship to recurrent neural networks. Our linear transformers achieve similar performance to vanilla transformers and they are up to 4000x faster on autoregressive prediction of very long sequences

  • Details
  • Metrics
Type
report
Author(s)
Katharopoulos, Angelos
•
Vyas, Apoorv
•
Pappas, Nikolaos
•
Fleuret, Francois
Date Issued

2020

Publisher

Idiap

URL

Link to IDIAP database

http://publications.idiap.ch/downloads/internals/2020/Katharopoulos_Idiap-Internal-RR-26-2020.pdf
Written at

EPFL

EPFL units
LIDIAP  
Available on Infoscience
July 23, 2020
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/170339
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