arXiv:2602.03227cs.CV2026-02被引 6

让视觉模型学会识别斜向空间关系,提升图像理解能力

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

  • 将位置编码按方向分组并旋转,支持多角度位置建模
  • 在分类、分割、生成任务上均显著提升性能
  • 适合需要精细空间感知的视觉任务,如医学图像分析

旋转位置编码(RoPE)因能编码相对位置并支持长度外推,已成为大语言模型的主流位置编码方式。当应用于视觉变换器时,标准的轴向2D RoPE将二维空间位置分解为水平和垂直分量,隐式限制了位置编码仅沿轴对齐方向。我们发现这一方向约束是标准轴向2D RoPE的根本局限,阻碍了自然图像中固有的斜向空间关系建模。为此,我们提出Spiral RoPE,一种简单而有效的扩展方法:将嵌入通道划分为多个与均匀分布方向关联的组,每组根据补丁位置在对应方向上的投影进行旋转,从而实现超越水平和垂直轴的空间关系编码。在广泛的视觉任务(包括分类、分割和生成)中,Spiral RoPE持续提升性能。注意力图的定性分析进一步表明,Spiral RoPE在语义相关物体上激活更集中,且更好遵循局部物体边界,凸显了多方向位置编码在视觉变换器中的重要性。

原文摘要 · Abstract (English)

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.

视觉变换器位置编码多方向建模

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。