Journal article
Linear complexity self-attention with 3rd order polynomials
- Abstract:
- Self-attention mechanisms and non-local blocks have become crucial building blocks for state-of-the-art neural architectures thanks to their unparalleled ability in capturing long-range dependencies in the input. However their cost is quadratic with the number of spatial positions hence making their use impractical in many real case applications. In this work, we analyze these methods through a polynomial lens, and we show that self-attention can be seen as a special case of a 3 rd order polynomial. Within this polynomial framework, we are able to design polynomial operators capable of accessing the same data pattern of non-local and self-attention blocks while reducing the complexity from quadratic to linear. As a result, we propose two modules (Poly-NL and Poly-SA) that can be used as “drop-in” replacements for more-complex non-local and self-attention layers in state-of-the-art CNNs and ViT architectures. Our modules can achieve comparable, if not better, performance across a wide range of computer vision tasks while keeping a complexity equivalent to a standard linear layer.
- Publication status:
- Published
- Peer review status:
- Peer reviewed
Actions
Access Document
- Files:
-
-
(Preview, Accepted manuscript, pdf, 2.6MB, Terms of use)
-
- Publisher copy:
- 10.1109/TPAMI.2022.3231971
Authors
- Publisher:
- IEEE
- Journal:
- IEEE Transactions on Pattern Analysis and Machine Intelligence More from this journal
- Volume:
- 45
- Issue:
- 11
- Pages:
- 12726 - 12737
- Publication date:
- 2023-03-20
- Acceptance date:
- 2022-12-11
- DOI:
- EISSN:
-
1939-3539
- ISSN:
-
0162-8828
- Language:
-
English
- Keywords:
- Pubs id:
-
1337441
- Local pid:
-
pubs:1337441
- Deposit date:
-
2023-05-16
- ARK identifier:
Terms of use
- Copyright holder:
- IEEE
- Copyright date:
- 2023
- Rights statement:
- ©2023 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.
- Notes:
- This is the accepted manuscript version of the article. The final version is available from IEEE at: 10.1109/TPAMI.2022.3231971
If you are the owner of this record, you can report an update to it here: Report update to this record