When to Pre-Train Graph Neural Networks? From Data Generation Perspective!

Yuxuan Cao, Jiarong Xu, Carl Yang, Jiaan Wang, Yunchao Zhang, Chunping Wang, Lei Chen

In the world of deep learning, pre-training has become the "cheat code" for success. Whether it's BERT for language or ResNet for vision, starting with a model that already "understands" the world usually leads to better results. However, in the world of Graph Neural Networks (GNNs), this isn't always true. Sometimes, pre-training on one set of graphs actually hurts performance on another—a phenomenon known as negative transfer.

A new paper, "When to Pre-Train Graph Neural Networks? From Data Generation Perspective!", introduces a framework called W2PGNN to solve this. Instead of blindly pre-training and hoping for the best, W2PGNN asks the crucial question: When is it actually worth it?

TL;DR

W2PGNN is a framework that predicts whether pre-training a GNN will benefit a specific downstream task by analyzing the generative mechanisms of the data. By using "graphons" to model the space of possible graphs, it can estimate pre-training feasibility and select the best training data without running a single costly training epoch.

What Problem Does This Paper Address?

Graph data is notoriously diverse. A structural pattern like a "closed triangle" might represent a stable friendship in a social network but an unstable bond in a molecular graph. Because the semantics of graph structures change across domains, pre-training a model on social media data and applying it to chemistry often leads to negative transfer.

Currently, researchers decide whether to pre-train through expensive trial and error: training multiple models with different strategies and checking the results (see Figure 1a). There is no standard way to quantify the "transferability" between a massive unlabeled pre-training set and a small, labeled downstream set before doing the heavy lifting.

Figure 1: Comparison of existing methods and proposed W2PGNN to answer when to pre-train GNNs.

Methods

The authors propose looking at the problem through the lens of data generation. If the downstream data looks like it could have been generated by the same process that created the pre-training data, transfer is likely to succeed.

The Graphon Approach

To model these generative processes, the authors use graphons—continuous functions that represent the limit of a graph sequence. Think of a graphon as a probability map for edge creation.

  1. Graphon Basis: W2PGNN fits the pre-training data into a "graphon basis"—a set of fundamental structural patterns.
  2. Generator Space: It defines a space of all possible graph generators created by combining these bases.
  3. Feasibility Measure: To see if a downstream graph "fits," W2PGNN calculates the Gromov-Wasserstein (GW) distance between the downstream data's graphon and the best possible generator in the pre-training space.

Essentially, if the distance is small, the downstream data is "within scope," and pre-training is highly feasible (see Figure 2).

Figure 2: Illustration of our proposed framework W2PGNN to answer when to pre-train GNNs.

Datasets

The authors validated W2PGNN across two main types of tasks:

  • Node Classification: Pre-training candidates included academic networks (Academia, DBLP), movie networks (IMDB), and social networks (Facebook, LiveJournal). Downstream tasks included US-Airport and H-Index datasets.
  • Graph Classification: They used the ZINC15 molecular dataset (2 million unlabeled molecules) for pre-training, partitioned by chemical scaffolds. Downstream evaluation used standard MoleculeNet benchmarks: BACE, BBBP, MUV, HIV, and ClinTox.

Key Insights and Ideas

  • Topology is King: The paper argues that for cross-domain transfer, node attributes (like user profiles vs. atom types) are often non-transferable. The real "knowledge" lies in the graph topology.
  • Graphons as Summaries: Graphons are powerful because they provide a size-invariant way to summarize a collection of graphs. This allows the framework to compare a massive pre-training set to a tiny downstream set on equal footing.
  • Pruning the Search Space: By calculating feasibility beforehand, engineers can skip pre-training on irrelevant data, saving massive amounts of compute time and energy.

Key Results

The authors compared W2PGNN's feasibility estimates against actual downstream performance across various GNN models (like GraphCL and GCC).

  • High Correlation: W2PGNN’s feasibility scores showed a strong positive Pearson correlation with actual performance gains. In many cases, it significantly outperformed baselines like simple graph statistics or Laplacian differences (see Figure 3 and 4).
  • Data Selection: When tasked with picking the best 2 or 3 datasets for pre-training out of a larger pool, W2PGNN consistently ranked the most beneficial datasets first.
  • Efficiency: The time complexity of W2PGNN is $O((n_1 + n_2)|V|^2)$, which is orders of magnitude faster than the $O(l_1 l_2 \dots)$ complexity of the traditional "train-and-test" approach.
Figure 1: Comparison of existing methods and proposed W2PGNN to answer when to pre-train GNNs.

Limitations and Future Work

While W2PGNN excels at capturing topological transferability, it explicitly ignores node attributes and proximity, assuming they don't transfer well across different domains. However, in cases where domains are similar (e.g., two different social networks), these attributes might contain valuable information.

Future work could involve extending the graphon-based generator space to include attribute distributions, creating an even more comprehensive "feasibility map" for graph transfer learning.

Summary updated

BibTeX
@inproceedings{cao2023when,
  author = {Yuxuan Cao and Jiarong Xu and Carl Yang and Jiaan Wang and Yunchao Zhang and Chunping Wang and Lei Chen and Yang Yang},
  title = {{When to Pre-Train Graph Neural Networks? From Data Generation Perspective!}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2023},
  doi = {10.48550/arxiv.2303.16458},
}
Figure