Ranking over regression for Bayesian optimization and molecule selection

Gary Tom, Stanley Lo, Samantha Corapi, Alán Aspuru‐Guzik, Benjamín Sánchez-Lengeling

TL;DR

Bayesian optimization traditionally relies on regression models to predict exact molecular properties, but for drug and materials discovery, finding the best candidate is a matter of relative ranking, not absolute values. This paper introduces Rank-based Bayesian Optimization (RBO), demonstrating that training surrogate models to rank rather than regress yields faster, more robust optimization, especially on rugged chemical landscapes with sharp activity cliffs.

What Problem Does This Paper Address?

In the quest to discover new drugs and materials, scientists increasingly rely on self-driving laboratories guided by Bayesian Optimization (BO). Standard BO loops use a machine learning "surrogate model" to predict the exact property values of untested molecules, helping the algorithm decide which experiment to run next.

However, this approach suffers from a fundamental misalignment: when selecting the best molecule from a library, we don't actually care about predicting its exact solubility or binding affinity down to the third decimal place. We only care about its relative ordering compared to other candidates.

Furthermore, chemical landscapes are notoriously rugged and plagued by "activity cliffs"—scenarios where a tiny modification to a molecule's structure causes its properties to skyrocket or plummet. Traditional regression models (trained using Mean Squared Error) struggle heavily in these zones, often smoothing out the very peaks scientists want to discover or getting thrown off by outliers.

Schematic of regression vs. ranking models applied to chemical systems.

Methods

To bridge this gap, the authors propose Rank-based Bayesian Optimization (RBO). Instead of predicting a scalar property value, the surrogate model is trained to act as a molecule selector by learning relative preferences.

  • Pairwise Ranking Loss: Instead of Mean Squared Error (MSE), RBO utilizes a pairwise marginal ranking loss. This forces the model to minimize ordering errors between pairs of molecules rather than trying to fit absolute values.
  • Surrogate Models: The authors evaluated RBO across several deep learning architectures, including Multi-Layer Perceptrons (MLPs), Bayesian Neural Networks (BNNs), and Graph Neural Networks (GNNs), comparing them against standard Gaussian Process (GP) baselines.
  • Acquisition Function: For probabilistic surrogates (BNN and GNN), the model outputs an uncertainty distribution over the ranks, which is plugged into an Upper Confidence Bound (UCB) acquisition function to balance exploration and exploitation.
Experimental setup for the RBO campaign loop.

Datasets

The framework was benchmarked across two primary sets of chemical data:

  1. ZINC 250k Subset: A collection of 2,000 drug-like molecules evaluated against 12 molecular property oracles from the Therapeutics Data Commons (PyTDC) and GuacaMol benchmarks (e.g., LogP, QED). The structural roughness of these landscapes was explicitly quantified using the Roughness Index (ROGI).
  2. MoleculeACE: A specialized benchmark curated from ChEMBL (v29) containing highly rugged functional spaces and known activity cliffs, evaluating real-world drug discovery metrics like inhibitor constants ($K_i$) and effective concentrations ($EC_{50}$).

Key Insights and Ideas

  • Ranking Smooths the Cliffs: By focusing purely on ordinal relationships (whether Molecule A is better than Molecule B), ranking models are inherently robust against the extreme numerical spikes seen at activity cliffs. This effectively "smooths" the search space for the optimizer.
  • DL Works in Low-Data Regimes: Deep learning models typically fail in early BO iterations because they lack the massive datasets required to map exact quantitative structure-property relationships. However, learning relative order is a simpler task, allowing DL ranking surrogates to perform exceptionally well even with very few starting data points.
  • $R^2$ is a Deceptive Metric: The authors discovered that a surrogate model's regression accuracy ($R^2$) has virtually zero correlation with its ultimate success in a BO campaign. Instead, its ranking ability (measured by Kendall's tau) is the true driver of optimization performance.

Key Results

  • Superior Optimization Speed: Across almost all ZINC targets, deep learning models trained with ranking loss achieved higher BO-AUC (Area Under the Curve for finding top candidates) than their regression-based counterparts, meaning they found the best molecules faster.
  • Outperforming Gaussian Processes: On highly rugged landscapes with activity cliffs (MoleculeACE), rank-based BNNs and MLPs consistently matched or outperformed traditional Gaussian Process (GP) regressors, which are the gold standard for low-data BO but struggle with sharp discontinuities.
  • GNN Breakthroughs: While Graph Neural Networks typically make poor BO surrogates due to data scarcity, switching to a ranking loss allowed a GNN on the "Median 1" task to achieve a BO-AUC of 0.4355—more than triple the performance of the corresponding BNN and MLP models.

Limitations and Future Work

Despite the strong results, the authors note several areas for improvement:

  • Scalability: Pairwise training requires comparing combinations of data points, which scales quadratically ($O(N^2)$). While manageable for these benchmarks via random sampling, it could become a bottleneck for massive molecular libraries.
  • Multi-Objective Optimization: RBO relies on a strict ordinal ranking. Extending this to handle multi-task optimization (e.g., optimizing a drug for high potency and low toxicity simultaneously) remains an open challenge.
  • Uncertainty Quantification: Estimating and calibrating the uncertainty of rank scores is less mature than calculating standard regression variances, which could impact how effectively the acquisition function explores unknown space in later iterations.

Summary updated

BibTeX
@inproceedings{tom2025ranking,
  author = {Gary Tom and Stanley Lo and Samantha Corapi and Alán Aspuru‐Guzik and Benjamín Sánchez-Lengeling},
  title = {{Ranking over regression for Bayesian optimization and molecule selection}},
  booktitle = {APL},
  year = {2025},
  doi = {10.1063/5.0272663},
}
Figure