Rethinking the generalization of drug target affinity prediction algorithms via similarity aware evaluation

Chenbin Zhang, Zhiqiang Hu, Chuchu Jiang, Wen Chen, Jie Xu, Shaoting Zhang

TL;DR

Conventional random dataset splits mask the poor performance of drug-target affinity prediction models on novel, structurally distinct molecules. This paper introduces Similarity Aware Evaluation (SAE), an optimization-based data-splitting framework that allows researchers to precisely control the similarity distribution of test sets, exposing hidden generalization gaps and guiding more robust model development.

What Problem Does This Paper Address?

Predicting Drug-Target Binding Affinity (DTA) is a cornerstone of virtual screening in early-stage drug discovery. To evaluate these machine learning models, researchers traditionally rely on a canonical randomized split to separate data into training and test sets. This approach assumes that data points are Independent and Identically Distributed (I.I.D.).

However, chemical space is highly clustered, and real-world drug discovery explicitly demands the discovery of novel therapeutic molecules, not just minor variations of known ones. The authors reveal a critical flaw in current benchmarking: randomized splits create test sets overwhelmingly dominated by molecules highly similar to the training set. This distribution creates an illusion of high accuracy, hiding the fact that model performance severely degrades when encountering structurally distinct, low-similarity compounds.

Methods

To expose and fix this blind spot, the authors propose Similarity Aware Evaluation (SAE). They frame dataset splitting as a combinatorial optimization problem designed to match any user-specified target similarity distribution across predefined bins. Because combinatorial optimization is computationally intractable for large datasets, they introduce three key innovations to make the problem continuous and differentiable:

  1. Continuous Relaxation: Each sample is assigned a continuous weight $w_i \in [0, 1]$, representing its probability of being assigned to the test set.
  2. Differentiable Approximations: The non-differentiable max function (used to find a sample's highest similarity to any training instance) is approximated using a smooth LogSumExp formulation. Similarly, the discrete bin-counting operation is replaced with a continuous score based on a Gaussian-bell curve and a softmax function.
  3. Lagrangian Optimization & Regularization: The resulting constrained optimization problem is solved efficiently via gradient descent using Lagrangian multipliers. An entropy-based regularization term is added to penalize fractional weights, forcing the final continuous probabilities to cleanly converge to a binary split (0 or 1).

Datasets

The framework was validated using real-world biochemical datasets extracted from BindingDB and ChEMBL:

  • BindingDB Datasets: Used to evaluate IC50 values for targets EGFR (4,361 samples) and BACE1 (4,636 samples), alongside Ki values for Carbonic anhydrase I (5,307 samples) and Carbonic anhydrase II (5,487 samples).
  • External Validation Set: For a realistic "mimic split" experiment, internal data was sourced from ChEMBL, while external test data was gathered from PubChem, US Patents, and diverse scientific literature.

Key Insights and Ideas

  • The Performance Illusion: In a standard random split of the EGFR dataset, roughly 88% of the test samples share high similarity (>2/3) with the training set. A state-of-the-art model might boast an impressive overall $R^2$ of 0.65, but diving deeper reveals its $R^2$ plummets to -0.6385 on the few low-similarity samples present.
  • Customizable Benchmarking: Unlike rigid splitting techniques (e.g., scaffold splits), SAE gives practitioners complete control. Researchers can design a perfectly uniform test set across similarity tiers or force the split to mirror the exact distribution of an independent external dataset.

Key Results

The authors evaluated five representative deep learning architectures (FusionDTA, ChemBERTa, MolCLR, PharmHGT, and SAM-DTA) using the SAE framework.

  • Achieving Balance: SAE successfully restructured the EGFR test set from its highly skewed baseline into a perfectly uniform distribution (~33% low, ~34% mid, and ~33% high similarity).
  • Exposing the Gradient: As shown in the evaluation plots, every single model exhibited a stark, step-wise degradation in Mean Absolute Error (MAE) and $R^2$ as the structural similarity to the training set decreased.
Comparison of randomized split and SAE balanced split at IC50 for EGFR
  • Superior Hyperparameter Tuning: By utilizing a "mimic split"—where the internal validation set was optimized to match the distribution of a true external dataset—SAE allowed researchers to select optimal hyperparameters. This led to significantly better generalization on external benchmarks compared to models tuned via random or scaffold splits.

Limitations and Future Work

The primary bottleneck of SAE is its computational complexity. Calculating the continuous relaxation requires computing a full pairwise similarity matrix, leading to a time and space complexity of $O(N^2)$ per iteration. While highly manageable for standard academic datasets (taking roughly 270 seconds for ~4,300 samples on a single NVIDIA 3090 GPU), it becomes restrictive for massive proprietary corporate libraries containing millions of compounds.

To address this, the authors note that more than 95% of pairwise molecular similarities are close to zero. They suggest that future implementations can leverage sparse matrix representations and low-bit quantization to scale SAE efficiently to millions of compounds.

Summary updated

Abstract

Drug-target binding affinity prediction is a fundamental task for drug discovery. It has been extensively explored in literature and promising results are reported. However, in this paper, we demonstrate that the results may be misleading and cannot be well generalized to real practice. The core observation is that the canonical randomized split of a test set in conventional evaluation leaves the test set dominated by samples with high similarity to the training set. The performance of models is severely degraded on samples with lower similarity to the training set but the drawback is highly overlooked in current evaluation. As a result, the performance can hardly be trusted when the model meets low-similarity samples in real practice. To address this problem, we propose a framework of similarity aware evaluation in which a novel split methodology is proposed to adapt to any desired distribution. This is achieved by a formulation of optimization problems which are approximately and efficiently solved by gradient descent. We perform extensive experiments across five representative methods in four datasets for two typical target evaluations and compare them with various counterpart methods. Results demonstrate that the proposed split methodology can significantly better fit desired distributions and guide the development of models. Code is released at https://github.com/Amshoreline/SAE/tree/main.
BibTeX
@inproceedings{zhang2025rethinking,
  author = {Chenbin Zhang and Zhiqiang Hu and Chuchu Jiang and Wen Chen and Jie Xu and Shaoting Zhang},
  title = {{Rethinking the generalization of drug target affinity prediction algorithms via similarity aware evaluation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=j7cyANIAxV},
}
Figure