Abstract
Homophily, the tendency of nodes from the same class to connect, is a fundamental property of real-world graphs, underpinning structural and semantic patterns in domains such as citation networks and social networks. Existing methods exploit homophily through designing homophily-aware GNN architectures or graph structure learning strategies, yet they primarily focus on GNN learning with training graphs. However, in real-world scenarios, test graphs often suffer from data quality issues and distribution shifts, such as domain shifts across users from different regions in social networks and temporal evolution shifts in citation network graphs collected over varying time periods. These factors significantly compromise the pre-trained model's robustness, resulting in degraded test-time performance. With empirical observations and theoretical analysis, we reveal that transforming the test graph structure by increasing homophily in homophilic graphs or decreasing it in heterophilic graphs can significantly improve the robustness and performance of pre-trained GNNs on node classifications, without requiring model training or update. Motivated by these insights, a novel test-time graph structural transformation method grounded in homophily, named GrapHoST, is proposed. Specifically, a homophily predictor is developed to discriminate test edges, facilitating adaptive test-time graph structural transformation by the confidence of predicted homophily scores. Extensive experiments on nine benchmark datasets under a range of test-time data quality issues demonstrate that GrapHoST consistently achieves state-of-the-art performance, with improvements of up to 10.92%.
Introduction
Graph Neural Networks (GNNs) have emerged as a powerful paradigm for modeling relational data, yet they are notoriously brittle when the data they encounter at test-time differs from their training distribution. These "distribution shifts" are common in real-world applications, such as evolving citation networks or social networks spanning different geographic regions.
Most existing solutions attempt to mitigate this through Test-Time Training (TTT), which involves retraining or fine-tuning the model on the fly. However, retraining is computationally expensive and often unstable. This paper investigates a different approach: Instead of fixing the model, can we fix the graph? Specifically, the authors explore whether adjusting the graph's homophily level (the tendency of similar nodes to connect) at test-time can recover lost performance. Through theoretical analysis using Contextual Stochastic Block Models (CSBM), they demonstrate that for a fixed linear classifier, increasing the homophily degree in a homophilic test graph—or decreasing it in a heterophilic one—directly reduces misclassification probability.
The GrapHoST Framework
The authors introduce GrapHoST (Graph Homophily-based Structural Transformation), a "plug-and-play" module designed to improve robustness without retraining the base classifier. The framework operates in three main stages:
- Homophily Predictor Learning: During the training phase, a separate, lightweight GNN is trained to classify edges as either homophilic (connecting nodes of the same class) or heterophilic (connecting different classes). A Weighted Binary Cross-Entropy loss is employed to handle the inherent class imbalance in graph edges.
- Structural Transformation: At test-time, the predictor assigns a confidence score to every edge in the unseen graph. GrapHoST then performs two operations:
- Reweighting: Assigning higher weights to edges that align with the graph's primary nature (e.g., homophilic edges in a homophilic graph).
- Filtering: Pruning "harmful" edges—those predicted with high confidence to be heterophilic in a homophilic graph, or vice versa.
- Inference: The modified, "cleaned" graph is passed to the original, frozen GNN classifier.
Crucially, GrapHoST is model-agnostic and data-centric, requiring no access to the base model's internal gradients or weights for updates. This makes it highly efficient for real-time deployment.
Empirical Analysis and Results
The researchers evaluated GrapHoST on nine benchmark datasets, including homophilic graphs (Cora, Amazon-Photo, Twitch, FB100, Elliptic, OGB-Arxiv) and heterophilic graphs (Actor, Chameleon, Squirrel). They tested various shifts, including synthetic node attribute noise, cross-domain shifts, and temporal evolution.
Key Findings:
- Performance Gains: GrapHoST consistently achieved state-of-the-art results, with improvements of up to 10.92% over standard training methods across various architectures like GCN, GAT, and GraphSAGE.
- Robustness to Noise: Even under extreme structural noise (where 50% of edges were randomly modified), GrapHoST maintained higher accuracy than the base GNN on the original "clean" graph.
- Efficiency and Scalability: With a complexity of $O(E)$, GrapHoST is significantly faster and more memory-efficient than competitors like EERM or GraphPatcher, which often run out of memory (OOM) on large-scale graphs like OGB-Arxiv.
Conclusion
GrapHoST offers a novel, efficient perspective on test-time robustness by focusing on graph structure rather than model parameters. By selectively pruning or reweighting edges based on predicted homophily, it effectively "cleans" the graph for a frozen classifier. While the method relies on the predictor's ability to generalize across shifts, its performance across diverse datasets is promising. Future work may explore automatic, adaptive methods for determining filtering ratios and applying these structural insights to the initial training phase as a form of data augmentation.
Summary updated