Abstract
Variational autoencoder (VAE) is a popular method for drug discovery and there had been a great deal of architectures and pipelines proposed to improve its performance. But the VAE model itself suffers from deficiencies such as poor manifold recovery when data lie on low-dimensional manifold embedded in higher dimensional ambient space and they manifest themselves in each applications differently. The consequences of it in drug discovery is somewhat under-explored. In this paper, we study how to improve the similarity of the data generated via VAE and the training dataset by improving manifold recovery via a 2-stage VAE where the second stage VAE is trained on the latent space of the first one. We experimentally evaluated our approach using the ChEMBL dataset as well as a polymer datasets. In both dataset, the 2-stage VAE method is able to improve the property statistics significantly from a pre-existing method.
Introduction
In the quest for novel therapeutics, generative models like Variational Autoencoders (VAEs) are frequently employed to navigate the vast chemical space. These models compress high-dimensional molecular representations (such as SMILES strings or molecular graphs) into a lower-dimensional latent space to facilitate sampling and optimization. However, valid and useful molecules typically occupy a very specific, low-dimensional subspace known as a manifold.
Standard VAEs often struggle with "manifold recovery." While they may learn the basic chemical grammar required to generate valid structures, they frequently fail to capture the underlying property distributions (e.g., molecular weight, solubility) of the training data. This results in generated molecules that, while chemically plausible, do not match the "rhythm" or physical characteristics of real-world drug candidates.
Methodology
To address this, we propose a 2-Stage VAE approach that decouples the task of learning the manifold structure from the task of learning the data density within that manifold.
- Stage I (Manifold Learning): A standard VAE is trained on molecular data ($X$). As training progresses, the decoder variance is encouraged to approach zero, forcing the model to map the data accurately onto the low-dimensional manifold ($V$).
- Stage II (Density Estimation): A second VAE is trained specifically on the latent vectors ($V$) produced by Stage I. This stage learns a refined distribution ($Z$) that better represents the actual density of valid molecules in the latent space.
- Generation: New molecules are generated by sampling from a simple Gaussian, passing the sample through the Stage II decoder to obtain a refined latent vector, and finally passing that vector through the Stage I decoder to produce the molecular structure ($X'$).
Experimental Evaluation
We evaluated our approach using two distinct molecular domains: the ChEMBL dataset (~1.8 million bioactive molecules) and a Polymer dataset (~86,000 entries). We tested the 2-stage enhancement on two different base architectures: a Hierarchical Graph Neural Network (HGNN) and a vanilla RNN.
Key Results
The most significant improvements were observed with the HGNN architecture. By applying the second stage, we were able to drastically reduce the Wasserstein distance—a metric for distributional mismatch—between the generated molecules and the test set across several key properties:
- Molecular Weight (MW): In the ChEMBL dataset, the mismatch dropped from 68.8 (Stage 1) to 5.0 (Stage 2).
- Drug-likeness (QED): The mismatch was reduced from 0.024 to 0.0067.
- Solubility (LogP): The mismatch fell from 0.92 to 0.095.
On the Polymer dataset, the 2-stage HGNN similarly improved the MW mismatch from 72.2 to 7.7. These results indicate that the 2-stage process effectively "corrects" the latent space, ensuring that generated samples mirror the physical characteristics of the training data.
Conclusion
Our study demonstrates that a 2-stage VAE significantly improves manifold recovery and property distribution matching in molecular generation. Interestingly, the benefit was highly dependent on the base architecture; while the HGNN saw massive gains, the RNN showed limited improvement. This suggests that the effectiveness of the 2-stage approach relies on the first-stage decoder's ability to satisfy specific mathematical conditions during training. Future work will investigate these architectural sensitivities to develop a more universal enhancement for molecular generative pipelines.
Summary updated