NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Theory of Link Prediction via Relational Weisfeiler-Leman

Xingyue Huang, Miguel A. Romero Orth, Ismail Ilkan Ceylan, Pablo Barceló · DOI

Introduction

Knowledge Graphs (KGs) are characterized by directed, multi-relational edges. While Graph Neural Networks (GNNs) have revolutionized node-level tasks, their application to link prediction—determining if a relation $q$ exists between nodes $u$ and $v$—has lacked a rigorous theoretical foundation. Standard GNNs, such as Relational Graph Convolutional Networks (RGCNs), typically compute unary node representations that are often insufficient for pairwise tasks. This paper introduces Conditional Message Passing Neural Networks (C-MPNNs), a unified framework that encompasses several state-of-the-art models and explains their empirical success.

The C-MPNN Framework

The authors propose C-MPNNs as a general class of models for link prediction. Unlike standard "Relational MPNNs" (R-MPNNs) that generate a single embedding per node regardless of the query, C-MPNNs compute representations conditioned on a specific source node $u$ and query relation $q$.

Comparison of standard R-MPNN and the proposed C-MPNN architecture. C-MPNNs use a conditional initialization based on the query pair.

As shown in Figure 1, the key distinction lies in the initialization. C-MPNNs use an INIT(u, v, q) function to distinguish the source node from the rest of the graph. This formalizes the "labeling trick," which the authors prove is essential for a model to effectively distinguish target nodes and predict links accurately.

Theoretical Expressivity

To measure the power of these models, the authors introduce the Relational Asymmetric Local 2-WL test ($rawl_2$). They prove that C-MPNNs are exactly as powerful as this test in distinguishing pairs of nodes. Furthermore, they demonstrate a hierarchy of expressive power based on model features, such as the inclusion of inverse relations.

Hierarchy of relational Weisfeiler-Leman tests. The diagram illustrates how different variants (e.g., adding inverse relations denoted by '+') relate to one another via specific propositions.

Figure 3 illustrates the relationships between these tests. For instance, the authors prove that adding "reverse" edges to a KG strictly increases expressive power, moving from $rawl_2$ to $rawl_2^+$. They also show that C-MPNNs can express any query definable in the $rFO^3_{cnt}$ fragment of first-order logic, providing a bridge between deep learning and formal logic.

Key Insights and Results

The researchers evaluated their framework on standard benchmarks (WN18RR, FB15k-237) and large-scale biomedical KGs (Hetionet, ogbl-biokg). Their findings include:

  • Superior Performance: C-MPNNs consistently outperform standard relational GNNs and achieve state-of-the-art results in inductive settings, where the model predicts links on previously unseen nodes.
  • History vs. Expressivity: Surprisingly, whether a model uses its full history of hidden states or just the previous step does not change its theoretical upper bound for expressiveness.
  • Global Readouts: In graphs with many relation types (like Freebase), adding a "global readout" (a summary of the entire graph state) significantly boosts performance, whereas it matters less for sparse graphs like WordNet.

Conclusion

This work provides the first comprehensive theoretical framework for link prediction on KGs. By unifying existing models under the C-MPNN umbrella and linking them to the Weisfeiler-Leman hierarchy, the authors provide both a roadmap for future architecture design and a rigorous way to evaluate model limits. Future directions include extending the theory to "hyper-relations" involving three or more entities and exploring temporal knowledge graphs.

Summary updated

BibTeX
@inproceedings{huang2023theory,
  author = {Xingyue Huang and Miguel A. Romero Orth and Ismail Ilkan Ceylan and Pablo Barceló},
  title = {{A Theory of Link Prediction via Relational Weisfeiler-Leman}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=7hLlZNrkt5},
}
Figure