Out-of-Distribution Generalization on Graphs via Progressive Inference

Yiming Xu, Bin Shi, Zhen Peng, Huixiang Liu, Bo Dong, Chen Chen

Abstract

Graph Neural Networks (GNNs) typically struggle with out-of-distribution (OOD) data where testing distributions differ from training. Current causal invariant learning methods often fail because they attempt to isolate causal features in a single step, leaving a significant distribution gap. We propose GPro (Graph Progressive Inference), which utilizes a multi-step progressive inference process to gradually disentangle stable causal structures from spurious correlations. GPro employs a dual-tower architecture and supervised contrastive learning to achieve state-of-the-art performance across multiple OOD benchmarks.

Introduction

The standard "i.i.d. assumption" in machine learning—that training and testing data share the same distribution—is frequently violated in real-world graph data. For instance, a molecule's properties might be spuriously correlated with a specific background scaffold in a training set. Existing methods for causal invariant learning attempt to strip away these non-causal parts but usually do so in a single-step manner. Because graph components are often deeply coupled, a single pass often fails to separate the signal from the noise, resulting in learned features that do not generalize well.

Conceptual comparison between single-step causal learning and GPro's progressive inference.

Methodology: The GPro Framework

GPro addresses the limitations of single-step methods through three primary components:

1. Progressive Inference Blocks

Instead of one-shot extraction, GPro stacks multiple Substructure Context Inference Blocks. Each block employs edge-level attention to identify and prune the most obvious non-causal components, passing a refined graph to the subsequent step. This "easy-to-hard" decomposition allows the model to unweave complex topological associations that a single-step model would miss.

2. Dual-Tower Architecture

GPro utilizes two parallel towers to simultaneously identify causal and non-causal substructures. This "mutual assistance" design ensures that the model explicitly understands what to discard as well as what to keep, leading to cleaner feature separation.

3. Counterfactual Augmentation and SCL

To enhance robustness, GPro generates counterfactual samples by permuting non-causal features. A Supervised Contrastive Learning (SCL) loss is then applied to pull together causal representations of the same class while pushing away non-causal representations and samples from different classes.

The GPro pipeline featuring dual-tower inference and the Substructure Context Inference Block.

Experimental Evaluation

GPro was evaluated on several OOD benchmarks:

  • Graph-based Image Datasets: CMNIST-75sp, CFashion-75sp, and CKuzushiji-75sp, where spurious features (e.g., background colors) are intentionally correlated with labels during training.
  • DrugOOD: A large-scale real-world benchmark for drug affinity prediction with distribution shifts across assay types and molecule sizes.

Results and Discussion

GPro outperformed 11 baseline methods, achieving an average accuracy improvement of 4.91%. In cases of extreme training bias (up to 95%), the performance gain reached 6.86%.

Key insights include:

  • Cleaner Feature Separation: t-SNE visualizations confirm that GPro's multi-step approach produces tighter, more distinct clusters compared to "blurry" overlaps in single-step methods.
  • Efficiency: While more complex than single-step methods, GPro's training time is only approximately 1.5x slower than methods like CIGA, representing a favorable trade-off for significant accuracy gains.

Conclusion and Future Work

GPro demonstrates that progressive inference is a powerful paradigm for graph OOD generalization. By mimicking human-like step-by-step reasoning, it effectively bridges the distribution gap. Future work includes automating the selection of inference steps ($L$) for varying graph complexities and extending the framework to node-level and link-prediction tasks.

Summary updated

BibTeX
@inproceedings{xu2025out,
  author = {Yiming Xu and Bin Shi and Zhen Peng and Huixiang Liu and Bo Dong and Chen Chen},
  title = {{Out-of-Distribution Generalization on Graphs via Progressive Inference}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i12.33414},
}
Figure