cs.LGSep 26, 2026

Analytic-Walk Rotary Positional Encodings for Graphs

Authors: Jiaqing Xie, Yuxin Wang, Xipeng Qiu

Organizations: Shanghai Innovation Institute · Fudan University

Abstract

Rotary position encodings make attention sensitive to relative position, but extending them to graphs requires choosing how graph structure enters the rotation. Previous works assign each node a rotation from spectral coordinates, so the rotary factor between two nodes depends only on their endpoints and cannot distinguish the routes connecting them. We introduce Analytic-Walk Rotary Positional Encodings (AW-RoPE), which place the rotations on edges and sum the transported features over all walks, so contributions along different routes can reinforce or cancel. An exact variant evaluates the complete sum by a differentiable linear solve, and a sparse variant truncates it at a finite depth. We prove forward and parameter-derivative truncation bounds at fixed inputs and parameters. Both variants act on projected queries and keys, and the sparse recurrence also augments message-passing networks. Across five synthetic tasks both variants reduce nRMSE by 1515--58%58\% relative to the strongest baseline, and on real superpixel, peptide and OGB benchmarks the sparse recurrence attains the best mean on every dataset with Performer kernels and on twelve of thirteen datasets with GIN. Analysis shows that AW-RoPE can distinguish routes whose only cue is how two endpoints are connected, while node-wise rotary encodings cannot.

Figures & tables

Appendix figures & tables23 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Rotary Position Encodings for Graphs

    Sep 26, 2025Isaac Reid, Arijit Sehanobish, Cederik Höfs +7Graph Positional EncodingRotary Positional Embeddings

  2. Understanding Truncated Positional Encodings for Graph Neural Networks

    Jun 11, 2026James Flora, Mitchell Black, Weng-Keen Wong +1GNN ExpressivityPositional Encoding

  3. RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings

    Sep 28, 2026Jarod Lévy, Mathurin Videau, Jad Yehya +3Rotary Positional EmbeddingsLong-Context Language Modeling