A Systematic Comparison Study on Hyperparameter Optimisation of Graph Neural Networks for Molecular Property Prediction

Yingfang Yuan, Wenjun Wang, Wei Pang

Abstract

Graph neural networks (GNNs) have been proposed for a wide range of graph-related learning tasks. In particular, in recent years, an increasing number of GNN systems were applied to predict molecular properties. However, a direct impediment is to select appropriate hyperparameters to achieve satisfactory performance with lower computational cost. Meanwhile, many molecular datasets are far smaller than many other datasets in typical deep learning applications. Most hyperparameter optimization (HPO) methods have not been explored in terms of their efficiencies on such small datasets in the molecular domain. In this paper, we conducted a theoretical analysis of common and specific features for two state-of-the-art and popular algorithms for HPO: TPE and CMA-ES, and we compared them with random search (RS), which is used as a baseline. Experimental studies are carried out on several benchmarks in MoleculeNet, from different perspectives to investigate the impact of RS, TPE, and CMA-ES on HPO of GNNs for molecular property prediction. In our experiments, we concluded that RS, TPE, and CMA-ES have their individual advantages in tackling different specific molecular problems. Finally, we believe our work will motivate further research on GNN as applied to molecular machine learning problems in chemistry and materials sciences.

Introduction

Predicting molecular properties, such as solubility and toxicity, is a cornerstone of modern drug discovery and materials science. While Graph Neural Networks (GNNs) have emerged as powerful tools for these tasks, their performance is highly sensitive to hyperparameter configurations. Selecting optimal settings—such as learning rates and layer sizes—remains a significant challenge due to the high computational cost of training and the relatively small size of many molecular datasets. This study provides a systematic evaluation of three prominent hyperparameter optimization (HPO) techniques: Random Search (RS), Tree-structured Parzen Estimator (TPE), and Covariance Matrix Adaptation Evolution Strategy (CMA-ES), specifically within the context of GNNs for molecular property prediction.

Methodology

The study evaluates HPO strategies on a Graph Convolutional Network (GC) architecture, focusing on four critical hyperparameters: batch size, learning rate, graph convolution layer size, and fully-connected layer size.

HPO Strategies

  1. Random Search (RS): A baseline method that samples configurations randomly. While simple and parallelizable, it lacks the ability to learn from previous iterations.
  2. Tree-structured Parzen Estimator (TPE): A Bayesian approach that uses a probabilistic surrogate model to guide the search toward promising regions of the hyperparameter space.
  3. CMA-ES: An evolutionary algorithm that adapts a multivariate normal distribution to evolve a population of configurations toward optimal performance.

Datasets

Experiments were conducted on three benchmarks from MoleculeNet:

  • ESOL: 1,128 records (water solubility).
  • FreeSolv: 642 records (hydration free energy); characterized by high complexity and small size.
  • Lipophilicity: 4,200 records (octanol/water distribution); the largest dataset in this study.

Results and Discussion

The "Small Data" Paradox

On the smallest dataset, FreeSolv, Random Search demonstrated surprising resilience, occasionally outperforming more sophisticated methods. This suggests that in highly constrained search spaces with very limited data, the stochastic nature of RS can prevent the "local optima" traps that might ensnare model-based or evolutionary approaches.

Efficiency and Time Constraints

Efficiency is a critical metric for practical applications. In a controlled one-hour runtime experiment on the ESOL dataset, TPE emerged as the most effective strategy. Despite completing fewer trials than Random Search due to its internal modeling overhead, TPE achieved superior predictive accuracy.

Table 1: Performance comparison under a 1-hour time constraint on the ESOL dataset.

Performance on Larger Datasets

As dataset size increases, the benefits of informed search strategies become more pronounced. On the Lipophilicity dataset, TPE significantly outperformed both RS and CMA-ES, demonstrating its ability to effectively navigate the search space when provided with sufficient data to build a reliable surrogate model.

Table 2: HPO results on the Lipophilicity dataset.

Stability and Search Space

TPE consistently showed the lowest standard deviation in its results, indicating higher reliability across different runs. Furthermore, when the search space was expanded, both TPE and CMA-ES showed marked improvements, while RS struggled to keep pace, highlighting the scalability of informed HPO methods.

Conclusion

This systematic comparison reveals that while Random Search remains a viable baseline for extremely small datasets, Tree-structured Parzen Estimator (TPE) is generally the most efficient and stable choice for GNN-based molecular property prediction, especially under time constraints. CMA-ES, while powerful, may require more trials or larger search spaces to reach its full potential. Future work will explore "tuning the tuner" for CMA-ES and extending these findings to other GNN architectures.

Summary updated

Abstract

Graph neural networks (GNNs) have been proposed for a wide range of graph-related learning tasks. In particular, in recent years, an increasing number of GNN systems were applied to predict molecular properties. However, a direct impediment is to select appropriate hyperparameters to achieve satisfactory performance with lower computational cost. Meanwhile, many molecular datasets are far smaller than many other datasets in typical deep learning applications. Most hyperparameter optimization (HPO) methods have not been explored in terms of their efficiencies on such small datasets in the molecular domain. In this paper, we conducted a theoretical analysis of common and specific features for two state-of-the-art and popular algorithms for HPO: TPE and CMA-ES, and we compared them with random search (RS), which is used as a baseline. Experimental studies are carried out on several benchmarks in MoleculeNet, from different perspectives to investigate the impact of RS, TPE, and CMA-ES on HPO of GNNs for molecular property prediction. In our experiments, we concluded that RS, TPE, and CMA-ES have their individual advantages in tackling different specific molecular problems. Finally, we believe our work will motivate further research on GNN as applied to molecular machine learning problems in chemistry and materials sciences.
BibTeX
@inproceedings{yuan2021systematic,
  author = {Yingfang Yuan and Wenjun Wang and Wei Pang},
  title = {{A Systematic Comparison Study on Hyperparameter Optimisation of Graph Neural Networks for Molecular Property Prediction}},
  booktitle = {GECCO '21: Proceedings of the Genetic and Evolutionary Computation Conference},
  year = {2021},
  url = {https://openreview.net/forum?id=zY3akF2QFX},
}
Figure