Research on GNNs with stable learning

Wenbin Li, Wei Wang, P. Patrick Wang, Li Pan, Bo Yang, Yanling XuScientific 2025

Abstract

Traditional Graph Neural Network (GNN) learning patterns can only achieve optimal performance under the assumption of independent and identically distributed data. However, in real-world scenarios, numerous unpredictable factors give rise to the Out-of-Distribution (OOD) problem. Moreover, this distribution discrepancy may lead to unreliable predictions by GNNs models within unknown OOD domains. Therefore, this paper proposes a machine learning method to enhance the stability of GNN cross-site classification from the perspective of stable learning. The aim is to extract genuine causal features while eliminating spurious causal features. By introducing a feature sample weighting decorrelation technique in the random Fourier transform space and combining it with a baseline GNN model, a Stable-GNN model and a constrained sampling weight gradient update algorithm are designed. Its theoretical proof indicates that this algorithm can ensure the decrease in the loss, thus remedying the shortcomings of the original algorithm in weight updating. While guaranteeing predictive performance on the training distribution data, it also reduces prediction bias on data from unseen test distributions. Compared with the GNN model and the Stable-GNN model (S-GNN), the experimental results of the S-GNN model demonstrate that it not only surpasses the current state-of-the-art GNN models, but also offers a flexible framework for strengthening existing GNNs.

Introduction

Most Graph Neural Networks (GNNs) are trained under the independent and identically distributed (i.i.d.) assumption, which posits that training and testing data share the same underlying distribution. In real-world applications, this assumption is frequently violated due to selection bias or confounding variables, leading to Out-of-Distribution (OOD) shifts. Standard GNNs often fail in these scenarios because they exploit "spurious correlations"—statistical patterns that appear in the training set but do not represent the underlying causal mechanisms. This research introduces the Stable-GNN (S-GNN) framework to address these challenges by focusing on learning causal features that remain invariant across different environments.

The Stable-GNN Framework

The proposed S-GNN framework integrates a stable learning module with a standard GNN backbone. The core idea is to reweight training samples such that the learned features become statistically independent, thereby forcing the model to rely on causal relationships rather than coincidental correlations.

The complete Stable-GNN architecture, illustrating the flow from input graph to final loss through the RFF-based decorrelation and sample weighting modules.

As shown in the architecture above, the process begins with a GNN module that extracts a feature map from the input graph. This feature map is then processed through two parallel paths: one for standard prediction and another for stable weight learning via the Learning Sample Weights for Decorrelation (LSWD) module.

GNN Module Architecture

The GNN component itself follows a structured pipeline to transform graph data into high-level representations. It typically consists of multiple convolutional layers followed by normalization and pooling.

Detailed view of the GNN component, showing the sequence of convolutional layers, LayerNorm, GlobalMeanPool, and MLP.

Methodology: Stable Learning via Decorrelation

The S-GNN framework employs three key technical innovations to achieve stability:

  1. Non-linear Decorrelation via Random Fourier Features (RFF): To capture complex, non-linear dependencies between features, the model maps them into a high-dimensional space using RFF. In this space, non-linear independence can be approximated by measuring linear covariance, significantly reducing computational complexity from $O(n^2)$ to $O(nD)$.
  2. Learning Sample Weights for Decorrelation (LSWD): The model learns a weight $w_i$ for each sample. These weights are optimized to minimize the correlation between features in the reweighted distribution. When features are decorrelated, the model is prevented from using one feature as a "proxy" for another, a common source of spurious correlation.
  3. Constrained Gradient Update: A specialized algorithm is used to update sample weights. It ensures weights remain non-negative and normalized while providing a theoretical guarantee that the loss function will decrease, addressing stability issues in previous weight-updating methods.

Experimental Evaluation

The researchers evaluated S-GNN on several benchmark datasets, focusing on its ability to handle OOD shifts:

  • TUDataset: Includes bioinformatics and social network benchmarks like ENZYMES and PROTEINS.
  • Open Graph Benchmark (OGB): Uses molecular property prediction tasks with "scaffold splitting" to rigorously test OOD performance.

Key Results

  • Improved Accuracy: On TUDataset, the Stable-GINE0 model outperformed the baseline GINE0 by an average of 4.1%.
  • OOD Robustness: On the OGB molbace dataset, Stable-GIN achieved a 3.72% higher AUC than the standard GIN model.
  • Regression Stability: In numerical prediction tasks, Stable-GCN/GIN models consistently showed lower Root Mean Square Error (RMSE), with Stable-GCN improving RMSE by 0.1056 over the baseline.

Conclusion

Stable-GNN provides a robust framework for enhancing GNN performance in real-world, non-i.i.d. environments. By prioritizing causal features through non-linear decorrelation and sample weighting, the model achieves superior stability and accuracy on OOD data. Future work may explore the framework's sensitivity to hyperparameters and its application to other domains such as autonomous driving and medical imaging.

Summary updated

BibTeX
@inproceedings{li2025research,
  author = {Wenbin Li and Wei Wang and P. Patrick Wang and Li Pan and Bo Yang and Yanling Xu},
  title = {{Research on GNNs with stable learning}},
  booktitle = {Scientific},
  year = {2025},
  doi = {10.1038/s41598-025-12840-8},
}
Figure