Analytic-Walk Rotary Positional Encodings for Graphs
cs.LG
Submitted: 2026-09-26
Updated: 2026-09-26
Code: https://github.com/jiaqingxie/AW-RoPE
License: http://creativecommons.org/licenses/by/4.0/
The gist: Rotary position encodings make attention sensitive to relative position, but extending them to graphs requires choosing how graph structure enters the rotation.
Terminology
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 15 -- 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.
Sources
- A Generalization of Transformer Networks to Graphs
- RoFormer: Enhanced Transformer with Rotary Position Embedding
- Rotary Position Encodings for Graphs
- Vector Diffusion Maps and the Connection Laplacian
- Polynomial Neural Sheaf Diffusion: A Spectral Filtering Approach on Cellular Sheaves
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks