Score-Based Generative Models for Molecule Generation

Dwaraknath Gnaneshwar Talupuru, Dwaraknath Gnaneshwar, Bharath Ramsundar, Dhairya Gandhi, Rachel C. Kurchin, Venkatasubramanian ViswanathanarXiv 2022 · DOI

Abstract

This paper investigates the application of score-based generative models—a class of models that learn the gradient of a probability distribution—to the task of de novo molecule generation. By training a Transformer-based score function on 1.5 million molecules represented as SELFIES strings, the authors demonstrate a flexible alternative to traditional generative frameworks like GANs and VAEs. The resulting model produces highly diverse and 100% novel compounds, highlighting the potential of architectural agnosticism in chemical space exploration.

Introduction

Designing new molecules with specific properties is a cornerstone of drug discovery, yet the "chemical space" is vast and difficult to navigate. Traditional generative models, such as Variational Autoencoders (VAEs) and Normalizing Flows (NFs), often require restrictive architectures to ensure tractable likelihood calculations. Conversely, Generative Adversarial Networks (GANs) avoid these constraints but suffer from training instability.

To address these limitations, this work applies score-based generative modeling. Instead of directly calculating probability density, these models learn the "score function"—the gradient of the log-probability density. This approach decouples the generative objective from the model architecture, allowing the use of powerful, off-the-shelf models like Transformers without the mathematical constraints inherent in VAEs or NFs.

Methods

The researchers treat molecule generation as a sequence modeling task using the following components:

  1. Representation: Molecules are represented using SELFIES (Self-Referencing Embedded Strings). Unlike SMILES, SELFIES are designed so that almost any combination of symbols results in a chemically valid molecule, which is critical for robust generation.
  2. The Score Function: A Transformer encoder (6 layers, 512 hidden dimensions) serves as the score function.
  3. Training: The model is trained via denoising score matching, where it learns to "denoise" molecular representations corrupted by 350 different levels of Gaussian noise. This process allows the model to learn the underlying data distribution's structure.
  4. Sampling: New molecules are generated using annealed Langevin Dynamics, starting from random noise and iteratively moving toward regions of higher probability using the learned score function.
Overview of the score-based generative modeling pipeline using SELFIES representations and a Transformer score function.

Datasets and Evaluation

The model was trained on a 1.6 million sample subset of the ZINC dataset, containing drug-like compounds. Evaluation was performed using the Molecular Sets (MOSES) benchmarking framework, comparing the model's output quality, diversity, and novelty against standard baselines such as HMMs and VAEs.

Key Results

The score-based model demonstrated several significant advantages over traditional baselines:

  • Validity & Novelty: The model achieved a perfect score of 1.0 (100%) in both validity and novelty. Every generated molecule was chemically legal, and none were present in the training set.
  • Diversity: It achieved an IntDiv1 score of 0.90, outperforming the VAE (0.85) and JTN-VAE (0.85). This indicates that the model is particularly effective at exploring the "fringes" of chemical space rather than collapsing around common training samples.
  • Distribution Matching Trade-off: The model struggled with the Fréchet ChemNet Distance (FCD), scoring 39.84 compared to the VAE's ~0.09. This suggests that while the generated molecules are valid and unique, their global chemical features do not yet perfectly mirror the ZINC training distribution.
Performance comparison of the score-based model against HMM, VAE, and JTN-VAE baselines.

Key Insights and Discussion

The primary advantage of this approach is architectural agnosticism. Because the model does not need to be invertible or have a tractable normalizing constant, researchers can "drop in" standard Transformer architectures. The use of SELFIES further ensures 100% chemical validity, a persistent challenge for string-based models.

However, the high FCD and low "Filters" score (0.37) indicate that the model generates "unusual" molecules that may not always resemble typical drug candidates. This suggests that while the model is excellent at diversity, it may currently lack the representational power to capture the finer nuances of the training distribution.

Future Work

Future research directions include moving from string representations to direct generation of molecular graphs and incorporating SE(3) equivariant layers to generate 3D molecular conformations. Additionally, the authors aim to investigate whether larger Transformer architectures can improve distribution matching and lower the FCD score.

Summary updated

BibTeX
@misc{talupuru2022score,
  author = {Dwaraknath Gnaneshwar Talupuru and Dwaraknath Gnaneshwar and Bharath Ramsundar and Dhairya Gandhi and Rachel C. Kurchin and Venkatasubramanian Viswanathan},
  title = {{Score-Based Generative Models for Molecule Generation}},
  year = {2022},
  eprint = {2203.04698},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.04698},
}
Figure