liveBook · Manning

Generative modeling

As explained in Build AI Drug Discovery Pipelines

A generative model learns patterns or a probability distribution from data and can produce new samples with similar characteristics.

Generative modeling learns patterns or a probability distribution from data and uses what it learns to produce new samples. In drug discovery, a model can learn from known molecules and propose new structures for investigation, potentially including structures absent from existing databases. section 1.2.2 section 10.1.2

De novo molecular design starts with desired properties, such as high solubility and low toxicity, and seeks structures that may have them. By contrast, virtual screening starts with a library of compounds and uses a predictive model to filter it for desirable properties. section 1.3.2

Figure 1.9 In virtual screening, we start with a large, diverse library of compounds that we can filter using a predictive model that has learned to predict what properties each compound has. Our predictive model has learned how to map the chemical space to the functional space. If the compound is predicted to have optimal properties, we carry it over for further experiments. In de novo design, we start with a defined set of property criteria that we can use along with a generative model to generate the structure of our ideal drug candidate. Our generative model knows how to map the functional space to the chemical space.

Compare the directions of the two searches: screening predicts properties from structures, while de novo design uses property criteria to guide structure generation. section 1.3.2

Many molecular generators use a latent space: a compressed, continuous representation of molecules. Think of it as a map learned from molecular examples. Rather than making discrete changes to atoms and bonds one at a time, a model can navigate this representation and decode points into candidate structures. The goal is to make useful regions of the map easier to explore; the map is learned, not a guarantee that every point produces a useful molecule. section 10.1 section 10.1.2

One route to a molecular generator builds on autoencoders:

  • A basic autoencoder encodes and reconstructs molecular SMILES strings, a sequential representation of molecules. Good reconstruction of familiar molecules alone does not ensure successful generation: an unstructured latent space can make new, valid samples difficult to obtain. section 10.5
  • A variational autoencoder maps each molecule to a probability distribution rather than a single point. Its loss combines reconstruction with a KL divergence term that regularizes the latent space, supporting generation by sampling. section 10.5
  • The reparameterization trick permits training through sampling. Cyclical annealing adjusts the KL weight to combat posterior collapse, while gated recurrent units handle the sequential nature of SMILES. section 10.5

Generated candidates still need evaluation. A predictive model can estimate properties such as solubility or toxicity and provide feedback for further proposals. If the scoring function is weak or easy to game, the generator may favor high-scoring molecules that are unstable, unrealistic, or impossible to synthesize. Novelty alone does not establish therapeutic benefit. section 13.1.2 section 1.3.2 section 13.4.1

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Develops autoencoders into variational autoencoders, explaining latent-space regularization, sampling, and training difficulties.
Examples
Uses molecular SMILES reconstruction and Chemistry42-generated scaffolds compared with ChEMBL to illustrate generation and novelty.
What you can do after
Build it from scratch as a molecular generator using an autoencoder and variational autoencoder approach.
How it connects
Connects latent space, property prediction, virtual screening, and active learning to molecular design.

Also explained in

Compare how 32 books explain generative modeling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.