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

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

Abstract

In recent years, graph pre-training has gained significant attention, focusing on acquiring transferable knowledge from unlabeled graph data to improve downstream performance. Despite these recent endeavors, the problem of negative transfer remains a major concern when utilizing graph pre-trained models to downstream tasks. Previous studies made great efforts on the issue of what to pre-train and how to pre-train by designing a variety of graph pre-training and fine-tuning strategies. However, there are cases where even the most advanced "pre-train and fine-tune" paradigms fail to yield distinct benefits. This paper introduces a generic framework W2PGNN to answer the crucial question of when to pre-train (i.e., in what situations could we take advantage of graph pre-training) before performing effortful pre-training or fine-tuning. We start from a new perspective to explore the complex generative mechanisms from the pre-training data to downstream data. In particular, W2PGNN first fits the pre-training data into graphon bases, each element of graphon basis (i.e., a graphon) identifies a fundamental transferable pattern shared by a collection of pre-training graphs. All convex combinations of graphon bases give rise to a generator space, from which graphs generated form the solution space for those downstream data that can benefit from pre-training. In this manner, the feasibility of pre-training can be quantified as the generation probability of the downstream data from any generator in the generator space. W2PGNN offers three broad applications: providing the application scope of graph pre-trained models, quantifying the feasibility of pre-training, and assistance in selecting pre-training data to enhance downstream performance. We provide a theoretically sound solution for the first application and extensive empirical justifications for the latter two applications.

Introduction

In domains like Natural Language Processing and Computer Vision, pre-training is a standard practice that consistently improves performance. However, in the world of Graph Neural Networks (GNNs), the "pre-train and fine-tune" paradigm is notoriously hit-or-miss. A model pre-trained on social network data might fail when applied to molecular biology because structural patterns—such as triangles—carry vastly different semantic meanings across domains. This phenomenon, known as negative transfer, can lead to performance that is worse than training from scratch.

Historically, the only way to determine if pre-training would be beneficial was to execute the entire pipeline: pre-training multiple models and fine-tuning them across various strategies. This trial-and-error approach is computationally expensive and inefficient. W2PGNN addresses this by asking the "When" question: In what situations should we take advantage of graph pre-training?

Comparison between existing trial-and-error methods and the proposed W2PGNN framework.

Methodology: The Graphon Perspective

The core innovation of W2PGNN is viewing pre-training feasibility through the lens of Data Generation. The framework posits that if downstream data can be modeled as having been generated by the same underlying mechanisms as the pre-training data, transfer learning is likely to succeed.

To formalize this, the authors utilize Graphons—continuous probability maps that act as limit objects for collections of graphs. The W2PGNN workflow consists of three primary stages:

  1. Constructing Graphon Bases: Pre-training data is categorized into bases based on topology (structural similarity), domain (source similarity), or an integrated global summary.
  2. Defining the Generator Space: A "generator space" is established as the set of all possible convex combinations of these graphon bases.
  3. Measuring Feasibility: Feasibility is quantified by calculating the Gromov-Wasserstein (GW) distance between the downstream data's estimated graphon and the closest generator in the pre-training space. A smaller distance indicates a higher probability that the pre-training knowledge is relevant and transferable.
The W2PGNN framework: from input space to generator space using graphon bases.

Experimental Evaluation

The authors validated W2PGNN across two major graph learning tasks:

  • Node Classification: Using pre-training candidates from academic (Academia, DBLP), movie (IMDB), and social (Facebook, LiveJournal) domains to predict performance on datasets like US-Airport and Chameleon.
  • Graph Classification: Utilizing the ZINC15 dataset (2 million molecules) for pre-training, with downstream evaluation on MoleculeNet benchmarks (BACE, BBBP, MUV, HIV, ClinTox).

Key Results and Insights

  • High Predictive Accuracy: The feasibility scores calculated by W2PGNN showed a strong Pearson correlation (often > 0.7) with actual downstream performance. This demonstrates that the metric is a reliable predictor of pre-training success.
  • Superior Data Selection: W2PGNN consistently outperformed standard graph statistics (e.g., clustering coefficients or degree variance) when selecting the most relevant subset of pre-training data for a specific task.
  • Efficiency: By replacing $O(L_1 \times L_2)$ training attempts with a single distance calculation, W2PGNN provides a practical "pre-flight check" that saves significant computational resources.
  • Negative Transfer Avoidance: The framework successfully identified low-feasibility scenarios, flagging instances where pre-training would likely degrade performance.

Conclusion and Future Work

W2PGNN shifts the focus of graph pre-training research from how to pre-train to when to pre-train. By quantifying the compatibility between datasets using graphon theory, it provides a mathematical foundation for avoiding negative transfer.

Future work may address current limitations, such as the framework's primary focus on topology over node attributes and the potential for more sophisticated graphon estimation techniques to handle extremely sparse or irregular graph structures.

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