Rotary Position Encodings for Graphs
Isaac Reid, Arijit Sehanobish, Cederik Höfs, Bruno Mlodozeniec, Leonhard Vulpius, Federico Barbero, Adrian Weller, Krzysztof Choromanski, Richard E Turner, Petar Veličković
Abstract
We study the extent to which rotary position encodings (RoPE), a recent transformer position encoding algorithm broadly adopted in large language models (LLMs) and vision transform ers (ViTs), can be applied to graphstructured data. We find that rotating tokens depending on the spectrum of the graph Laplacian efficiently injects structural information into the attention mechanism, boosting performance in synthetic and realworld graph learning tasks. This ap proach, coined Wave-Induced Rotary Encodings (WIRE), enjoys intriguing theoretical properties: it recovers regular RoPE on grids, and depends asymptotically on the graph effective resistance. Unlike biasbased relative position encodings, WIRE is compatible with linear attention. 1 For legibility, we generally suppress the dependence of RoPE(𝒓 𝑖 ) on 𝝎 𝑛 𝑑/2 𝑛=1 , leaving it implicit. 2 Given this property, some researchers taxonomise RoPE as a type of relative position encoding (RPE). However, we prefer to distinguish it as a separate class of PE, since PEs based on other high dimensional rotations in SO(𝑑) are not necessarily translationally invariant (Schenck et al., 2025) .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers1
Ask how each one uses itBuilds on17
- Open Graph Benchmark: Datasets for Machine Learning on GraphsWeihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong et al.NeurIPS 2020 · 3,935 citations
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
- Do Transformers Really Perform Badly for Graph Representation?Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng et al.NeurIPS 2021 · 1,632 citations
- Recipe for a General, Powerful, Scalable Graph TransformerLadislav Rampásek, Michael Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu et al.NeurIPS 2022 · 1,216 citations
Related papers
- Round and Round We Go! What makes Rotary Positional Encodings useful?Federico Barbero, Alex Vitvitskyi, Christos Perivolaropoulos, Razvan Pascanu et al.ICLR 2025
- PaTH Attention: Position Encoding via Accumulating Householder TransformationsSonglin Yang, Yikang Shen, Kaiyue Wen, Shawn Tan et al.NeurIPS 2025 · 36 citations
- LieRE: Lie Rotational Positional EncodingsSophie Ostmeier, Brian Axelrod, Maya Varma, Michael E. Moseley et al.ICML 2025
- Spiral RoPE: Rotate Your Rotary Positional Embeddings in the 2D PlaneHaoyu Liu, Sucheng Ren, Tingyu Zhu, Peng Wang et al.ICML 2026
- Deconstructing Positional Information: From Attention Logits to Training BiasesZihan Gu, Ruoyu Chen, Han Zhang, Hua Zhang et al.ICLR 2026 · 4 citations
