Mitigating Graph Covariate Shift via Score-based Out-of-distribution Augmentation

Bohan Wang, Yurui Chang, Lu Lin · Submission to ICLR 2025 · Rejected

TL;DR

Graph neural networks notoriously struggle with covariate shift when test graphs come from unseen environments (e.g., novel molecular scaffolds or different graph sizes). OODA (Out-of-Distribution Diffusion Augmentation) tackles this by using score-based diffusion models to synthesize novel, valid graph environments while preserving label-determining causal motifs. By directly controlling an out-of-distribution (OOD) exploration parameter during reverse diffusion, OODA avoids the brittle need to explicitly disentangle graphs into invariant and environmental subgraphs.

What Problem Does This Paper Address?

In graph learning, models frequently encounter covariate shifts: situations where the underlying causal labeling mechanism $P(Y \mid G)$ remains constant, but the marginal input distribution $P(G)$ shifts significantly between training and testing. For example, a drug molecule's functional motif might be attached to an entirely unseen molecular scaffold at test time.

Existing remedies fall into two main camps, both with notable drawbacks:

  1. Invariant graph learning: Tries to identify and isolate stable subgraphs from environmental subgraphs. However, cleanly separating these components is notoriously difficult and often mathematically infeasible.
  2. Graph data augmentation: Uses perturbations (e.g., edge dropping, feature masking, mixup). These methods only recombine or alter existing training data, limiting their exploration capacity and often creating semantically invalid instances (such as chemically impossible molecules).

The authors ask: Can we generate genuinely new, out-of-distribution graph environments in a controlled manner while guaranteeing that the core, label-defining structures remain intact?

Methods

The authors introduce OODA, framing OOD augmentation as conditional generation using continuous score-based diffusion models (SDEs):

  • Joint Structure and Feature Diffusion: Graph topologies (adjacency matrices $A$) and node/edge attributes ($X$) are simultaneously diffused into Gaussian noise and denoised via Graph Transformers.
  • Dual-Guidance Reverse Diffusion: Rather than altering graphs post-hoc, OODA steers the reverse denoising trajectory using two guiding forces derived from the factorization of $P_{\text{tr}}(G, Y \mid y_{\text{ood}} = \lambda)$:
  • OOD Exploration Guidance ($\lambda$): Based on the principle that out-of-distribution samples inhabit low-density regions of the training data distribution, the model incorporates an exploration parameter $\lambda \in [0, 1)$ that pushes sampling toward low-density graph regions.
  • Stable Pattern Preservation Guidance ($\alpha$): A time-dependent classifier $\phi_t(G_t)$ estimates the label probability from intermediate noisy graphs. Its gradient directs the generative process to retain the critical motifs that define the ground-truth label $Y$.
  • No Explicit Disentanglement Needed: Because guidance acts collectively on the generative trajectory, there is no need to manually segment or mask the graph into invariant vs. environmental pieces.
Noise G_T  ───>  Reverse SDE Guided by:
                 ├─ Classifier Gradient (Preserves Stable Motifs)
                 └─ Density Gradient (Pushes into Unseen Environments, λ)
           ───>  Augmented OOD Graph G~_0

Datasets

The authors evaluated OODA on six benchmarks from the GOOD (Graph Out-of-Distribution) benchmark suite, spanning synthetic, semi-synthetic, and real-world domains:

  • GOOD-Motif (Synthetic): Graphs combining an invariant motif (house, cycle, crane) with environmental base graphs (wheel, tree, ladder). Evaluated under base and size covariate shifts.
  • GOOD-CMNIST (Semi-synthetic): Superpixel MNIST graphs with synthetic color attributes, evaluated under color (node feature) shift.
  • GOOD-HIV (Real-world Molecules): Molecular graphs evaluated under scaffold (Bemis-Murcko scaffolds) and graph size shifts.
  • GOOD-SST2 (Real-world NLP): Sentence parse trees evaluated across text length shifts.

No new benchmarks were introduced; the study relies entirely on established GOOD benchmark splits.

Key Insights and Ideas

  • OOD exploration as low-likelihood sampling: Instead of random edge dropouts, OOD environments can be systematically explored by sampling from lower-density regions of the data manifold via an explicit parameter $\lambda$.
  • Label-conditioning protects validity and invariants: Guided reverse-time diffusion allows the environment around a subgraph to morph while the core motif remains chemically and topologically stable (achieving 100% molecular validity on HIV).
  • Simultaneous feature and topology exploration: Because both adjacency matrices and node features are diffused together, OODA handles shifts in graph size, topology, and node/edge attributes within a single, unified framework.

Key Results

OODA was benchmarked against 16 baselines across invariant learning (DIR, CIGA, GSAT) and graph augmentation (FLAG, G-Mixup, AIA):

  • Consistent State-of-the-Art: OODA achieved the highest performance across all six covariate shift settings.
  • Substantial Improvements:
  • GOOD-Motif: Scored 75.25% on base shift (vs. 68.66% ERM, 73.64% AIA) and 60.81% on size shift (vs. 51.74% ERM, 55.85% AIA).
  • GOOD-CMNIST: Achieved 54.60%, outperforming the best baseline (AIA at 36.37%) by +18.23%.
  • GOOD-HIV: Reached 72.67% ROC-AUC on scaffold shift and 66.47% on size shift (surpassing ERM at 59.94%).
  • Verification of Control: Using Maximum Mean Discrepancy (MMD RBF) and Fréchet ChemNet Distance (FCD), the authors demonstrated that increasing $\lambda$ steadily increases distributional distance from training data while maintaining $>95\%$ motif-preservation probability and 100% molecular validity.

Limitations and Future Work

  • Computational Complexity: The generative component relies on Graph Transformers with $\mathcal{O}(n^2)$ memory and time complexity per layer, making it expensive for very large graphs.
  • Diffusion Latency: Sampling requires iterative denoising (typically 1,000 steps), which introduces computational overhead compared to simple heuristics like edge dropping.
  • Hyperparameter Sensitivity: The guidance strength $\alpha$ and exploration parameter $\lambda$ require tuning across different domains to avoid either under-exploring or drifting into degenerate graph spaces.
  • Future Directions: Developing more scalable, one-step or few-step diffusion models and automated, parameter-efficient guidance tuning strategies.

Summary updated

BibTeX
@misc{wang2024mitigating,
  author = {Bohan Wang and Yurui Chang and Lu Lin},
  title = {{Mitigating Graph Covariate Shift via Score-based Out-of-distribution Augmentation}},
  year = {2024},
  eprint = {2410.17506},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.17506},
}
Figure