Towards Understanding Link Predictor Generalizability Under Distribution Shifts

Jay Revolinsky, Harry Shomer, Jiliang Tang

Abstract

Link prediction (LP) models are traditionally evaluated under the assumption that training and test data are independent and identically distributed (i.i.d.). However, real-world graphs are dynamic, and structural patterns often shift over time or across domains. This paper introduces LPShift, a comprehensive framework designed to evaluate link predictor generalizability under controlled structural distribution shifts. By partitioning datasets based on fundamental graph heuristics—Common Neighbors, Preferential Attachment, and Shortest Path—the authors demonstrate that state-of-the-art models are remarkably fragile, often experiencing performance collapses of over 80% when faced with out-of-distribution structural patterns.

Introduction

In the domain of Link Prediction (LP), the goal is to predict the existence of edges between node pairs. Most existing research operates under the "i.i.d. assumption," where the training, validation, and test sets are drawn from the same underlying distribution. In practice, this assumption rarely holds. A model trained on a dense social network may fail on a sparse one, and a recommender system may struggle as user-item interaction patterns evolve.

While distribution shifts have been extensively studied for node and graph classification, a significant gap exists for link-level tasks. This paper addresses this gap by providing the first standard benchmark and foundational study for distribution shifts specifically tailored to Link Prediction.

The LPShift Framework

The authors propose LPShift, a strategy to induce controlled distribution shifts by splitting datasets based on three fundamental graph heuristics that capture different levels of structural information:

  1. Common Neighbors (CN): Measures local structural overlap (e.g., mutual friends).
  2. Preferential Attachment (PA): Captures scale-free properties and the tendency of high-degree nodes to form new links.
  3. Shortest Path (SP): Captures global structural distance between nodes.
Illustrations of the three graph heuristics (CN, PA, and SP) used to induce distribution shifts in the LPShift framework.

By applying thresholds to these scores, the framework creates "Forward" splits (where the test set contains more structural information than the training set) and "Backward" splits (where the test set contains less). To ensure a rigorous evaluation, LPShift integrates with the HeaRT (Heuristic-aware Ranking Task) protocol, which utilizes "hard" negative samples to prevent models from relying on trivial heuristic differences to achieve high scores.

Experimental Setup and Datasets

The LPShift framework was applied to three major Open Graph Benchmark (OGB) datasets, representing diverse domains:

  • ogbl-ppa: A protein-protein interaction network.
  • ogbl-ddi: A drug-drug interaction network.
  • ogbl-collab: A citation network.

From these datasets, the authors generated 48 unique shifted scenarios (16 variants per dataset) to rigorously test the limits of current Graph Neural Network (GNN) architectures designed for LP, such as SEAL, BUDDY, NCNC, and LPFormer.

Key Insights into Model Fragility

The study reveals several critical vulnerabilities in current link prediction models:

1. Structural Fragility

Most "GNN4LP" models rely heavily on the specific structural distributions encountered during training. When these distributions shift, performance does not merely degrade; it often collapses. For example, on the ogbl-ppa and ogbl-ddi datasets, most models saw an average Mean Reciprocal Rank (MRR) drop of 60% to 90% compared to their i.i.d. baselines.

2. The "Backward" Challenge

Models struggle most significantly on "Backward" splits. If a model is trained on links with many common neighbors but tested on links with few or none, it loses its primary predictive signal. This suggests that current models have not truly learned the underlying logic of link formation beyond simple, observable heuristics.

3. Inconsistency of Generalization Methods

Standard Out-of-Distribution (OOD) techniques, such as Invariant Risk Minimization (IRM) and GroupDRO—which are effective in computer vision—showed inconsistent results in graph link prediction. In some cases, these methods even hindered performance, indicating that the pairwise nature of LP requires specialized invariant learning approaches.

Conclusion and Future Work

The findings of this paper serve as a wake-up call for the graph machine learning community. The extreme sensitivity of SOTA models to structural shifts suggests that current link predictors are overfitted to specific graph topologies.

Future research should focus on developing targeted graph data augmentation strategies and new invariant learning methods specifically designed for the pairwise dependencies inherent in link prediction. Additionally, extending the LPShift framework to account for temporal shifts and size-based generalization remains a critical next step for building robust, real-world link prediction systems.

Summary updated

BibTeX
@inproceedings{revolinsky2025towards,
  author = {Jay Revolinsky and Harry Shomer and Jiliang Tang},
  title = {{Towards Understanding Link Predictor Generalizability Under Distribution Shifts}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2025},
  doi = {10.1145/3711896.3737434},
}
Figure