English

Rotary Position Embedding for Vision Transformer

Computer Vision and Pattern Recognition 2024-07-17 v2 Machine Learning

Abstract

Rotary Position Embedding (RoPE) performs remarkably on language models, especially for length extrapolation of Transformers. However, the impacts of RoPE on computer vision domains have been underexplored, even though RoPE appears capable of enhancing Vision Transformer (ViT) performance in a way similar to the language domain. This study provides a comprehensive analysis of RoPE when applied to ViTs, utilizing practical implementations of RoPE for 2D vision data. The analysis reveals that RoPE demonstrates impressive extrapolation performance, i.e., maintaining precision while increasing image resolution at inference. It eventually leads to performance improvement for ImageNet-1k, COCO detection, and ADE-20k segmentation. We believe this study provides thorough guidelines to apply RoPE into ViT, promising improved backbone performance with minimal extra computational overhead. Our code and pre-trained models are available at https://github.com/naver-ai/rope-vit

Keywords

Cite

@article{arxiv.2403.13298,
  title  = {Rotary Position Embedding for Vision Transformer},
  author = {Byeongho Heo and Song Park and Dongyoon Han and Sangdoo Yun},
  journal= {arXiv preprint arXiv:2403.13298},
  year   = {2024}
}

Comments

Accepted to ECCV 2024

R2 v1 2026-06-28T15:26:50.025Z