Less is More: Pay Less Attention in Vision Transformers

Zizheng Pan, Bohan Zhuang, Haoyu He, Jing Liu, Jianfei Cai
5/29/2021
115 citations
cs.CV
transformer-attention

Official code: ziplab/LIT (97 stars, Python, Apache-2.0, last commit 2022-06-19).

Abstract

Transformers have become one of the dominant architectures in deep learning, particularly as a powerful alternative to convolutional neural networks (CNNs) in computer vision. However, Transformer training and inference in previous works can be prohibitively expensive due to the quadratic complexity of self-attention over a long sequence of representations, especially for high-resolution dense prediction tasks.

Show full abstract

To this end, we present a novel Less attention vIsion Transformer (LIT), building upon the fact that the early self-attention layers in Transformers still focus on local patterns and bring minor benefits in recent hierarchical vision Transformers. Specifically, we propose a hierarchical Transformer where we use pure multi-layer perceptrons (MLPs) to encode rich local patterns in the early stages while applying self-attention modules to capture longer dependencies in deeper layers. Moreover, we further propose a learned deformable token merging module to adaptively fuse informative patches in a non-uniform manner. The proposed LIT achieves promising performance on image recognition tasks, including image classification, object detection and instance segmentation, serving as a strong backbone for many vision tasks. Code is available at: https://github.com/zhuang-group/LIT

View on arXivView PDF

Code Implementations(1)

ziplab/LITOfficial100%
Apache-2.0

[AAAI 2022] This is the official PyTorch implementation of "Less is More: Pay Less Attention in Vision Transformers"

9713Python, CudaJun 7, 20214 years agoApache-2.0
image-recognitionmlpstransformers

Similar Papers

Cite this paper

@article{pan2021less,
  title  = {Less is More: Pay Less Attention in Vision Transformers},
  author = {Zizheng Pan and Bohan Zhuang and Haoyu He and Jing Liu and Jianfei Cai},
  year   = {2021},
  eprint = {2105.14217},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.14217}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.14217.svg)](https://codeofpaper.com/paper/2105.14217)

Discussion