Research
How Vision Transformers Represent Position: A Mechanistic Comparison of Absolute and Rotary Positional Encodings
arXiv:2610.13992v1 Announce Type: new Abstract: Positional embeddings encode the spatial position of each image patch in a Vision Transformer (ViT), allowing the model to distinguish different spatial
arXiv:2610.13992v1 Announce Type: new Abstract: Positional embeddings encode the spatial position of each image patch in a Vision Transformer (ViT), allowing the model to distinguish different spatial arrangements of visual content. However, we know little about how the choice of embedding shapes a vision transformer's internal representation. In this work, we show that Absolute Positional Embeddings (APE) and Rotary Positional Embeddings (RoPE) encode spatial position through different internal mechanisms: APE stores position in explicit features, while RoPE builds it inside attention and rebuilds it when it is withheld. Specifically, in APE models, sparse autoencoders recover causal row- and column-specific features, whereas interventions on RoPE reveal distinct rotary components that separately encode row and column information. Additionally, causal interventions selectively disabling RoPE's row or column rotations show that decodable row and column information can be independently removed and, once rotations are restored, partly reconstructed, in part by axis-specialized attention heads. Both mechanisms are causally important for classification: permuting APE's positional features across patches reduces top-1 accuracy by 24--31 points, and ablating the rotations of RoPE's primary rebuilding head reduces it more than ablating those of any other head. Our findings show that the choice of positional encoding fundamentally changes how spatial information is organized and processed inside Vision Transformers. More broadly, our work demonstrates how mechanistic analysis can reveal how models construct, reconstruct, and maintain structured representations, providing a basis for targeted interventions in vision models.
Related
- Phase-Aligned RoPE for Mixed-Resolution Diffusion Transformer
- Positional Encodings Anchor Spatial Structure in Vision Transformers: A Geometric Perspective on Robustness
- WorldRoPE: Probabilistic World-Centric Rotary Embedding for Multi-View Attention
- Beyond Sinusoids: A Morlet Wavelet Framework for Transformer Positional Encoding
- Efficient Matrix Implementation for Rotary Position Embedding
Source: arXiv cs.CV | 2026-10-14