Lune

CVPR2023Top-tier venue

Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attention

Xuran Pan, Tianzhu Ye, Zhuofan Xia, Shiji Song, Gao Huang

Abstract

Self-attention mechanism has been a key factor in the recent progress of Vision Transformer (ViT), which enables adaptive feature extraction from global contexts. However, existing self-attention methods either adopt sparse global attention or window attention to reduce the computation complexity, which may compromise the local feature learning or subject to some handcrafted designs. In contrast, local attention, which restricts the receptive field of each query to its own neighboring pixels, enjoys the benefits of both convolution and self-attention, namely local inductive bias and dynamic feature selection. Nevertheless, current local attention modules either use inefficient Im2Col function or rely on specific CUDA kernels that are hard to generalize to devices without CUDA support. In this paper, we propose a novel local attention module, Slide Attention, which leverages common convolution operations to achieve high efficiency, flexibility and generalizability. Specifically, we first re-interpret the column-based Im2Col function from a new row-based perspective and use Depthwise Convolution as an efficient substitution. On this basis, we propose a deformed shifting module based on the re-parameterization technique, which further relaxes the fixed key/value positions to deformed features in the local region. In this way, our module realizes the local attention paradigm in both efficient and flexible manner. Extensive experiments show that our slide attention module is applicable to a variety of advanced Vision Transformer models and compatible with various hardware devices, and achieves consistently improved performances on comprehensive benchmarks. Code is available at https://github.com/ LeapLabTHU/Slide-Transformer.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

18 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • SparX: A Sparse Cross-Layer Connection Mechanism for Hierarchical Vision Mamba and Transformer Networks cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • SparX: A Sparse Cross-Layer Connection Mechanism for Hierarchical Vision Mamba and Transformer Networks cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • SparX: A Sparse Cross-Layer Connection Mechanism for Hierarchical Vision Mamba and Transformer Networks cites Training data-efficient image transformers & distillation through attention
  • On the Role of Attention Masks and LayerNorm in Transformers cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Learning Transferable Visual Models From Natural Language Supervision
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
  • JAFAR: Jack up Any Feature at Any Resolution cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • JAFAR: Jack up Any Feature at Any Resolution cites Learning Transferable Visual Models From Natural Language Supervision
  • Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • GSVA: Generalized Segmentation via Multimodal Large Language Models cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • GSVA: Generalized Segmentation via Multimodal Large Language Models cites Learning Transferable Visual Models From Natural Language Supervision
  • DAMamba: Vision State Space Model with Dynamic Adaptive Scan cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • DAMamba: Vision State Space Model with Dynamic Adaptive Scan cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • DAMamba: Vision State Space Model with Dynamic Adaptive Scan cites Training data-efficient image transformers & distillation through attention
  • Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers cites Learning Transferable Visual Models From Natural Language Supervision
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers18

  1. On the Role of Attention Masks and LayerNorm in TransformersXinyi Wu, Amir Ajorlou, Yifei Wang, Stefanie Jegelka et al.NeurIPS 2024 · 54 citations
  2. GSVA: Generalized Segmentation via Multimodal Large Language ModelsZhuofan Xia, Dongchen Han, Yizeng Han, Xuran Pan et al.CVPR 2024 · 42 citations
  3. SparX: A Sparse Cross-Layer Connection Mechanism for Hierarchical Vision Mamba and Transformer NetworksMeng Lou, Yunxiang Fu, Yizhou YuAAAI 2025 · 31 citations
  4. JAFAR: Jack up Any Feature at Any ResolutionPaul Couairon, Loïck Chambon, Louis Serrano, Jean-Emmanuel Haugeard et al.NeurIPS 2025 · 26 citations
  5. DAMamba: Vision State Space Model with Dynamic Adaptive ScanTanzhe Li, Caoshuo Li, Jiayi Lyu, Hongjuan Pei et al.NeurIPS 2025 · 24 citations

Builds on19

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  2. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  3. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  4. SegFormer: Simple and Efficient Design for Semantic Segmentation with TransformersEnze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar et al.NeurIPS 2021 · 9,661 citations
  5. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations

Related papers

  1. On the Connection between Local Attention and Dynamic Depth-wise ConvolutionQi Han, Zejia Fan, Qi Dai, Lei Sun et al.ICLR 2022 · 144 citations
  2. Learned Queries for Efficient Local AttentionMoab Arar, Ariel Shamir, Amit H. BermanoCVPR 2022 · 28 citations
  3. ViTAE: Vision Transformer Advanced by Exploring Intrinsic Inductive BiasYufei Xu, Qiming Zhang, Jing Zhang, Dacheng TaoNeurIPS 2021 · 429 citations
  4. You Only Need Less Attention at Each Stage in Vision TransformersShuoxi Zhang, Hanpeng Liu, Stephen Lin, Kun HeCVPR 2024 · 19 citations
  5. Vision Transformer with Deformable AttentionZhuofan Xia, Xuran Pan, Shiji Song, Li Erran Li et al.CVPR 2022 · 835 citations
Dusk over the sea between two cliffs drawn in fine vertical lines