Abstract
State-of-the-art link prediction (LP) models demonstrate impressive benchmark results. However, popular benchmark datasets often assume that training, validation, and testing samples are representative of the overall dataset distribution. In real-world situations, this assumption is often incorrect; uncontrolled factors lead new dataset samples to come from a different distribution than training samples. Additionally, the majority of recent work with graph dataset shift focuses on node- and graph-level tasks, largely ignoring link-level tasks. To bridge this gap, we introduce a novel splitting strategy, known as LPShift, which utilizes structural properties to induce a controlled distribution shift. We verify LPShift's effect through empirical evaluation of SOTA LP models on 16 LPShift variants of original dataset splits, with results indicating drastic changes to model performance. Additional experiments demonstrate graph structure has a strong influence on the success of current generalization methods.
Source Code: https://github.com/revolins/LPShift
Introduction
Link prediction (LP)—the task of predicting whether a connection exists between two entities in a network—is a cornerstone of modern graph machine learning, powering applications from social recommendation to drug-protein interaction discovery. While Graph Neural Networks (GNNs) have pushed the state-of-the-art in this field, they are typically evaluated under the "i.i.d. assumption," where training and testing data are assumed to be drawn from the same distribution.
In real-world scenarios, this assumption is frequently violated. Structural properties of graphs, such as local density or connectivity patterns, often change over time or vary across different regions of a network. Despite the importance of this problem, research into distribution shifts on graphs has primarily focused on node- and graph-level tasks, leaving the link-level domain largely unexplored.
The LPShift Framework
To address this gap, we propose LPShift, a novel benchmarking framework designed to test the robustness of link predictors under controlled distribution shifts. Instead of the standard random splitting of links, LPShift categorizes links based on three fundamental structural heuristics:
- Common Neighbors (CN): Measures the local overlap between two nodes (e.g., mutual friends).
- Preferential Attachment (PA): Measures the product of node degrees, capturing the "rich-get-richer" phenomenon.
- Shortest Path (SP): Measures the global distance between nodes in the graph.
By setting specific thresholds on these heuristic scores, LPShift creates two primary shift scenarios:
- Forward Shifts: The model is trained on links with low structural information (e.g., few mutual friends) and tested on links with high structural information.
- Backward Shifts: The model is trained on structurally rich links but must generalize to "harder," structurally sparse links in the test set.
Experimental Evaluation
We applied LPShift to three major Open Graph Benchmark (OGB) datasets—ogbl-ppa, ogbl-ddi, and ogbl-collab—and utilized synthetic Holme-Kim (HK) graphs for controlled theoretical verification. Our evaluation integrated the HeaRT setting, which employs realistic negative sampling to ensure that models are not simply identifying "obviously impossible" links.
Key Insights
- Performance Collapse: Quantitative results show a significant vulnerability in current models. On the
ppaandddidatasets, most state-of-the-art models experienced an average Mean Reciprocal Rank (MRR) drop of 60% to 90% when subjected to structural shifts. - GNNs as Heuristic Learners: Our findings suggest that modern link predictors essentially learn to approximate structural heuristics. When the distribution of these heuristics changes, the models lose their "compass," leading to the observed performance degradation.
- The "Backward" Trap: Models struggle most in "Backward" scenarios. If a model learns during training that links typically have many common neighbors, it fails significantly when asked to predict links in a test set where common neighbors are absent.
- Feature-Rich Resilience: Interestingly, the
ogbl-collabdataset showed relative resilience, and even performance gains, under certain shifts. This suggests that rich node features can provide a "safety net," allowing models to rely on covariate information when structural cues become unreliable. - Inconsistency of Generalization Methods: Traditional Out-of-Distribution (OOD) methods like Invariant Risk Minimization (IRM) and graph-specific techniques like DropEdge often failed to provide consistent improvements, sometimes even decreasing performance in Forward shift scenarios.
Conclusion
The introduction of LPShift highlights a critical blind spot in current link prediction research. The extreme sensitivity of state-of-the-art GNNs to structural distribution shifts suggests that the field must move beyond random splits toward more robust, "shift-aware" evaluation and model design. Future work should explore targeted graph data augmentation and hybrid heuristic modeling to better prepare predictors for the complexities of real-world, dynamic networks.
Summary updated