Does GNN Pretraining Help Molecular Representation?

Ruoxi Sun, Hanjun Dai, Adams Wei Yu · DOI

Abstract

In the fields of Natural Language Processing (NLP) and Computer Vision (CV), the "pretrain-then-finetune" paradigm has become the standard for achieving state-of-the-art performance. Following this success, the Graph Neural Network (GNN) community has increasingly adopted self-supervised pretraining (SSP) to model molecular structures. This paper provides a systematic evaluation of these methods, investigating whether the reported gains in molecular modeling are a result of the pretraining objectives themselves or confounding factors such as feature engineering and hyperparameter optimization. Our findings suggest that current SSP methods offer marginal improvements, often overshadowed by the impact of rich chemical features and rigorous tuning. We propose the "Easy Task" hypothesis to explain why current graph-based pretraining fails to capture deep chemical semantics.

Introduction

Labeling biomedical data is a notoriously resource-intensive process, requiring expert chemists and expensive laboratory assays. To mitigate the scarcity of labeled data, researchers have turned to self-supervised pretraining, hoping to learn the "language of chemistry" from millions of unlabeled molecules. While recent literature frequently claims significant performance boosts from these methods, these results are often difficult to replicate or appear sensitive to specific experimental configurations. This study serves as a reality check, isolating the variables of pretraining to determine its true utility in drug discovery.

Experimental Framework

To provide a definitive answer, we conducted a massive, systematic ablation study. We developed a pipeline designed to isolate every moving part of the GNN training process:

Pretraining Objectives

We evaluated four primary categories of self-supervised tasks:

  • Attribute Masking: Similar to BERT's masked language modeling, this involves hiding node or edge attributes and requiring the GNN to predict them.
  • Context Prediction: The model is tasked with predicting the local neighborhood structure surrounding a specific node.
  • Motif Prediction: The model predicts the presence of specific, chemically relevant functional groups (e.g., benzene rings).
  • Contrastive Learning: The model learns to produce similar embeddings for different "views" or augmentations of the same molecular graph.

Architectures and Features

We compared two standard backbones: the Graph Isomorphism Network (GIN) and GraphSAGE. Crucially, we distinguished between "Basic" features (atom type, chirality) and "Rich" features, which include additional hand-crafted chemical descriptors like hydrogen bond acceptor/donor status. This allowed us to measure the trade-off between automated representation learning and traditional cheminformatics.

Data Splits and Scale

We utilized both random and "Scaffold Splits." The latter sorts molecules by their core chemical structure to test the model's ability to generalize to out-of-distribution chemical spaces—a critical requirement for real-world drug discovery.

Datasets

The study utilized a hierarchy of datasets to test the limits of scale:

  • Unsupervised Pretraining: We used ZINC15 (2 million molecules) and SAVI, a massive dataset of 1 billion molecules, marking its first major use in this evaluative context.
  • Supervised Pretraining: We utilized ChEMBL (500,000 molecules) with 1,310 bio-activity labels to compare self-supervision against task-aligned supervision.
  • Downstream Benchmarks: Models were evaluated on five standard MoleculeNet datasets: BBBP, BACE, Tox21, ToxCast, and SIDER.

Key Insights

The "Easy Task" Hypothesis

In NLP, predicting a missing word from a 100,000-word vocabulary is a complex task requiring deep semantic understanding. In contrast, predicting an atom type in a molecular graph is remarkably simple. With a vocabulary of only ~100 elements and strict valence rules that narrow the possibilities, GNNs reach ~90% pretraining accuracy almost instantly. This suggests the models are solving a simple puzzle rather than learning the underlying principles of chemistry.

Feature Engineering vs. Pretraining

One of our most striking findings was that the inclusion of "Rich" features often provided a larger performance boost than hundreds of hours of SSP. This indicates that current GNN architectures are more effective at utilizing explicit chemical knowledge than they are at extracting it implicitly from unlabeled graphs.

The Scale Paradox

Increasing the pretraining data from 2 million molecules (ZINC15) to 1 billion (SAVI) did not yield significant downstream improvements. This suggests a saturation point where, if the pretraining task is too simple, more data does not translate to better representations.

Hyperparameter Confounding

Our analysis revealed that the choice of learning rate and other hyperparameters for downstream tasks often had a larger impact on the final Area Under the Curve (AUC) than the choice of pretraining method. This suggests that some previously reported successes of SSP may have been the result of more extensive tuning on pretrained models compared to their non-pretrained baselines.

Quantitative Results

  • Self-Supervised Gains: On average, SSP methods provided a marginal gain of only 0.1% to 0.5% over non-pretrained models when using rich features and balanced splits. These gains are often within the margin of error.
  • Supervised Pretraining: Pretraining on ChEMBL (supervised) was significantly more effective, yielding gains of 1.3% to 1.8%. This confirms that task-aligned supervision currently provides more value than structure-only self-supervision.
  • Scaffold Split Sensitivity: While pretraining showed more apparent gains on Scaffold Splits, we argue this is likely due to pretraining acting as a better initialization for optimization in difficult splits, rather than the acquisition of superior chemical knowledge.

Limitations and Future Work

This study focused on 2D graph structures and 1-WL GNNs. Future research should explore:

  1. 3D Geometry: Incorporating spatial coordinates and chirality may make pretraining tasks more challenging and semantically rich.
  2. Expressive Architectures: Graph Transformers and higher-order GNNs may be better equipped to benefit from massive-scale pretraining.
  3. Domain Specificity: These findings are specific to small molecules and may not generalize to large protein-protein interaction networks or other graph domains.

Conclusion

For practitioners in molecular GNNs, pretraining is not a "free lunch." While it can provide a helpful initialization, it is currently no substitute for careful feature engineering and rigorous hyperparameter optimization. Until more challenging and chemically meaningful self-supervised tasks are developed, the "pretrain-then-finetune" paradigm in chemistry will remain less impactful than its counterparts in NLP and CV.

Summary updated

BibTeX
@inproceedings{sun2022does,
  author = {Ruoxi Sun and Hanjun Dai and Adams Wei Yu},
  title = {{Does GNN Pretraining Help Molecular Representation?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=uytgM9N0vlR},
}
Figure