Skip to main content
QUICK REVIEW

[Paper Review] A Graph VAE and Graph Transformer Approach to Generating Molecular Graphs

Joshua Mitton, Hans Martin Senn|arXiv (Cornell University)|Apr 9, 2021
Machine Learning in Materials ScienceMaterials Science11 citations
TL;DR

This paper proposes a novel graph VAE and transformer hybrid model that generates molecular graphs with both node and edge features by leveraging graph convolutional networks, differentiable graph pooling, and a transformer with a novel node encoding for edge prediction. The model achieves state-of-the-art performance in generating valid, unique, and novel molecules on the QM9 dataset while learning a disentangled, interpretable latent space for controlled generation of molecules with desired properties.

ABSTRACT

We propose a combination of a variational autoencoder and a transformer based model which fully utilises graph convolutional and graph pooling layers to operate directly on graphs. The transformer model implements a novel node encoding layer, replacing the position encoding typically used in transformers, to create a transformer with no position information that operates on graphs, encoding adjacent node properties into the edge generation process. The proposed model builds on graph generative work operating on graphs with edge features, creating a model that offers improved scalability with the number of nodes in a graph. In addition, our model is capable of learning a disentangled, interpretable latent space that represents graph properties through a mapping between latent variables and graph properties. In experiments we chose a benchmark task of molecular generation, given the importance of both generated node and edge features. Using the QM9 dataset we demonstrate that our model performs strongly across the task of generating valid, unique and novel molecules. Finally, we demonstrate that the model is interpretable by generating molecules controlled by molecular properties, and we then analyse and visualise the learned latent representation.

Motivation & Objective

  • To address the challenge of generating chemically valid, unique, and novel molecular graphs with both node and edge features.
  • To improve scalability of graph generative models by reducing memory complexity from O(k²) to O(k) compared to prior MLP-based approaches.
  • To learn a disentangled, interpretable latent space that maps to specific molecular properties for controlled generation.
  • To replace position encoding in transformers with a novel node encoding that incorporates adjacent node information for graph-agnostic edge prediction.
  • To demonstrate state-of-the-art performance in molecular generation without relying on expensive graph matching algorithms.

Proposed method

  • The model uses a GraphSAGE-based encoder with DIFFPOOL for differentiable graph pooling to produce a c-dimensional latent representation z from input molecular graphs.
  • A graph decoder reconstructs node features using an inverse DIFFPOOL and GraphSAGE procedure, sampling from a standard normal distribution in the latent space.
  • A transformer-based edge predictor replaces traditional MLPs, using a novel node encoding that injects information about neighboring nodes into edge generation.
  • The node encoding replaces standard positional embeddings, enabling the transformer to operate on graphs without order bias while encoding structural relationships via adjacent node features.
  • A disentangled latent space is enforced by mapping specific latent dimensions to individual molecular properties, enabling controlled generation.
  • Graph-level properties such as dipole moment and ZPVE are predicted from the latent space, ensuring structural alignment between latent variables and chemical properties.

Experimental results

Research questions

  • RQ1Can a hybrid graph VAE and transformer model generate molecular graphs with both node and edge features while maintaining high validity, uniqueness, and novelty?
  • RQ2How does the proposed node encoding in the transformer improve edge prediction and scalability compared to MLP-based approaches?
  • RQ3To what extent does the model learn a disentangled and interpretable latent space that enables controlled generation of molecules with specific properties?
  • RQ4Can the model achieve state-of-the-art performance in molecular generation without relying on expensive graph matching algorithms?
  • RQ5How does the memory complexity scale with graph size, and can it be further optimized for larger molecules?

Key findings

  • The model achieves 74.6% validity, 22.5% uniqueness, 93.9% novelty, and 15.8% for all three metrics combined on the QM9 dataset, outperforming prior models in the combined metric.
  • The model reduces memory complexity from O(k²) to O(k) compared to MLP-based graph generation, significantly improving scalability for larger graphs.
  • The disentangled latent space enables controlled generation of molecules with desired properties, as demonstrated by gradual changes in dipole moment across uniformly spaced latent vectors.
  • Visualizations confirm that specific latent dimensions correspond to distinct molecular properties such as dipole moment (μ) and zero-point vibrational energy (ZPVE), validating interpretability.
  • The model outperforms MolGAN and GraphVAE in multiple metrics, even when it is slightly behind in one, demonstrating superior overall performance.
  • The use of a novel node encoding in the transformer allows for effective edge prediction without positional bias, enhancing generalization on graph-structured data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.