Table of Contents
Fetching ...

Matcha: Mitigating Graph Structure Shifts with Test-Time Adaptation

Wenxuan Bao, Zhichen Zeng, Zhining Liu, Hanghang Tong, Jingrui He

TL;DR

This work proposes Matcha, an innovative framework designed for effective and efficient adaptation to structure shifts by adjusting the htop-aggregation parameters in GNNs, and designs a prediction-informed clustering loss to encourage the formation of distinct clusters for different node categories.

Abstract

Powerful as they are, graph neural networks (GNNs) are known to be vulnerable to distribution shifts. Recently, test-time adaptation (TTA) has attracted attention due to its ability to adapt a pre-trained model to a target domain, without re-accessing the source domain. However, existing TTA algorithms are primarily designed for attribute shifts in vision tasks, where samples are independent. These methods perform poorly on graph data that experience structure shifts, where node connectivity differs between source and target graphs. We attribute this performance gap to the distinct impact of node attribute shifts versus graph structure shifts: the latter significantly degrades the quality of node representations and blurs the boundaries between different node categories. To address structure shifts in graphs, we propose Matcha, an innovative framework designed for effective and efficient adaptation to structure shifts by adjusting the htop-aggregation parameters in GNNs. To enhance the representation quality, we design a prediction-informed clustering loss to encourage the formation of distinct clusters for different node categories. Additionally, Matcha seamlessly integrates with existing TTA algorithms, allowing it to handle attribute shifts effectively while improving overall performance under combined structure and attribute shifts. We validate the effectiveness of Matcha on both synthetic and real-world datasets, demonstrating its robustness across various combinations of structure and attribute shifts. Our code is available at https://github.com/baowenxuan/Matcha .

Matcha: Mitigating Graph Structure Shifts with Test-Time Adaptation

TL;DR

This work proposes Matcha, an innovative framework designed for effective and efficient adaptation to structure shifts by adjusting the htop-aggregation parameters in GNNs, and designs a prediction-informed clustering loss to encourage the formation of distinct clusters for different node categories.

Abstract

Powerful as they are, graph neural networks (GNNs) are known to be vulnerable to distribution shifts. Recently, test-time adaptation (TTA) has attracted attention due to its ability to adapt a pre-trained model to a target domain, without re-accessing the source domain. However, existing TTA algorithms are primarily designed for attribute shifts in vision tasks, where samples are independent. These methods perform poorly on graph data that experience structure shifts, where node connectivity differs between source and target graphs. We attribute this performance gap to the distinct impact of node attribute shifts versus graph structure shifts: the latter significantly degrades the quality of node representations and blurs the boundaries between different node categories. To address structure shifts in graphs, we propose Matcha, an innovative framework designed for effective and efficient adaptation to structure shifts by adjusting the htop-aggregation parameters in GNNs. To enhance the representation quality, we design a prediction-informed clustering loss to encourage the formation of distinct clusters for different node categories. Additionally, Matcha seamlessly integrates with existing TTA algorithms, allowing it to handle attribute shifts effectively while improving overall performance under combined structure and attribute shifts. We validate the effectiveness of Matcha on both synthetic and real-world datasets, demonstrating its robustness across various combinations of structure and attribute shifts. Our code is available at https://github.com/baowenxuan/Matcha .

Paper Structure

This paper contains 65 sections, 17 theorems, 70 equations, 13 figures, 11 tables, 1 algorithm.

Key Result

Proposition 3.0

For graphs generated by $\text{CSBM}({\bm{\mu}}_+, {\bm{\mu}}_-, d, h)$, the node representation ${\bm{z}}_i$ of node $v_i \in {\mathbb{C}}_+$ generated by a single-layer GCN follows a Gaussian distribution of where $d_i$ is the degree of node $v_i$, and $h_i$ is the homophily of node $v_i$ defined in Eq. (eq:homophily). Similar results hold for $v_i \in {\mathbb{C}}_-$ after swapping ${\bm{\mu}}

Figures (13)

  • Figure 1: Generic TTA algorithms (T3A, Tent, AdaNPC) are significantly less effective under structure shifts (right) than attribute shifts (left). On the contrary, our proposed Matcha could significantly improve the performance of generic TTA (gray shaded area). The dataset used is CSBM.
  • Figure 2: Attribute shifts and structure shifts have different impact patterns. Compared to attribute shifts (b), structure shifts (c) mix the distributions of node representations from different classes, which cannot be alleviated by adapting the decision boundary. This explains the limitations of existing generic TTA algorithms. The dataset used is CSBM.
  • Figure 3: Our proposed framework of Matcha (when combined with GPRGNN)
  • Figure 4: Accuracy on real-world datasets.
  • Figure 5: Ablation study on Syn-Products with different sets of parameters to adapt.
  • ...and 8 more figures

Theorems & Definitions (32)

  • Proposition 3.0
  • Corollary 3.0
  • Proposition 3.0: Impacts of attribute shifts
  • Proposition 3.0: Impacts of structure shifts
  • Proposition 3.0: Adapting $\gamma$
  • Theorem 4.1: Convergence of
  • Proposition A.0
  • proof
  • Remark A.1
  • Corollary A.1
  • ...and 22 more