Explaining and Adapting Graph Conditional Shift

Qi Zhu, Yizhu Jiao, Natalia Ponomareva, Jiawei Han, Bryan PerozziarXiv 2023 · DOI

Abstract

Graph Neural Networks (GNNs) are known to be fragile when data distributions change between training and testing. This paper theoretically demonstrates that graph convolutions amplify these shifts, particularly in heterophilous graphs. We introduce GCONDA, a novel adaptation method that aligns conditional distributions using Optimal Transport, making GNNs significantly more robust to such distribution changes.

Introduction

Machine learning models often fail when "source" training data differs from "target" inference data. While covariate shift is well-studied, GNNs are uniquely vulnerable to conditional shift, where the relationship between features and labels changes across domains. This paper provides a theoretical diagnosis of why GNNs are more susceptible than standard neural networks and proposes a practical solution.

Theoretical Diagnosis: Why GNNs Fail

Using the Contextual Stochastic Block Model (CSBM), the authors prove that graph convolutions act as an amplifier for distribution shift. A standard GCN layer introduces an amplification factor of $\sqrt{D}$ (where $D$ is the average degree) that multiplies the magnitude of feature shifts.

Conceptual diagrams of structure and feature shifts alongside empirical evidence of error amplification in GNNs compared to MLPs.

As illustrated in the figures above, as shift parameters like $q/p$ or $\delta$ increase, the test error for 1-layer and 2-layer GCNs rises significantly faster than for a standard MLP. This confirms that the neighborhood aggregation process "smears" the distribution shift, making it harder for the classifier to maintain accuracy.

GCONDA: Aligning Conditional Distributions

To mitigate this, the authors propose GCONDA (Graph Conditional Shift Adaptation). Unlike standard Domain Invariant Representation Learning (DIRL) which aligns marginal feature distributions, GCONDA focuses on the labels:

  • Optimal Transport: It uses Wasserstein distance to estimate the cost of transforming the source label distribution into the target pseudo-label distribution.
  • Minimization: By adding this distance as a penalty, the model finds representations where the conditional relationship $P(y|h)$ is consistent across domains.
  • GCONDA++: An enhanced version that aligns both conditional and marginal distributions.

Experimental Results

The approach was evaluated on synthetic benchmarks, citation networks (Cora, Citeseer, PubMed), and molecular property prediction datasets (Drugood).

  • Synthetic Superiority: GCONDA showed up to a 10% absolute improvement in ROC AUC over baselines like DANN.
  • Real-World Robustness: On Drugood datasets, GCONDA++ consistently achieved top rankings, proving effective in scientific applications like drug discovery.
  • Performance Proxy: A strong negative correlation ($r = -0.98$) was found between the estimated Wasserstein distance and actual model performance, validating the optimization objective.

Conclusion

The very inductive bias that makes GNNs powerful—aggregating neighborhood information—is what makes them fragile under distribution shift. GCONDA addresses this by moving beyond simple feature alignment to align the underlying conditional probabilities. Future work will look into extending these proofs to deeper, non-linear GNN architectures.

Summary updated

BibTeX
@misc{zhu2023explaining,
  author = {Qi Zhu and Yizhu Jiao and Natalia Ponomareva and Jiawei Han and Bryan Perozzi},
  title = {{Explaining and Adapting Graph Conditional Shift}},
  year = {2023},
  eprint = {2306.03256},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.03256},
}
Figure