Out-of-Distribution Generalized Dynamic Graph Neural Network with Disentangled Intervention and Invariance Promotion

Zeyang Zhang, Xin Wang, Ziwei Zhang, Haoyang Li, Wenwu ZhuarXiv 2023 · DOI

Abstract

Standard Dynamic Graph Neural Networks (DyGNNs) often struggle with distribution shifts between training and testing environments. This paper presents I-DIDA, a novel framework designed to disentangle invariant spatio-temporal patterns from variant ones. By leveraging causal intervention and latent environment inference, I-DIDA ensures robust predictions across evolving graph dynamics. Experimental results on five diverse datasets demonstrate significant performance gains over state-of-the-art methods in out-of-distribution (OOD) scenarios.

Introduction

Dynamic graphs, such as financial transaction networks and social media interactions, are inherently non-stationary. While DyGNNs excel at capturing temporal and structural dependencies, they frequently overfit to "spurious correlations"—patterns specific to the training distribution that do not generalize to the real world. When faced with OOD data, these models often fail. The core challenge lies in separating stable "invariant" laws of the network from noisy "variant" patterns without explicit environment labels.

The I-DIDA Framework

The proposed I-DIDA (Disentangled Intervention-based Dynamic graph Attention networks with Invariance Promotion) framework addresses these challenges through three integrated pillars.

Overview of the I-DIDA framework, illustrating disentangled attention, intervention mechanisms, and environment inference.

1. Disentangled Spatio-temporal Attention

Instead of a monolithic attention mechanism, I-DIDA employs a dual-masking strategy to separate invariant and variant patterns. One mask identifies stable features and structures (the "laws" of the network), while the other captures transient, environment-specific signals. A negative correlation constraint is applied to ensure these patterns remain distinct and non-overlapping.

2. Spatio-temporal Intervention Mechanism

To break spurious correlations, I-DIDA utilizes a causal intervention mechanism inspired by "do-calculus." It simulates "intervened" distributions by swapping variant patterns between different nodes or time steps.

The Spatio-Temporal Intervention Mechanism creates intervened distributions to test the robustness of invariant patterns.

By forcing the model's predictions to remain consistent despite these swaps, the framework ensures that the model relies solely on the causal, invariant features. This "sampling and reassembling" approach is computationally efficient, maintaining linear complexity while effectively cutting the "backdoor" paths created by variant noise.

3. Latent Environment Inference

Real-world datasets rarely provide environment labels (e.g., which community or time period a slice belongs to). I-DIDA overcomes this by using the extracted variant patterns to cluster data into latent environments via K-means. The model then minimizes prediction variance across these inferred environments to further promote the learning of truly invariant features.

Experimental Evaluation

I-DIDA was evaluated on five datasets with specific OOD splits designed to test robustness against distribution shifts:

  • COLLAB & Yelp: Academic and business networks with category-based OOD holds (e.g., "Data Mining" papers or "Pizza" restaurants).
  • OGBN-Arxiv & Aminer: Citation networks with temporal splits, training on older papers and testing on much newer ones.
  • Synthetic Data: Manually injected distribution shifts to stress-test the model's limits.

Key Results and Insights

  • Performance Gains: I-DIDA consistently outperformed state-of-the-art DyGNNs (like DySAT) and OOD methods (like IRM). It achieved a ~5% AUC improvement on COLLAB and a 9% improvement on Yelp compared to the best baselines.
  • Temporal Robustness: On OGBN-Arxiv, performance improved by 2-4% as the time gap between training and testing increased, proving it handles temporal shifts better than standard models.
  • Variant Patterns as Signals: A key insight of this work is that "noise" or variant patterns are actually useful for identifying the environment. By clustering these signals, the model can automatically determine the current operating regime.

Conclusion and Future Work

I-DIDA represents a significant advancement in OOD generalization for dynamic graphs. By treating variant patterns as a tool for environment discovery and using causal intervention to prune non-causal paths, it achieves state-of-the-art robustness. Future work will explore more sophisticated clustering for environment inference and extending the framework to graph-level tasks, such as molecular property prediction.

Summary updated

BibTeX
@misc{zhang2023out,
  author = {Zeyang Zhang and Xin Wang and Ziwei Zhang and Haoyang Li and Wenwu Zhu},
  title = {{Out-of-Distribution Generalized Dynamic Graph Neural Network with Disentangled Intervention and Invariance Promotion}},
  year = {2023},
  eprint = {2311.14255},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.14255},
}
Figure