Graph Positional and Structural Encoder
Semih Cantürk, Renming Liu, Olivier Lapointe-Gagné, Vincent Létourneau, Guy Wolf, Dominique Beaini, Ladislav Rampášek
TL;DR
The paper tackles the lack of a universal, task-agnostic positional and structural encoding (PSE) for graphs by introducing GPSE, a foundation encoder trained to reconstruct a diverse set of PSEs from graph structure alone. GPSE uses a deep MPNN with random node features, residual gating, and a virtual node to learn a common latent representation that can augment any graph neural model, including graph Transformers, across distributions and modalities. It demonstrates strong PSE recovery (up to $R^2\approx$0.998) and delivers state-of-the-art or competitive improvements on molecular benchmarks (e.g., ZINC, PCQM4Mv2, MolHIV, MolPCBA) as well as robust transferability to non-molecular domains and OOD scenarios. The work argues that GPSE provides a scalable alternative to hand-crafted PSEs and SSL pre-training, enabling more powerful, generalizable encodings that can underpin future foundation models for graph learning, with public code and PyG integration to ease adoption.
Abstract
Positional and structural encodings (PSE) enable better identifiability of nodes within a graph, rendering them essential tools for empowering modern GNNs, and in particular graph Transformers. However, designing PSEs that work optimally for all graph prediction tasks is a challenging and unsolved problem. Here, we present the Graph Positional and Structural Encoder (GPSE), the first-ever graph encoder designed to capture rich PSE representations for augmenting any GNN. GPSE learns an efficient common latent representation for multiple PSEs, and is highly transferable: The encoder trained on a particular graph dataset can be used effectively on datasets drawn from markedly different distributions and modalities. We show that across a wide range of benchmarks, GPSE-enhanced models can significantly outperform those that employ explicitly computed PSEs, and at least match their performance in others. Our results pave the way for the development of foundational pre-trained graph encoders for extracting positional and structural information, and highlight their potential as a more powerful and efficient alternative to explicitly computed PSEs and existing self-supervised pre-training approaches. Our framework and pre-trained models are publicly available at https://github.com/G-Taxonomy-Workgroup/GPSE. For convenience, GPSE has also been integrated into the PyG library to facilitate downstream applications.
