Conformal Inductive Graph Neural Networks

Soroush H. Zargarbashi, Aleksandar Bojchevski

Abstract

Conformal prediction (CP) transforms any model's output into prediction sets guaranteed to include (cover) the true label. CP requires exchangeability, a relaxation of the i.i.d. assumption, to obtain a valid distribution-free coverage guarantee. This makes it directly applicable to transductive node-classification. However, conventional CP cannot be applied in inductive settings due to the implicit shift in the (calibration) scores caused by message passing with the new nodes. We fix this issue for both cases of node and edge-exchangeable graphs, recovering the standard coverage guarantee without sacrificing statistical efficiency. We further prove that the guarantee holds independently of the prediction time, e.g. upon arrival of a new node/edge or at any subsequent moment.

Introduction

In high-stakes applications of Graph Neural Networks (GNNs), such as fraud detection or medical diagnosis, understanding the uncertainty of a model's prediction is as critical as the prediction itself. Conformal Prediction (CP) has emerged as a powerful framework for this purpose, providing "prediction sets" that are mathematically guaranteed to contain the ground truth with a user-defined probability (e.g., 90%).

While CP works seamlessly in static, transductive settings where the graph structure is fixed, it encounters significant theoretical hurdles in inductive settings. In the real world, graphs are dynamic—new nodes and edges arrive over time. This paper addresses the fundamental breakdown of CP in these evolving environments and proposes a robust solution for inductive graph learning.

The Challenge: Implicit Distribution Shift

The core requirement for Conformal Prediction is exchangeability, the assumption that the training, calibration, and test data points are interchangeable. In a GNN, nodes are not independent; they influence one another through message passing.

When a new node is introduced to an existing graph, the GNN updates the embeddings of its neighbors to incorporate this new information. This update changes the model's output for existing nodes. Consequently, the "conformity scores" calculated during the calibration phase are no longer representative of the scores in the updated graph. This "implicit distribution shift" violates the exchangeability assumption, causing standard CP to lose its coverage guarantees. Previous attempts to solve this, such as the NAPS method, often fail in sparse graphs, leaving many nodes without any valid prediction sets.

Proposed Frameworks: NodeEx and EdgeEx CP

The authors introduce two novel frameworks designed to restore exchangeability by accounting for the structural evolution of the graph.

1. Node-Exchangeable (NodeEx) CP

For graphs where nodes are assumed to be exchangeable (i.e., any node is equally likely to appear at any position in the sequence), the authors demonstrate that the distribution shift caused by message passing is symmetric. By recomputing the conformity scores for the entire available subgraph at each timestep, the NodeEx CP framework ensures that the calibration and test scores remain exchangeable, thereby restoring the mathematical coverage guarantee.

2. Edge-Exchangeable (EdgeEx) CP

Real-world graphs are often sparse, and the node-exchangeability assumption can sometimes lead to unrealistically dense theoretical models. To address this, the authors extend their framework to edge-exchangeable sequences. They employ Weighted Conformal Prediction, where nodes are assigned weights based on the inverse of their degree ($1/deg(v)$). This weighting scheme compensates for the fact that a node's probability of appearing in the graph is often tied to its connectivity, allowing for valid guarantees even in sparse networks.

One of the most significant theoretical contributions is the proof that these guarantees are "any-time valid." The coverage holds regardless of whether a prediction is made the moment a node arrives or at any point in the future as the graph continues to grow.

Experimental Evaluation

The researchers evaluated NodeEx and EdgeEx CP across nine diverse datasets, including citation networks (CoraML, CiteSeer, PubMed), co-author networks (CS, Physics), co-purchase graphs (Amazon Photos, Computers), and large-scale graphs (Flickr, Reddit2). These were tested against various GNN architectures, including GCN, GAT, and APPNP.

Key Results

  • Stable Coverage: While "Naive CP" (standard CP applied to inductive graphs) showed significant fluctuations in coverage, NodeEx and EdgeEx CP consistently maintained coverage levels near the target 90%. In empirical tests, the proposed methods typically deviated from the target by less than 1%, whereas Naive CP deviated by as much as 7%.
  • Efficiency and Precision: The proposed methods produced smaller, more precise prediction sets compared to baselines. They also achieved a higher "singleton hit ratio," meaning the correct label was more frequently the only label in the prediction set.
  • Superiority in Sparsity: Unlike the NAPS baseline, which failed to provide predictions for up to 70% of nodes in sparse graphs, the proposed methods provided valid prediction sets for 100% of the nodes.

Limitations and Future Outlook

While the proposed methods provide a rigorous solution for inductive GNNs, some challenges remain:

  • Computational Cost: Recomputing scores as the graph grows increases overhead. Future work may focus on parallelization or more efficient update rules.
  • Marginal vs. Conditional Coverage: The current guarantee is marginal (average coverage across the dataset). Achieving conditional coverage (guarantees for specific nodes or classes) remains an open area of research.
  • Adversarial Timing: The framework assumes that the timing of the prediction is not chosen by an adversary who might "cherry-pick" moments when the prediction sets are less reliable.

Conclusion

By identifying and correcting the implicit distribution shift caused by message passing, NodeEx and EdgeEx CP provide the first rigorous framework for uncertainty quantification in inductive GNNs. This work bridges the gap between theoretical conformal prediction and the practical realities of dynamic, evolving networks.

Summary updated

BibTeX
@inproceedings{zargarbashi2024conformal,
  author = {Soroush H. Zargarbashi and Aleksandar Bojchevski},
  title = {{Conformal Inductive Graph Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=homn1jOKI5},
}
Figure