Spiral RoPE: Rotate Your Rotary Positional Embeddings in the 2D Plane

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Liu, Haoyu, Ren, Sucheng, Zhu, Tingyu, Wang, Peng, Xie, Cihang, Yuille, Alan, Zheng, Zeyu, Wang, Feng
Formato: Preprint
Publicado: 2026
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866914303963037696
author Liu, Haoyu
Ren, Sucheng
Zhu, Tingyu
Wang, Peng
Xie, Cihang
Yuille, Alan
Zheng, Zeyu
Wang, Feng
author_facet Liu, Haoyu
Ren, Sucheng
Zhu, Tingyu
Wang, Peng
Xie, Cihang
Yuille, Alan
Zheng, Zeyu
Wang, Feng
contents Rotary Position Embedding (RoPE) is the de facto positional encoding in large language models due to its ability to encode relative positions and support length extrapolation. When adapted to vision transformers, the standard axial formulation decomposes two-dimensional spatial positions into horizontal and vertical components, implicitly restricting positional encoding to axis-aligned directions. We identify this directional constraint as a fundamental limitation of the standard axial 2D RoPE, which hinders the modeling of oblique spatial relationships that naturally exist in natural images. To overcome this limitation, we propose Spiral RoPE, a simple yet effective extension that enables multi-directional positional encoding by partitioning embedding channels into multiple groups associated with uniformly distributed directions. Each group is rotated according to the projection of the patch position onto its corresponding direction, allowing spatial relationships to be encoded beyond the horizontal and vertical axes. Across a wide range of vision tasks including classification, segmentation, and generation, Spiral RoPE consistently improves performance. Qualitative analysis of attention maps further show that Spiral RoPE exhibits more concentrated activations on semantically relevant objects and better respects local object boundaries, highlighting the importance of multi-directional positional encoding in vision transformers.
format Preprint
id arxiv_https___arxiv_org_abs_2602_03227
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Spiral RoPE: Rotate Your Rotary Positional Embeddings in the 2D Plane
Liu, Haoyu
Ren, Sucheng
Zhu, Tingyu
Wang, Peng
Xie, Cihang
Yuille, Alan
Zheng, Zeyu
Wang, Feng
Computer Vision and Pattern Recognition
Rotary Position Embedding (RoPE) is the de facto positional encoding in large language models due to its ability to encode relative positions and support length extrapolation. When adapted to vision transformers, the standard axial formulation decomposes two-dimensional spatial positions into horizontal and vertical components, implicitly restricting positional encoding to axis-aligned directions. We identify this directional constraint as a fundamental limitation of the standard axial 2D RoPE, which hinders the modeling of oblique spatial relationships that naturally exist in natural images. To overcome this limitation, we propose Spiral RoPE, a simple yet effective extension that enables multi-directional positional encoding by partitioning embedding channels into multiple groups associated with uniformly distributed directions. Each group is rotated according to the projection of the patch position onto its corresponding direction, allowing spatial relationships to be encoded beyond the horizontal and vertical axes. Across a wide range of vision tasks including classification, segmentation, and generation, Spiral RoPE consistently improves performance. Qualitative analysis of attention maps further show that Spiral RoPE exhibits more concentrated activations on semantically relevant objects and better respects local object boundaries, highlighting the importance of multi-directional positional encoding in vision transformers.
title Spiral RoPE: Rotate Your Rotary Positional Embeddings in the 2D Plane
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2602.03227