mlsanityData to 7 Oct 2026

Rethinking and Improving Relative Position Encoding for Vision Transformer

arXiv 2107.14222 ↗First posted 29 Jul 2021cs.CVcited by 206

Not on the map. Why?

Abstract (arXiv)

Relative position encoding (RPE) is important for transformer to capture sequence ordering of input tokens. General efficacy has been proven in natural language processing. However, in computer vision, its efficacy is not well studied and even remains controversial, e.g., whether relative position encoding can work equally well as absolute position? In order to clarify this, we first review existing relative position encoding methods and analyze their pros and cons when applied in vision transformers. We then propose new relative position encoding methods dedicated to 2D images, called image RPE (iRPE). Our methods consider directional relative distance modeling as well as the interactions between queries and relative position embeddings in self-attention mechanism. The proposed iRPE methods are simple and lightweight. They can be easily plugged into transformer blocks. Experiments demonstrate that solely due to the proposed encoding methods, DeiT and DETR obtain up to 1.5% (top-1 Acc) and 1.3% (mAP) stable improvements over their original versions on ImageNet and COCO respectively, without tuning any extra hyperparameters such as learning rate and weight decay. Our ablation and analysis also yield interesting findings, some of which run counter to previous understanding. Code and models are open-sourced at https://github.com/microsoft/Cream/tree/main/iRPE.

Key facts. Cited by 206 papers in the map (data through 7 Oct 2026). Builds on 27 of its 33 references that are in the map. First posted on arXiv 29 Jul 2021.

Builds on

27 of 33 references.

References · 27

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2014Microsoft COCO: Common Objects in Contextcited by 17,498
  6. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  7. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  8. 2020End-to-End Object Detection with Transformerscited by 7,384
  9. 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
  10. 2015Rethinking the Inception Architecture for Computer Visioncited by 5,451
  11. 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
  12. 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
15 more
  1. 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
  2. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
  3. 2017Non-local Neural Networkscited by 2,290
  4. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  5. 2020Point Transformercited by 1,462
  6. 2020Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformerscited by 1,368
  7. 2018Self-Attention with Relative Position Representationscited by 1,112
  8. 2020Designing Network Design Spacescited by 954
  9. 2020PCT: Point cloud transformercited by 730
  10. 2017Convolutional Sequence to Sequence Learningcited by 550
  11. 2019Stand-Alone Self-Attention in Vision Modelscited by 542
  12. 2021Bottleneck Transformers for Visual Recognitioncited by 364
  13. 2020Axial-DeepLab: Stand-Alone Axial-Attention for Panoptic Segmentationcited by 326
  14. 2021AutoFormer: Searching Transformers for Visual Recognitioncited by 186
  15. 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 12; 2022: 49; 2023: 57; 2024: 36; 2025: 31; 2026: 21.

206 papers.

Sort:

By area:

  1. 2021Swin Transformer V2: Scaling Up Capacity and Resolutioncited by 1,215
  2. 2022PETR: Position Embedding Transformation for Multi-View 3D Object Detectioncited by 550
  3. 2021MetaFormer Is Actually What You Need for Visioncited by 523
  4. 2022Flexible Diffusion Modeling of Long Videoscited by 294
  5. 2022TinyViT: Fast Pretraining Distillation for Small Vision Transformerscited by 232
  6. 2024Rotary Position Embedding for Vision Transformercited by 226
  7. 2023Learning to Exploit Temporal Structure for Biomedical Vision-Language Processingcited by 210
  8. 2021Embracing Single Stride 3D Object Detector with Sparse Transformercited by 193
  9. 2022Vision GNN: An Image is Worth Graph of Nodescited by 185
  10. 2022DaViT: Dual Attention Vision Transformerscited by 174
  11. 2023CROMA: Remote Sensing Representations with Contrastive Radar-Optical Masked Autoencoderscited by 167
  12. 2022Stratified Transformer for 3D Point Cloud Segmentationcited by 166
38 more
  1. 2021SPViT: Enabling Faster Vision Transformers via Soft Token Pruningcited by 165
  2. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
  3. 2022Language Conditioned Spatial Relation Reasoning for 3D Object Groundingcited by 121
  4. 2021A Survey of Visual Transformerscited by 117
  5. 2023Swin3D: A Pretrained Transformer Backbone for 3D Indoor Scene Understandingcited by 111
  6. 2022I-ViT: Integer-only Quantization for Efficient Vision Transformer Inferencecited by 93
  7. 2022MiniViT: Compressing Vision Transformers with Weight Multiplexingcited by 88
  8. 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 84
  9. 2023GTA: A Geometry-Aware Attention Mechanism for Multi-View Transformerscited by 75
  10. 2022AirFormer: Predicting Nationwide Air Quality in China with Transformerscited by 73
  11. 2022LargeKernel3D: Scaling up Kernels in 3D Sparse CNNscited by 71
  12. 2022Coarse-to-Fine Sparse Transformer for Hyperspectral Image Reconstructioncited by 67
  13. 2024Feature Re-Embedding: Towards Foundation Model-Level Performance in Computational Pathologycited by 66
  14. 2022Video Transformers: A Surveycited by 63
  15. 2024OmniSat: Self-Supervised Modality Fusion for Earth Observationcited by 63
  16. 2021An Image Patch is a Wave: Phase-Aware Vision MLPcited by 61
  17. 2022MogaNet: Multi-order Gated Aggregation Networkcited by 59
  18. 2022Patch Similarity Aware Data-Free Quantization for Vision Transformerscited by 55
  19. 2023PhysFormer++: Facial Video-based Physiological Measurement with SlowFast Temporal Difference Transformercited by 46
  20. 2023Improving Position Encoding of Transformers for Multivariate Time Series Classificationcited by 44
  21. 2021PatchFormer: An Efficient Point Transformer with Patch Attentioncited by 43
  22. 2022Modeling Image Composition for Complex Scene Generationcited by 43
  23. 2023Predicting Gradient is Better: Exploring Self-Supervised Learning for SAR ATR with a Joint-Embedding Predictive Architecturecited by 43
  24. 2022PSAQ-ViT V2: Towards Accurate and General Data-Free Quantization for Vision Transformerscited by 42
  25. 2023MH-DETR: Video Moment and Highlight Detection with Cross-modal Transformercited by 40
  26. 2021Searching the Search Space of Vision Transformercited by 39
  27. 2022Meta Architecture for Point Cloud Analysiscited by 39
  28. 2023Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attentioncited by 38
  29. 2023Look at the Neighbor: Distortion-aware Unsupervised Domain Adaptation for Panoramic Semantic Segmentationcited by 37
  30. 2024KeyPoint Relative Position Encoding for Face Recognitioncited by 37
  31. 2022Hypergraph Transformer for Skeleton-based Action Recognitioncited by 36
  32. 2022ResFormer: Scaling ViTs with Multi-Resolution Trainingcited by 34
  33. 2023DilateFormer: Multi-Scale Dilated Transformer for Visual Recognitioncited by 34
  34. 2022A Unified Query-based Paradigm for Point Cloud Understandingcited by 32
  35. 2022Transforming medical imaging with Transformers? A comparative review of key properties, current progresses, and future perspectivescited by 32
  36. 2023Real-Time Motion Prediction via Heterogeneous Polyline Transformer with Relative Pose Encodingcited by 32
  37. 2022Visual Abductive Reasoningcited by 30
  38. 2023ViTO: Vision Transformer-Operatorcited by 29

50 most cited of 206 All 206 (JSON)