Learning Efficient Positional Encodings with Graph Neural Networks
Charilaos I. Kanatsoulis, Evelyn Choi, Stephanie Jegelka, Jure Leskovec, Alejandro Ribeiro
TL;DR
PEARL introduces learnable, graph-based positional encodings (PEs) that are generated by GNNs and aggregated to yield permutation-equivariant node representations. By treating GNNs as nonlinear mappings of graph spectral components and introducing random (R-PEARL) or basis (B-PEARL) node attributes, the framework achieves high expressivity and stability with linear or near-linear scaling, addressing the four key PE criteria: expressive power, stability, scalability, and genericness. The authors provide rigorous sample complexity and stability analyses, linking PEARL to existing eigenvector-based encodings while offering substantial reductions in computational cost. Empirical results across graph classification, molecular regression, OOD drug datasets, and large RelBench tasks demonstrate that PEARL variants outperform lightweight eigenvector-based methods and rival full eigenvector encodings in performance, with markedly improved efficiency. The work advances practical graph representation learning by enabling powerful, scalable PEs that generalize across graph sizes and domains.
Abstract
Positional encodings (PEs) are essential for effective graph representation learning because they provide position awareness in inherently position-agnostic transformer architectures and increase the expressive capacity of Graph Neural Networks (GNNs). However, designing powerful and efficient PEs for graphs poses significant challenges due to the absence of canonical node ordering and the scale of the graph. {In this work, we identify four key properties that graph PEs should satisfy}: stability, expressive power, scalability, and genericness. We find that existing eigenvector-based PE methods often fall short of jointly satisfying these criteria. To address this gap, we introduce PEARL, a novel framework of learnable PEs for graphs. Our primary insight is that message-passing GNNs function as nonlinear mappings of eigenvectors, enabling the design of GNN architectures for generating powerful and efficient PEs. A crucial challenge lies in initializing node attributes in a manner that is both expressive and permutation equivariant. We tackle this by initializing GNNs with random node inputs or standard basis vectors, thereby unlocking the expressive power of message-passing operations, while employing statistical pooling functions to maintain permutation equivariance. Our analysis demonstrates that PEARL approximates equivariant functions of eigenvectors with linear complexity, while rigorously establishing its stability and high expressive power. Experimental evaluations show that PEARL outperforms lightweight versions of eigenvector-based PEs and achieves comparable performance to full eigenvector-based PEs, but with one or two orders of magnitude lower complexity. Our code is available at https://github.com/ehejin/Pearl-PE.
