A Deep Generative Model for Fragment-Based Molecule Generation

Marco Podda · OpenReview

TL;DR

This paper introduces a novel fragment-based deep learning model for generating novel and valid molecular structures. By generating molecules from pre-defined molecular fragments rather than individual atoms, and employing a frequency-based masking strategy to encourage diversity, the model achieves state-of-the-art performance comparable to more complex graph-based methods, while overcoming common limitations of traditional language model approaches.

What Problem Does This Paper Address?

The de novo design of molecules, particularly for drug discovery, is a complex challenge. Current deep learning approaches for generating molecules fall into two main categories: those that represent molecules as strings of text (like SMILES) and use language models, and those that operate directly on molecular graphs. While graph-based methods are more expressive, they are harder to train and sample from. Language model-based (LM-based) approaches, though easier to train, often suffer from generating chemically invalid molecules and an abundance of duplicates. This paper aims to bridge this gap by improving the validity and uniqueness of molecules generated by LM-based models, bringing them closer to the performance of graph-based methods.

Methods

The core innovation lies in a two-pronged approach:

  1. Fragment-Based Language Modeling: Instead of generating molecules atom-by-atom, the model breaks down molecules into smaller, chemically stable substructures called "fragments." These fragments are then treated as "words" in a language model. This approach is inspired by Fragment-Based Drug Design (FBDD), where small fragments are combined to build larger molecules. The key advantage is that by ensuring the validity of individual fragments and the connections between them, the overall molecule generation process inherently leads to higher validity rates. The fragmentation process itself uses the BRICS algorithm to break bonds and identify fragments, ensuring a reversible process for reconstruction.
  2. Low-Frequency Masking (LFM): To combat the issue of generating duplicate molecules, the authors introduce a frequency-based masking strategy. They observe that fragment distributions in datasets often follow a power law, with a few very common fragments and many rare ones. LFM masks less frequent fragments during training with a special token that encodes their frequency and attachment points. During generation, when this token is encountered, the model samples from the set of masked fragments, thereby increasing the probability of generating molecules with less common substructures and boosting overall diversity.

The overall architecture follows a standard encoder-decoder framework. An encoder (using GRUs) maps the sequence of fragment embeddings into a latent space, and a decoder (also using GRUs) reconstructs the fragment sequence. The model is trained end-to-end to minimize a combined encoder and decoder loss, which includes a Kullback-Leibler divergence term to regularize the latent space.

Datasets

The authors evaluate their model on two large datasets:

  • ZINC: A widely used benchmark dataset of approximately 250,000 drug-like compounds.
  • PubChem BioAssay (PCBA): A larger dataset of approximately 440,000 small molecules.

They also mention attempting to use the QM9 dataset but found it unsuitable due to a high proportion of single-fragment molecules.

Key Insights and Ideas

  • Fragment-level generation is a powerful shortcut to validity: By building molecules from pre-validated fragments, the model bypasses the need for complex post-hoc validity checks that plague atom-based LM approaches.
  • Power-law distributions are a key to diversity: Recognizing the skewed distribution of molecular fragments and leveraging it through LFM is crucial for generating unique molecules.
  • LM-based models can rival graph-based performance: The paper demonstrates that with the right representation and generation strategy, simpler LM-based models can achieve performance comparable to more complex graph-based architectures.
  • Generated molecules reflect training data properties without explicit supervision: The model generates molecules with similar structural features and physicochemical properties (like logP, QED, SAS) to the training data, even without being explicitly trained for these properties.

Key Results

  • Perfect Validity: The model achieves perfect validity scores on the ZINC dataset and high validity on PCBA, significantly outperforming other LM-based baselines and matching graph-based approaches.
  • High Uniqueness: The Low-Frequency Masking (LFM) strategy dramatically improves uniqueness rates, especially on the PCBA dataset, bringing LM-based models to competitive levels with graph-based methods.
  • Competitive Novelty: While LFM primarily boosts uniqueness, it also provides a small improvement in novelty compared to the vanilla fragment-based model.
  • Efficiency: The model requires O(F) decoding steps (where F is the number of fragments, typically 2-3) compared to O(C) for character-based models (where C is the number of characters in a SMILES string), making generation faster.

Limitations and Future Work

  • Molecular Optimization: The authors acknowledge that their current model, due to the stochastic nature introduced by LFM, might not be ideal for molecular optimization tasks where a smooth latent space is preferred.
  • Fragment Space Structure: The stochasticity of LFM might lead to a less structured latent space, which could be a limitation for tasks requiring fine-grained control over molecular properties.
  • Future Directions: The authors suggest extending the model for molecular optimization, designing strategies to maintain high uniqueness while preserving latent space smoothness, and adapting the fragment-based paradigm to graph-based molecular generators.

Summary updated

Abstract

Molecule generation is a challenging open problem in cheminformatics. Currently, deep generative approaches addressing the challenge belong to two broad categories, differing in how molecules are represented. One approach encodes molecular graphs as strings of text, and learns their corresponding character-based language model. Another, more expressive, approach operates directly on the molecular graph. In this work, we address two limitations of the former: generation of invalid and duplicate molecules. To improve validity rates, we develop a language model for small molecular substructures called fragments, loosely inspired by the well-known paradigm of Fragment-Based Drug Design. In other words, we generate molecules fragment by fragment, instead of atom by atom. To improve uniqueness rates, we present a frequency-based masking strategy that helps generate molecules with infrequent fragments. We show experimentally that our model largely outperforms other language model-based competitors, reaching state-of-the-art performances typical of graph-based approaches. Moreover, generated molecules display molecular properties similar to those in the training sample, even in absence of explicit task-specific supervision.
BibTeX
@inproceedings{podda2020deep,
  author = {Marco Podda},
  title = {{A Deep Generative Model for Fragment-Based Molecule Generation}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2020},
}
Figure