DEFactor: Differentiable Edge Factorization-based Probabilistic Graph Generation

Rim Assouel, Mohamed Ahmed, Marwin H. S. Segler, Amir Saffari, Yoshua BengioarXiv 2018

Abstract

Generating novel molecules with optimal properties is a crucial step in many industries such as drug discovery. Recently, deep generative models have shown a promising way of performing de-novo molecular design. Although graph generative models are currently available they either have a graph size dependency in their number of parameters, limiting their use to only very small graphs or are formulated as a sequence of discrete actions needed to construct a graph, making the output graph non-differentiable w.r.t the model parameters, therefore preventing them to be used in scenarios such as conditional graph generation. In this work we propose a model for conditional graph generation that is computationally efficient and enables direct optimisation of the graph. We demonstrate favourable performance of our model on prototype-based molecular graph conditional generation tasks.

Introduction

Designing new drugs or materials requires identifying molecules that satisfy specific criteria, such as high solubility (LogP) or low toxicity. In machine learning, molecules are represented as graphs where atoms are nodes and bonds are edges. However, generating these graphs is notoriously difficult due to two primary challenges:

  1. The Discreteness Trap: Graphs are discrete structures. The inability to represent "partial bonds" makes it difficult to apply standard deep learning tools like backpropagation, which require smooth, differentiable functions.
  2. The Scaling Wall: Many existing differentiable models rely on fixed-size matrices, limiting them to small molecules (e.g., <10 atoms). Conversely, models capable of handling larger molecules often utilize Reinforcement Learning (RL), which is frequently unstable and difficult to train.

DEFactor addresses these issues by providing a computationally efficient, scalable, and end-to-end differentiable model for conditional graph generation.

Methodology

The DEFactor architecture utilizes a sophisticated encoder-decoder pipeline designed to bridge the gap between scalability and differentiability.

Encoder and Autoregressive Generation

The model employs a Graph Convolutional Network (GCN) to extract features from an input molecule, followed by an LSTM aggregator that compresses these features into a single latent vector ($z$). Unlike models that output a whole graph at once, the DEFactor decoder uses an LSTM to generate a sequence of continuous node embeddings, allowing it to handle graphs of varying sizes.

Edge Factorization

The core innovation of DEFactor is its "edge-specific factors" mechanism. To determine the existence and type of a bond between two generated nodes, the model calculates a similarity score between their embeddings. Because this is a mathematical similarity function rather than a discrete choice, the entire process remains differentiable.

The DEFactor generator architecture using LSTM for node and edge factor generation.

Existence Module

To manage variable graph sizes, the model includes an existence module that predicts the probability that a generated node is part of the final molecule, functioning similarly to an end-of-sequence token in natural language processing.

Experimental Results

The researchers evaluated DEFactor using the ZINC dataset, a standard benchmark of 250,000 drug-like molecular graphs. The model was tested on two primary metrics: reconstruction accuracy and property optimization.

Reconstruction Accuracy

In tasks requiring the model to encode and then accurately decode a molecule, DEFactor achieved a reconstruction accuracy of 89.8%. This represents a significant improvement over previous state-of-the-art models like JT-VAE, which achieved 76.7%.

Reconstruction accuracy comparison between DEFactor and baseline models.

Property Optimization

In LogP (solubility) maximization tasks, DEFactor demonstrated superior performance in constrained optimization. When tasked with improving a "prototype" molecule while maintaining a similarity of at least 0.2, DEFactor achieved an improvement score of 5.55, outperforming the previous leader, GCPN (4.12).

Discussion and Future Work

By making the graph generation process differentiable, DEFactor allows for the use of a "global discriminator." This enables researchers to train a separate network to predict molecular properties and backpropagate the error directly into the generator, providing a clear gradient for property improvement.

However, several areas for future research remain:

  • Node Ordering: As an autoregressive model, DEFactor is sensitive to the order in which atoms are generated, despite molecules lacking a natural sequence.
  • Chemical Validity: While mathematically robust, the model does not inherently "know" chemistry. Future iterations may benefit from explicit chemical valency constraints or discriminators trained on chemical feasibility.
  • Stochastic Mapping: Moving from the current deterministic formulation toward a "one-to-many" mapping would better reflect the reality that multiple structures can satisfy the same property requirements.

Summary updated

BibTeX
@misc{assouel2018defactor,
  author = {Rim Assouel and Mohamed Ahmed and Marwin H. S. Segler and Amir Saffari and Yoshua Bengio},
  title = {{DEFactor: Differentiable Edge Factorization-based Probabilistic Graph Generation}},
  year = {2018},
  eprint = {1811.09766},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.09766},
}
Figure