NEVAE: A Deep Generative Model for Molecular Graphs

Bidisha Samanta, Abir De, Gourhari Jana, Vicenç Gómez, Pratim Kumar Chattaraj, Niloy Ganguly, Manuel Gomez-Rodriguez

Abstract

Deep generative models have been praised for their ability to learn smooth latent representations of images, text, and audio, which can then be used to generate new, plausible data. Motivated by these success stories, there has been a surge of interest in developing deep generative models for automated molecule design. However, these models face several difficulties due to the unique characteristics of molecular graphs—their underlying structure is not Euclidean or grid-like, they remain isomorphic under permutation of the nodes’ labels, and they come with a different number of nodes and edges. In this paper, we first propose a novel variational autoencoder for molecular graphs, whose encoder and decoder are specially designed to account for the above properties by means of several technical innovations. Moreover, in contrast with the state of the art, our decoder is able to provide the spatial coordinates of the atoms of the molecules it generates. Then, we develop a gradient-based algorithm to optimize the decoder of our model so that it learns to generate molecules that maximize the value of certain property of interest and, given any arbitrary molecule, it is able to optimize the spatial configuration of its atoms for greater stability. Experiments reveal that our variational autoencoder can discover plausible, diverse and novel molecules more effectively than several state of the art models. Moreover, for several properties of interest, our optimized decoder is able to identify molecules with property values 121% higher than those identified by several state of the art methods based on Bayesian optimization and reinforcement learning.

Introduction

Automated molecule design is a "holy grail" for drug discovery, but representing molecules for deep learning is notoriously difficult. Researchers typically use two approaches: text-based SMILES strings, which often fail to capture structural similarity, or molecular graphs, where atoms are nodes and bonds are edges. While graphs are more natural, existing generative models face hurdles: they often require a fixed number of atoms, lack permutation invariance, and ignore 3D spatial configuration—critical for chemical behavior.

Methods: The NEVAE Architecture

The authors introduce NEVAE (Node-based Variational Autoencoder), which features several technical innovations to address the unique challenges of molecular graphs.

Schematic overview of the NEVAE architecture, illustrating the permutation-invariant encoder and the generation of latent 3D coordinates.

Key components include:

  • Permutation-Invariant Encoder: Uses symmetric aggregator functions to gather neighbor information, ensuring the latent representation is independent of node labeling.
  • Efficient Multinomial Decoder: Employs a multinomial edge distribution with $O(l)$ complexity (where $l$ is the number of edges), avoiding the quadratic $O(n^2)$ cost of checking every possible atom pair.
  • Chemical Masking: A masking layer enforces valency constraints (e.g., Carbon's four-bond limit), ensuring 100% chemical validity.
  • 3D Coordinate Generation: Models atom positions using a Gaussian distribution, allowing the output of 3D structures.
  • Property-Oriented Optimization: A gradient-based algorithm optimizes the decoder parameters directly using the "log-derivative trick" to maximize properties like solubility (logP) or drug-likeness (QED).

Experimental Evaluation

NEVAE was evaluated on synthetic graphs and real-world datasets including ZINC (~10,000 drug-like molecules) and QM9 (~10,000 small organic molecules).

Key Results

  • Superior Discovery: On ZINC, NEVAE identified molecules with penalized logP values 121% higher than state-of-the-art competitors like JTVAE or GCPN.
  • Quality Metrics: The model achieved 100% validity (with masking) and high uniqueness and novelty.
  • Scalability: Linear scaling with edges allows efficient handling of graphs with up to 1,000 nodes.
  • 3D Stability: NEVAE can optimize spatial configurations to reach lower Single Point Energy (SPE), enhancing chemical stability.

Discussion and Future Work

By incorporating chemical inductive biases (valency) and moving beyond traditional Bayesian Optimization to direct decoder optimization, NEVAE sets a new benchmark for molecular generation.

While the current model does not explicitly incorporate atomic charges or guarantee strict rotational invariance, it demonstrates significant improvements in stability and property optimization. Future work may extend NEVAE to dynamic graphs to model chemical reactions or retro-synthesis.

Summary updated

BibTeX
@article{samanta2020nevae,
  author = {Bidisha Samanta and Abir De and Gourhari Jana and Vicenç Gómez and Pratim Kumar Chattaraj and Niloy Ganguly and Manuel Gomez-Rodriguez},
  title = {{NEVAE: A Deep Generative Model for Molecular Graphs}},
  journal = {J. Mach. Learn. Res.},
  year = {2020},
  url = {https://openreview.net/forum?id=dv21A8X8tT_},
}
Figure