NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pairwise Alignment Improves Graph Domain Adaptation

Shikun Liu, Deyu Zou, Han Zhao, Pan Li

Introduction

Standard domain adaptation assumes data points are independent, but in graph-structured data, the connections between points are just as important as the data itself. This paper introduces Pair-Align, a theoretically grounded method that tackles "structure shift"—changes in how nodes connect across different domains—by intelligently reweighting edges and classification losses to ensure Graph Neural Networks (GNNs) generalize to new, unseen environments.

The Challenge of Graph Domain Adaptation

Domain Adaptation (DA) is the art of training a model on one dataset (the source) and making it work on a different but related one (the target). While well-studied for images and text, Graph Domain Adaptation (GDA) is significantly harder because data points (nodes) are interlinked.

When moving from a source graph (e.g., a US-based citation network) to a target graph (e.g., a Chinese citation network), three primary shifts can occur:

  1. Features: The attributes of the nodes change.
  2. Labels: The proportion of classes changes (Label Shift).
  3. Structure: The patterns of connections change (Conditional Structure Shift).
Examples of Structure Shift in HEP and Citation datasets

Most existing GDA methods focus on aligning node features but often ignore structure shift. If a GNN learns that a specific neighborhood pattern implies a certain label in the source domain, but that same pattern means something else in the target domain, the model will fail. The authors aim to bridge this gap by explicitly modeling and mitigating these structural discrepancies.

The Pair-Align Methodology

The authors propose Pair-Align, which decomposes structure shift into two distinct components: Conditional Structure Shift (CSS) and Label Shift (LS).

The Pair-Align pipeline optimizing edge and label weights
  • Handling CSS with Edge Weights ($\gamma$): To deal with changing connection patterns, Pair-Align calculates weights for every edge in the source graph. These weights recalibrate the influence of neighboring nodes during the GNN's message-passing phase. Essentially, it transforms the source neighborhood distribution to match the target's.
  • Handling LS with Label Weights ($\beta$): To address changing class proportions, the method adjusts the classification loss. If a certain class is rare in the source but common in the target, its importance is boosted during training.
  • The "Pairwise" Trick: Estimating these weights is tricky without target graph labels. Pair-Align uses a bootstrapping approach: it leverages the model's own predictions (pseudo-labels) on the target graph to estimate the joint distribution of connected node pairs. It then solves a linear system to find the optimal weights ($\gamma$ and $\beta$) that align the two domains.
  • Iterative Refinement: The process is iterative. As the GNN improves at predicting target labels, the weight estimations become more accurate, which in turn helps the GNN generalize further.

Datasets and Evaluation

The study utilizes a diverse mix of synthetic and real-world datasets to validate the approach:

  • MAG (Microsoft Academic Graph): The authors curated a massive version of this dataset (approx. 380k nodes, 1.35M edges) specifically for GDA, partitioning it by country to simulate regional shifts.
  • HEP (High Energy Physics): A "pileup mitigation" task from particle collision experiments at the Large Hadron Collider, where the structure of particle interactions shifts based on experimental conditions.
  • Arxiv: A citation network where the shift occurs over time (training on older papers, testing on newer ones).
  • DBLP & ACM: Two distinct citation networks used to test cross-platform generalization.
  • Synthetic CSBM: Graphs generated using the Contextual Stochastic Block Model to precisely control and test specific types of shifts.

Key Insights and Results

  • Marginal Alignment is Insufficient: Simply making the average node representation look the same across domains fails if the conditional relationship between structure and labels has changed.
  • Structure as a Feature: In graphs, the neighborhood is a crucial feature. Pair-Align treats the distribution of neighbor labels as a signal that must be aligned, rather than just aligning individual node features.
  • Principled Weighting: The method derives weights from a theoretical framework that guarantees (under certain conditions) that the GNN's internal representations will become domain-invariant.
  • Performance Gains: On the large-scale MAG dataset, Pair-Align showed massive gains, sometimes improving accuracy by over 25% relative to standard Empirical Risk Minimization (ERM) and significantly outperforming previous state-of-the-art GDA methods.
  • Robustness in Physics: In the HEP pileup mitigation task, Pair-Align proved highly effective at handling the complex structural shifts inherent in particle physics data, maintaining high performance even under extreme shifts (e.g., moving from balanced to highly imbalanced class distributions).

Limitations and Future Directions

  • Reliance on Pseudo-labels: Like many adaptation methods, Pair-Align depends on the initial quality of the model's predictions on the target domain. Poor initial models can lead to noisy weight estimations, though L2 regularization is used to mitigate this.
  • Computational Overhead: The iterative process of estimating weights and re-training adds computational complexity compared to a single-pass training run.
  • Assumption of Independence: The theoretical proofs rely on an "Edge Conditional Independence" assumption, which might oversimplify highly complex real-world graphs.

Future work could explore more efficient ways to estimate these weights or extend the framework to dynamic graphs where the structure changes continuously.

Summary updated

BibTeX
@inproceedings{liu2024pairwise,
  author = {Shikun Liu and Deyu Zou and Han Zhao and Pan Li},
  title = {{Pairwise Alignment Improves Graph Domain Adaptation}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=ttnbM598vZ},
}
Figure