Abstract
Message-passing graph neural networks (MPNNs) have emerged as a powerful paradigm for graph-based machine learning. Despite their effectiveness, MPNNs face challenges such as under-reaching and over-squashing, where limited receptive fields and structural bottlenecks hinder information flow in the graph. While graph transformers hold promise in addressing these issues, their scalability is limited due to quadratic complexity regarding the number of nodes, rendering them impractical for larger graphs. Here, we propose implicitly rewired message-passing neural networks (IPR-MPNNs), a novel approach that integrates implicit probabilistic graph rewiring into MPNNs. By introducing a small number of virtual nodes, i.e., adding additional nodes to a given graph and connecting them to existing nodes, in a differentiable, end-to-end manner, IPR-MPNNs enable long-distance message propagation, circumventing quadratic complexity. Theoretically, we demonstrate that IPR-MPNNs surpass the expressiveness of traditional MPNNs. Empirically, we validate our approach by showcasing its ability to mitigate under-reaching and over-squashing effects, achieving state-of-the-art performance across multiple graph datasets. Notably, IPR-MPNNs outperform graph transformers while maintaining significantly faster computational efficiency.
Introduction
Standard Message-Passing Neural Networks (MPNNs) are the workhorses of graph machine learning, but they suffer from two significant spatial limitations: under-reaching and over-squashing. Under-reaching occurs because nodes can only communicate with immediate neighbors, requiring many layers to bridge long distances. Over-squashing happens when information from a large receptive field is compressed into fixed-size vectors, creating a bottleneck where crucial structural details are lost.
While Graph Transformers (GTs) address these issues by allowing all-to-all communication, their $O(n^2)$ quadratic complexity makes them prohibitively expensive for large graphs. This paper introduces Implicitly Rewired MPNNs (IPR-MPNNs), which solve the long-distance communication problem by learning to connect nodes to a small set of trainable "virtual hubs," matching Transformer performance with linear scalability.
Methods: Implicitly Rewired MPNNs
The IPR-MPNN architecture introduces a small number ($m$) of virtual nodes that act as communication hubs. The process is divided into three differentiable stages:
- Upstream Model: A small MPNN processes the input graph to learn "priors"—scores that determine which original nodes should connect to which virtual nodes.
- Differentiable Sampling: Using exactly-k sampling, the model selects $k$ virtual nodes for each original node. This step is end-to-end differentiable, allowing the network to optimize its own "wiring" strategy during training.
- Downstream Model: The main engine performs message passing where original nodes send info to virtual nodes, virtual nodes (fully connected to each other) exchange global context, and then broadcast this context back to the original nodes.
Because the number of virtual nodes is small ($m \ll n$), the complexity remains roughly linear, avoiding the quadratic bottleneck of Transformers.
Experimental Evaluation
The authors evaluated IPR-MPNNs across diverse benchmarks, including molecular property prediction (QM9, ZINC, OGBG-MOLHIV) and long-range interaction tasks (PEPTIDES, PCQM-CONTACT).
Key Results
- Performance: IPR-MPNN achieved state-of-the-art (SOTA) results on the Long-Range Graph Benchmark (Peptides and PCQM) and dominated the QM9 dataset, reaching the best results on 12 out of 13 target properties.
- Efficiency: On the Peptides dataset, a Graph Transformer (GPS) required 22.2 GB of memory, whereas IPR-MPNN achieved superior results using only 1.9 GB. On ZINC, it was approximately 2x faster per training epoch than GPS.
- Expressivity: Theoretically, IPR-MPNNs are proven to be more expressive than the standard 1-Weisfeiler-Leman (1-WL) test.
Discussion and Future Work
IPR-MPNNs represent a significant step toward scalable, long-range graph learning. By replacing the dense attention of Transformers with learned, sparse virtual node connections, the model maintains high "layer-wise sensitivity" without the memory explosion associated with quadratic complexity.
Current limitations include the assumption that $m \ll n$; if a task requires a high number of virtual nodes, efficiency gains diminish. Future work will explore applying this architecture to node-level tasks and investigating more sophisticated initialization strategies for virtual node features to further boost performance.
Summary updated