Contextual Structure Knowledge Transfer for Graph Neural Networks

Zhiyuan Yu, Wenzhong Li, Zhangyue Yin, Xiaobin Hong, Shijian Xiao, Sanglu Lu

Introduction

Graph Neural Networks (GNNs) have demonstrated remarkable success in modeling relational data. However, their performance often hinges on the availability of large-scale labeled datasets. Graph Transfer Learning (GTL) aims to mitigate this by transferring knowledge from a label-rich source graph to a label-scarce target graph. A significant challenge in GTL is homophily shift—the discrepancy in the tendency of similar nodes to connect between different domains. When a model trained on a highly homophilous source graph is applied to a heterophilous target graph, performance typically degrades significantly.

Methodology: The CS-GNN Framework

To address the challenge of homophily shift, we introduce the Contextual Structural Graph Neural Network (CS-GNN). This framework leverages local structural patterns to facilitate robust knowledge transfer without relying on target labels.

The CS-GNN architecture overview, illustrating the four main components from ego-network construction to fairness loss.

The CS-GNN architecture consists of four primary modules:

  1. Ego-Network Construction: The model constructs $k$-hop ego-graphs for each node, capturing localized structural contexts rather than global graph statistics.
  2. Moment-Based Feature Smoothness: Using the "Method of Moments," the framework calculates statistical moments (mean, variance, skewness) of feature differences between nodes and their neighbors. This serves as a label-free proxy for local homophily.
  3. Contextual Message Passing: A customized attention mechanism uses these moments to guide information aggregation, allowing the model to match similar structural patterns across domains.
  4. Group-Wise Fairness Loss: By partitioning the graph (using METIS) and applying a fairness loss, the model ensures it learns diverse structural patterns, preventing it from overfitting to dominant structures in the source domain.

Experimental Evaluation

The framework was evaluated on six real-world benchmark datasets, including citation networks (A&D), social networks (B1&B2), and transportation graphs (Airport). These datasets were selected for their varying degrees of homophily, providing a rigorous testbed for cross-domain transfer.

Results and Discussion

CS-GNN consistently outperformed state-of-the-art baselines such as DANE, GRADE, and StruRW, achieving the top rank across all tested scenarios.

Accuracy comparison across varying levels of homophily discrepancy, demonstrating the robustness of CS-GNN (Ours) compared to baselines.

Key findings include:

  • Robustness to Homophily Shift: As shown in the figure above, CS-GNN maintains stable performance even as the homophily gap between source and target graphs increases, whereas baseline methods experience sharp declines.
  • Data Efficiency: In scenarios with extremely sparse labels (0.1%), CS-GNN outperformed competitors by approximately 10% in accuracy.
  • Structural Alignment: By focusing on local ego-networks and feature smoothness, the model effectively identifies "structural cousins" across different graphs, facilitating more accurate knowledge transfer.

Conclusion and Future Work

CS-GNN provides a robust solution for graph transfer learning under structural discrepancy. By utilizing statistical moments as a proxy for homophily and ensuring structural fairness, it overcomes the limitations of traditional GTL methods. Future research will focus on reducing the computational overhead of multi-order moment calculations and extending this contextual approach to tasks like link prediction and anomaly detection in dynamic graphs.

Summary updated

BibTeX
@inproceedings{yu2025contextual,
  author = {Zhiyuan Yu and Wenzhong Li and Zhangyue Yin and Xiaobin Hong and Shijian Xiao and Sanglu Lu},
  title = {{Contextual Structure Knowledge Transfer for Graph Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i21.34381},
}
Figure