Rethinking and Improving Relative Position Encoding for Vision Transformer
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
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2014Microsoft COCO: Common Objects in Contextcited by 17,498
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
- 2020End-to-End Object Detection with Transformerscited by 7,384
- 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
- 2015Rethinking the Inception Architecture for Computer Visioncited by 5,451
- 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
15 more
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
- 2017Non-local Neural Networkscited by 2,290
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2020Point Transformercited by 1,462
- 2020Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformerscited by 1,368
- 2018Self-Attention with Relative Position Representationscited by 1,112
- 2020Designing Network Design Spacescited by 954
- 2020PCT: Point cloud transformercited by 730
- 2017Convolutional Sequence to Sequence Learningcited by 550
- 2019Stand-Alone Self-Attention in Vision Modelscited by 542
- 2021Bottleneck Transformers for Visual Recognitioncited by 364
- 2020Axial-DeepLab: Stand-Alone Axial-Attention for Panoptic Segmentationcited by 326
- 2021AutoFormer: Searching Transformers for Visual Recognitioncited by 186
- 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
Built on by
Citing papers per year: 2021: 12; 2022: 49; 2023: 57; 2024: 36; 2025: 31; 2026: 21.
206 papers.
Sort:
By area:
- 2021Swin Transformer V2: Scaling Up Capacity and Resolutioncited by 1,215
- 2022PETR: Position Embedding Transformation for Multi-View 3D Object Detectioncited by 550
- 2021MetaFormer Is Actually What You Need for Visioncited by 523
- 2022Flexible Diffusion Modeling of Long Videoscited by 294
- 2022TinyViT: Fast Pretraining Distillation for Small Vision Transformerscited by 232
- 2024Rotary Position Embedding for Vision Transformercited by 226
- 2023Learning to Exploit Temporal Structure for Biomedical Vision-Language Processingcited by 210
- 2021Embracing Single Stride 3D Object Detector with Sparse Transformercited by 193
- 2022Vision GNN: An Image is Worth Graph of Nodescited by 185
- 2022DaViT: Dual Attention Vision Transformerscited by 174
- 2023CROMA: Remote Sensing Representations with Contrastive Radar-Optical Masked Autoencoderscited by 167
- 2022Stratified Transformer for 3D Point Cloud Segmentationcited by 166
38 more
- 2021SPViT: Enabling Faster Vision Transformers via Soft Token Pruningcited by 165
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
- 2022Language Conditioned Spatial Relation Reasoning for 3D Object Groundingcited by 121
- 2021A Survey of Visual Transformerscited by 117
- 2023Swin3D: A Pretrained Transformer Backbone for 3D Indoor Scene Understandingcited by 111
- 2022I-ViT: Integer-only Quantization for Efficient Vision Transformer Inferencecited by 93
- 2022MiniViT: Compressing Vision Transformers with Weight Multiplexingcited by 88
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 84
- 2023GTA: A Geometry-Aware Attention Mechanism for Multi-View Transformerscited by 75
- 2022AirFormer: Predicting Nationwide Air Quality in China with Transformerscited by 73
- 2022LargeKernel3D: Scaling up Kernels in 3D Sparse CNNscited by 71
- 2022Coarse-to-Fine Sparse Transformer for Hyperspectral Image Reconstructioncited by 67
- 2024Feature Re-Embedding: Towards Foundation Model-Level Performance in Computational Pathologycited by 66
- 2022Video Transformers: A Surveycited by 63
- 2024OmniSat: Self-Supervised Modality Fusion for Earth Observationcited by 63
- 2021An Image Patch is a Wave: Phase-Aware Vision MLPcited by 61
- 2022MogaNet: Multi-order Gated Aggregation Networkcited by 59
- 2022Patch Similarity Aware Data-Free Quantization for Vision Transformerscited by 55
- 2023PhysFormer++: Facial Video-based Physiological Measurement with SlowFast Temporal Difference Transformercited by 46
- 2023Improving Position Encoding of Transformers for Multivariate Time Series Classificationcited by 44
- 2021PatchFormer: An Efficient Point Transformer with Patch Attentioncited by 43
- 2022Modeling Image Composition for Complex Scene Generationcited by 43
- 2023Predicting Gradient is Better: Exploring Self-Supervised Learning for SAR ATR with a Joint-Embedding Predictive Architecturecited by 43
- 2022PSAQ-ViT V2: Towards Accurate and General Data-Free Quantization for Vision Transformerscited by 42
- 2023MH-DETR: Video Moment and Highlight Detection with Cross-modal Transformercited by 40
- 2021Searching the Search Space of Vision Transformercited by 39
- 2022Meta Architecture for Point Cloud Analysiscited by 39
- 2023Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attentioncited by 38
- 2023Look at the Neighbor: Distortion-aware Unsupervised Domain Adaptation for Panoramic Semantic Segmentationcited by 37
- 2024KeyPoint Relative Position Encoding for Face Recognitioncited by 37
- 2022Hypergraph Transformer for Skeleton-based Action Recognitioncited by 36
- 2022ResFormer: Scaling ViTs with Multi-Resolution Trainingcited by 34
- 2023DilateFormer: Multi-Scale Dilated Transformer for Visual Recognitioncited by 34
- 2022A Unified Query-based Paradigm for Point Cloud Understandingcited by 32
- 2022Transforming medical imaging with Transformers? A comparative review of key properties, current progresses, and future perspectivescited by 32
- 2023Real-Time Motion Prediction via Heterogeneous Polyline Transformer with Relative Pose Encodingcited by 32
- 2022Visual Abductive Reasoningcited by 30
- 2023ViTO: Vision Transformer-Operatorcited by 29
50 most cited of 206 All 206 (JSON)
- 2026G-ray: Ray-Level Relative Geometric Position Encoding in Multi-View Vision Transformers under Camera Heterogeneity14 Sep 2026
- 2026Do Geometry-Aware Positional Encodings Help Transformers in Spatial Imperfect-Information Games?15 Aug 2026
- 2026Rethinking Attention Locality in Spiking Transformers9 Aug 2026
- 2026Jet-Long: Efficient Long-Context Extension with Dynamic Bifocal RoPE8 Jul 2026
- 2026FoundDP: Revisiting Weak Disparity Observability in Dual-Pixel Depth Estimation2 Jul 2026
- 2026Active Spatial Guidance: Eliminating Injected Positional Mechanisms in Vision Transformers1 Jul 2026
- 2026REViT: Roto-reflection Equivariant Convolutional Vision Transformer24 Jun 2026
- 2026Robustness of Similarity-based Positional Encoding Under Rotations: Theoretical Analysis and Experimental Validation16 Jun 2026
- 2026SHERPA: Seam-aware Harmonized ERP Adaptation for Open-Domain 360^circ Panorama Generation10 Jun 2026
- 2026GeoRoPE: Ground-Aware Rotary Adaptation for Remote Sensing Foundation Models8 Jun 2026
- 2026Spatial Priors via Space Filling Curves for Small and Limited Data Vision Transformers8 Jun 2026
- 2026Selective Coupling of Decoupled Informative Regions: Masked Attention Alignment for Data-Free Quantization of Vision Transformers3 Jun 2026
38 more
- 2026Weierstrass Positional Encoding for Vision Transformers20 May 2026
- 2026Deep Wave Network for Modeling Multi-Scale Physical Dynamics5 May 2026
- 2026Mesh Based Simulations with Spatial and Temporal awareness2 May 2026
- 2026RIHA: Report-Image Hierarchical Alignment for Radiology Report Generation30 Apr 2026
- 2026Locality-Attending Vision Transformer5 Mar 2026
- 2026VariViT: A Vision Transformer for Variable Image Sizes16 Feb 2026
- 2026Point Virtual Transformer4 Feb 2026
- 2026Refining Strokes by Learning Offset Attributes between Strokes for Flexible Sketch Edit at Stroke-Level31 Jan 2026
- 2026Geometry without Position? When Positional Embeddings Help and Hurt Spatial Reasoning29 Jan 2026
- 2025TSkel-Mamba: Temporal Dynamic Modeling via State Space Model for Human Skeleton-based Action Recognition12 Dec 2025
- 2025GeoPE:A Unified Geometric Positional Embedding for Structured Tensors4 Dec 2025
- 2025SSR: Semantic and Spatial Rectification for CLIP-based Weakly Supervised Segmentation1 Dec 2025
- 2025Mechanisms of Non-Monotonic Scaling in Vision Transformers26 Nov 2025
- 2025Alias-Free ViT: Fractional Shift Invariance via Linear Attention26 Oct 2025
- 2025Leveraging Cycle-Consistent Anchor Points for Self-Supervised RGB-D Registration16 Oct 2025
- 2025HeSRN: Representation Learning On Heterogeneous Graphs via Slot-Aware Retentive Network10 Oct 2025
- 2025Indirect Attention: Turning Context Misalignment into a Feature30 Sep 2025
- 2025NDLPNet: A Location-Aware Nighttime Deraining Network and a Real-World Benchmark Dataset17 Sep 2025
- 2025Comparative Analysis of Transformer Models in Disaster Tweet Classification for Public Safety4 Sep 2025
- 2025TinyDrop: Tiny Model Guided Token Dropping for Vision Transformers3 Sep 2025
- 2025Towards More Diverse and Challenging Pre-training for Point Cloud Learning: Self-Supervised Cross Reconstruction with Decoupled Views1 Sep 2025
- 2025DSFormer: A Dual-Scale Cross-Learning Transformer for Visual Place Recognition24 Jul 2025
- 2025Sampling 3D Molecular Conformers with Diffusion Transformers18 Jun 2025
- 2025Vision Generalist Model: A Survey11 Jun 2025
- 2025ComRoPE: Scalable and Robust Rotary Position Embedding Parameterized by Trainable Commuting Angle Matrices4 Jun 2025
- 2025Hierarchical-embedding autoencoder with a predictor (HEAP) as efficient architecture for learning long-term evolution of complex multi-scale physical systems24 May 2025
- 2025Learning to Adapt to Position Bias in Vision Transformer Classifiers19 May 2025
- 2025A 2D Semantic-Aware Position Encoding for Vision Transformers14 May 2025
- 2025Person Recognition at Altitude and Range: Fusion of Face, Body Shape and Gait7 May 2025
- 2025LOOPE: Learnable Optimal Patch Order in Positional Embeddings for Vision Transformers19 Apr 2025
- 2025Air Quality Prediction with A Meteorology-Guided Modality-Decoupled Spatio-Temporal Network14 Apr 2025
- 2025Learning Object Focused Attention10 Apr 2025
- 2025HGFormer: Topology-Aware Vision Transformer with HyperGraph Learning3 Apr 2025
- 2025Spectral-Adaptive Modulation Networks for Visual Perception31 Mar 2025
- 2025vGamba: Attentive State Space Bottleneck for efficient Long-range Dependencies in Visual Recognition27 Mar 2025
- 2025Stack Transformer Based Spatial-Temporal Attention Model for Dynamic Sign Language and Fingerspelling Recognition21 Mar 2025
- 2025UniNet: A Unified Multi-granular Traffic Modeling Framework for Network Security6 Mar 2025
- 2025Partial Convolution Meets Visual Attention5 Mar 2025
50 newest of 206 All 206 (JSON)
- 2022Flexible Diffusion Modeling of Long Videoscited by 294
- 2024Semantically Consistent Video Inpainting with Conditional Diffusion Modelscited by 8
- 2025Constrained Generative Modeling with Manually Bridged Diffusion Modelscited by 8
- 2023Don't be so negative! Score-based Generative Modeling with Oracle-assisted Guidancecited by 6
- 2025Sampling 3D Molecular Conformers with Diffusion Transformerscited by 5
- 2025Sampling 3D Molecular Conformers with Diffusion Transformers18 Jun 2025
- 2025Constrained Generative Modeling with Manually Bridged Diffusion Models27 Feb 2025
- 2024Semantically Consistent Video Inpainting with Conditional Diffusion Models30 Apr 2024
- 2023Don't be so negative! Score-based Generative Modeling with Oracle-assisted Guidance31 Jul 2023
- 2022Flexible Diffusion Modeling of Long Videos23 May 2022
- 2021Swin Transformer V2: Scaling Up Capacity and Resolutioncited by 1,215
- 2022PETR: Position Embedding Transformation for Multi-View 3D Object Detectioncited by 550
- 2021MetaFormer Is Actually What You Need for Visioncited by 523
- 2022TinyViT: Fast Pretraining Distillation for Small Vision Transformerscited by 232
- 2024Rotary Position Embedding for Vision Transformercited by 226
- 2023Learning to Exploit Temporal Structure for Biomedical Vision-Language Processingcited by 210
- 2021Embracing Single Stride 3D Object Detector with Sparse Transformercited by 193
- 2022Vision GNN: An Image is Worth Graph of Nodescited by 185
- 2022DaViT: Dual Attention Vision Transformerscited by 174
- 2023CROMA: Remote Sensing Representations with Contrastive Radar-Optical Masked Autoencoderscited by 167
- 2022Stratified Transformer for 3D Point Cloud Segmentationcited by 166
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
12 most cited of 193 All 193 (JSON)
- 2026G-ray: Ray-Level Relative Geometric Position Encoding in Multi-View Vision Transformers under Camera Heterogeneity14 Sep 2026
- 2026Do Geometry-Aware Positional Encodings Help Transformers in Spatial Imperfect-Information Games?15 Aug 2026
- 2026Rethinking Attention Locality in Spiking Transformers9 Aug 2026
- 2026FoundDP: Revisiting Weak Disparity Observability in Dual-Pixel Depth Estimation2 Jul 2026
- 2026Active Spatial Guidance: Eliminating Injected Positional Mechanisms in Vision Transformers1 Jul 2026
- 2026REViT: Roto-reflection Equivariant Convolutional Vision Transformer24 Jun 2026
- 2026Robustness of Similarity-based Positional Encoding Under Rotations: Theoretical Analysis and Experimental Validation16 Jun 2026
- 2026SHERPA: Seam-aware Harmonized ERP Adaptation for Open-Domain 360^circ Panorama Generation10 Jun 2026
- 2026GeoRoPE: Ground-Aware Rotary Adaptation for Remote Sensing Foundation Models8 Jun 2026
- 2026Spatial Priors via Space Filling Curves for Small and Limited Data Vision Transformers8 Jun 2026
- 2026Selective Coupling of Decoupled Informative Regions: Masked Attention Alignment for Data-Free Quantization of Vision Transformers3 Jun 2026
- 2026Weierstrass Positional Encoding for Vision Transformers20 May 2026
12 newest of 193 All 193 (JSON)