A 2D Semantic-Aware Position Encoding for Vision Transformers
Not on the map. Why?
Abstract (arXiv)
Vision transformers have demonstrated significant advantages in computer vision tasks due to their ability to capture long-range dependencies and contextual relationships through self-attention. However, existing position encoding techniques, which are largely borrowed from natural language processing, fail to effectively capture semantic-aware positional relationships between image patches. Traditional approaches like absolute position encoding and relative position encoding primarily focus on 1D linear position relationship, often neglecting the semantic similarity between distant yet contextually related patches. These limitations hinder model generalization, translation equivariance, and the ability to effectively handle repetitive or structured patterns in images. In this paper, we propose 2-Dimensional Semantic-Aware Position Encoding (SaPE2), a novel position encoding method with semantic awareness that dynamically adapts position representations by leveraging local content instead of fixed linear position relationship or spatial coordinates. Our method enhances the model's ability to generalize across varying image resolutions and scales, improves translation equivariance, and better aggregates features for visually similar but spatially distant patches. By integrating SaPE2 into vision transformers, we bridge the gap between position encoding and perceptual similarity, thereby improving performance on computer vision tasks.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 27 of its 27 references that are in the map. First posted on arXiv 14 May 2025.
Builds on
27 of 27 references.
References · 27
- 2017Attention Is All You Needcited by 60,361
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2020End-to-End Object Detection with Transformerscited by 7,414
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2020Deformable DETR: Deformable Transformers for End-to-End Object Detectioncited by 3,422
- 2021SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformerscited by 2,940
- 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,962
- 2020Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformerscited by 1,369
- 2018Self-Attention with Relative Position Representationscited by 1,120
15 more
- 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,101
- 2021CvT: Introducing Convolutions to Vision Transformerscited by 947
- 2021Segmenter: Transformer for Semantic Segmentationcited by 855
- 2022Exploring Plain Vision Transformer Backbones for Object Detectioncited by 724
- 2022Vision Transformer Adapter for Dense Predictionscited by 565
- 2017Convolutional Sequence to Sequence Learningcited by 552
- 2015An Introduction to Convolutional Neural Networkscited by 514
- 2020A Survey of Convolutional Neural Networks: Analysis, Applications, and Prospectscited by 397
- 2021Rethinking Spatial Dimensions of Vision Transformerscited by 361
- 2021Incorporating Convolution Designs into Visual Transformerscited by 248
- 2024Rotary Position Embedding for Vision Transformercited by 236
- 2021Rethinking and Improving Relative Position Encoding for Vision Transformercited by 207
- 2021Fast Convergence of DETR with Spatially Modulated Co-Attentioncited by 176
- 2020End-to-End Object Detection with Adaptive Clustering Transformercited by 109
- 2024Contextual Position Encoding: Learning to Count What's Importantcited by 54
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.