GraphPiece: Efficiently Generating High-Quality Molecular Graph with Substructures

Xiangzhe Kong, Zhixing Tan, Yang LiuarXiv 2021

Abstract

Molecular design requires navigating a vast chemical space to optimize specific properties. Traditional models often operate at the atom level, which is computationally expensive and prone to validity errors, or use rigid, hand-crafted subgraphs. We present PS-VAE (Principal Subgraph Variational Auto-Encoder), a framework that automatically mines "principal subgraphs"—frequent and informative building blocks—directly from data. By employing a "predict then globally assemble" strategy, PS-VAE achieves state-of-the-art results in property optimization while running up to six times faster than previous leading models.

Introduction

Designing novel molecules with targeted properties, such as high drug-likeness or solubility, is a fundamental challenge in drug discovery. Machine learning approaches typically fall into two categories: atom-level models and subgraph-level models. Atom-level models build molecules sequentially, which offers flexibility but suffers from high computational costs and difficulty in maintaining chemical validity over long sequences. Subgraph-level models use larger fragments as building blocks but often rely on external libraries or rigid rules that may not capture the specific patterns of a given dataset. Furthermore, autoregressive assembly of these fragments can lead to local errors that compromise the global molecular structure.

To address these limitations, the authors introduce PS-VAE. This framework automates the discovery of optimal building blocks and assembles them using a global perspective, bridging the gap between flexibility and efficiency.

Methodology

Principal Subgraph Mining

Inspired by Byte Pair Encoding (BPE) in natural language processing, the framework utilizes a "merge-and-update" algorithm to identify the most frequent subgraphs in a dataset. The process begins with individual atoms and iteratively merges the most frequent adjacent fragments to build a vocabulary of "principal subgraphs." These subgraphs represent the dominant repetitive patterns, effectively capturing the underlying "grammar" of the chemical space.

Algorithm 1: Principal Subgraph Extraction and visual merging process.

Two-Step Global Assembling

Unlike standard step-by-step growth models, PS-VAE utilizes a two-stage decoder:

  1. Fragment Prediction: A Gated Recurrent Unit (GRU) predicts a set of fragments from the latent space.
  2. Global Assembly: A Graph Neural Network (GNN) examines all predicted fragments simultaneously and predicts the bonds between them. This "link prediction" approach is order-invariant and focuses on the overall connectivity, acting as a corrective measure to ensure chemical plausibility.

Experimental Results

The model was evaluated on standard benchmarks, including ZINC250K, QM9, and GuacaMol.

Molecular Property Optimization

PS-VAE outperformed established baselines like JT-VAE and GraphAF in optimizing Penalized logP (solubility) and QED (drug-likeness). Notably, it achieved a top-1 Penalized logP score of 13.95, a significant improvement over previous state-of-the-art models.

Examples of discovered principal subgraphs and their frequencies in the dataset.

Efficiency and Speed

By operating on subgraphs rather than individual atoms, PS-VAE significantly reduces the number of generation steps. On average, it requires ~7 steps to generate a molecule, compared to ~57 steps for atom-level models. This results in an inference speed approximately 6x faster than GraphAF, the fastest previous autoregressive baseline.

Conclusion

PS-VAE demonstrates that data-driven subgraph mining can discover chemically meaningful motifs that hand-crafted rules might miss. By combining these building blocks with a global assembly strategy, the model achieves superior optimization performance and remarkable efficiency. Future work will focus on improving inter-fragment encoding and addressing the challenges of "coarse" modifications in constrained optimization tasks.

Summary updated

BibTeX
@misc{kong2021graphpiece,
  author = {Xiangzhe Kong and Zhixing Tan and Yang Liu},
  title = {{GraphPiece: Efficiently Generating High-Quality Molecular Graph with Substructures}},
  year = {2021},
  url = {https://openreview.net/forum?id=b5Tu6W_XBFK},
}

Loading related content...

Figure