Rotary Position Encodings for Graphs

Isaac Reid, Arijit Sehanobish, Cederik Höfs, Bruno Kacper Mlodozeniec, Leonhard Vulpius, Federico Barbero, Adrian Weller, Krzysztof Marcin Choromanski, Richard E Turner, Petar Veličković
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:104273-104290, 2026.

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 transformers (ViTs), can be applied to graph-structured 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 real-world graph learning tasks. This approach, coined Wave-Induced Rotary Encodings (WIRE), enjoys intriguing theoretical properties: it recovers regular RoPE on grids, and depends on the graph effective resistance. Unlike bias-based relative position encodings, WIRE is compatible with linear attention.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-reid26a, title = {Rotary Position Encodings for Graphs}, author = {Reid, Isaac and Sehanobish, Arijit and H\"{o}fs, Cederik and Mlodozeniec, Bruno Kacper and Vulpius, Leonhard and Barbero, Federico and Weller, Adrian and Choromanski, Krzysztof Marcin and Turner, Richard E and Veli\v{c}kovi\'{c}, Petar}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {104273--104290}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/reid26a/reid26a.pdf}, url = {https://proceedings.mlr.press/v306/reid26a.html}, 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 transformers (ViTs), can be applied to graph-structured 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 real-world graph learning tasks. This approach, coined Wave-Induced Rotary Encodings (WIRE), enjoys intriguing theoretical properties: it recovers regular RoPE on grids, and depends on the graph effective resistance. Unlike bias-based relative position encodings, WIRE is compatible with linear attention.} }
Endnote
%0 Conference Paper %T Rotary Position Encodings for Graphs %A Isaac Reid %A Arijit Sehanobish %A Cederik Höfs %A Bruno Kacper Mlodozeniec %A Leonhard Vulpius %A Federico Barbero %A Adrian Weller %A Krzysztof Marcin Choromanski %A Richard E Turner %A Petar Veličković %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-reid26a %I PMLR %P 104273--104290 %U https://proceedings.mlr.press/v306/reid26a.html %V 306 %X 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 transformers (ViTs), can be applied to graph-structured 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 real-world graph learning tasks. This approach, coined Wave-Induced Rotary Encodings (WIRE), enjoys intriguing theoretical properties: it recovers regular RoPE on grids, and depends on the graph effective resistance. Unlike bias-based relative position encodings, WIRE is compatible with linear attention.
APA
Reid, I., Sehanobish, A., Höfs, C., Mlodozeniec, B.K., Vulpius, L., Barbero, F., Weller, A., Choromanski, K.M., Turner, R.E. & Veličković, P.. (2026). Rotary Position Encodings for Graphs. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:104273-104290 Available from https://proceedings.mlr.press/v306/reid26a.html.

Related Material