Abstract
Graph Out-of-Distribution (OOD) generalization is a critical challenge where test data distributions deviate from training data, often due to covariate shifts in environmental features. We present CODA (Conditional Out-of-Distribution Diffusion Augmentation), a framework leveraging score-based diffusion models to synthesize diverse OOD samples. By incorporating a controllable exploration parameter into the conditional score function, CODA navigates low-density regions of the data manifold to generate novel graph environments while preserving label-critical structures. Evaluated on the GOOD benchmark, CODA demonstrates significant performance gains across various covariate shifts, including structural and feature-based perturbations, outperforming 17 state-of-the-art baselines.
Introduction
Deep learning models for graphs typically assume that training and testing data are independent and identically distributed (i.i.d.). However, in real-world applications such as evolving social networks or molecular discovery, this assumption frequently fails. This paper addresses covariate shift, a specific type of OOD challenge where the "environments" (spurious features like graph size or background noise) seen at test time differ from those in the training set.
Existing solutions often rely on manual perturbations (e.g., edge dropping) or require an explicit, often impossible, split between "stable" (label-relevant) and "environmental" (spurious) subgraphs. CODA overcomes these limitations by treating augmentation as a generative task, using diffusion models to "hallucinate" new environments that were never present in the training data.
Methods
CODA utilizes a score-based diffusion model consisting of a forward noise-injection process and a reverse denoising process. The core innovation is the OOD-controlled denoising step, which incorporates an exploration parameter ($\lambda$) into the conditional score function:
$$\nabla_{G_t} \log p_t(G_t | \mathbf{y}_G, \mathcal{E}_{\text{ood}} = \lambda)$$
As $\lambda$ increases, the model is pushed toward low-density regions of the data manifold—the "uncharted territory" where OOD samples likely reside. To ensure the generated graphs remain useful for training, the score function is conditioned on the target label $\mathbf{y}_G$. This ensures that while the "environment" of the graph changes, the "causal" structure determining the label remains intact. Unlike previous methods, CODA uses a Graph Transformer-based architecture to jointly synthesize graph structures, node features, and edge features.
Results and Key Insights
The authors evaluated CODA using the GOOD benchmark, covering synthetic (GOOD-Motif), semi-artificial (GOOD-CMNIST), and real-world (GOOD-HIV, GOOD-SST2) datasets. CODA consistently outperformed 17 baseline methods, including IRM, DIR, and AIA.
- Feature and Structural Robustness: On GOOD-CMNIST (node feature shifts), CODA improved performance by 18.23% over the best augmentation baseline. On GOOD-Motif, it achieved a 9.07% improvement under size shifts.
- Exploration vs. Fidelity: Empirical analysis shows that as $\lambda$ increases, the generated samples move further from the training distribution (measured by MMD) while maintaining high label-prediction confidence. This confirms that CODA effectively explores OOD space without losing semantic meaning.
- Real-World Validity: In molecular tasks (GOOD-HIV), CODA maintained a 100% validity rate, generating chemically sound molecules while outperforming baselines on scaffold and size shifts.
Conclusion
CODA provides a robust framework for graph OOD generalization by leveraging the interpolative power of diffusion models. By navigating low-density regions of the data manifold, it discovers diverse environments implicitly, removing the need for explicit environment labels. While the Graph Transformer architecture introduces $O(n^2)$ complexity and requires a two-stage training process, the substantial gains in robustness across diverse datasets demonstrate its effectiveness for real-world graph learning challenges.
Summary updated