Zero Shot Molecular Generation via Similarity Kernels

Rokas Elijosius, Fabian Zills, Ilyes Batatia, Sam Walton Norwood, Dávid Péter Kovács, Christian Holm, Gábor CsányiarXiv 2024 · DOI

Abstract

Generative models for molecular design often require extensive task-specific training and struggle with scalability to large systems. We present SiMGen (Similarity-based Molecular Generation), a "zero-shot" approach that leverages pretrained machine learning force fields and time-dependent similarity kernels. By comparing local atomic environments to a small reference set, SiMGen steers the generation process toward chemically valid structures without explicit training on the target distribution. Our method enables the design of complex 3D molecules, including large macrocycles, through simple point-cloud priors and interactive design tools.

Introduction

Designing novel molecules with specific properties is a formidable challenge due to the vastness of chemical space. While diffusion-based generative models have shown promise, they are often limited by high training costs, poor scalability for large molecules, and a lack of intuitive control over the generated shapes. Traditional "ab initio" random searches are physically grounded but frequently result in fragmented, non-functional structures. SiMGen addresses these issues by bridging the gap between physical accuracy and deep learning-driven generation, providing a scalable and controllable framework for molecular design.

Methods: The SiMGen Pipeline

The core innovation of SiMGen is the replacement of a learned neural network score with a Similarity Kernel. The process utilizes a pretrained MACE (Many-body Atomic Cluster Expansion) model to provide high-quality descriptors of local atomic environments.

Overview of the SiMGen generation loop, including element mutation via PSO and position updates guided by similarity forces.

The generation follows a multi-step loop as illustrated in Figure 3:

  1. Initialisation: A prior distribution (e.g., a point cloud) defines the initial volume and number of atoms ($N$).
  2. Similarity Kernels: The model calculates a "similarity energy" by comparing an atom's local environment to a reference set (e.g., from QM9). A time-varying kernel width ($\sigma$) is used: it starts large to act as a smooth restorative potential and shrinks over time to resolve fine chemical details.
  3. Alchemical Force via PSO: To handle discrete chemical elements, Particle Swarm Optimization (PSO) is employed to "mutate" atom types, finding the most stable composition for the current geometry.
  4. Refinement: The process concludes with a refinement step where hydrogens are added and the structure is relaxed using the full MACE force field ($F_{QM}$).

Results and Scalability

SiMGen demonstrates remarkable performance without task-specific training. Generated molecules closely match the energy and similarity distributions of the QM9 dataset, achieving 99% atom validity before hydrogenation. Remarkably, the model used local environments from just 256 QM9 molecules as a reference set to achieve these results.

A key strength of SiMGen is its locality; because the similarity kernel only considers an atom's immediate neighborhood (typically within 5.0 Å), the computational cost scales linearly. This allows for the generation of structures far larger than those in the reference data.

Generation of large macrocycles (45 to 111 heavy atoms) using circular point-cloud priors of varying radii.

As shown in Figure 4, by defining a circular point-cloud prior, researchers can generate macrocycles with radii ranging from 4 Å to 10 Å. These structures maintain chemical validity despite being significantly more complex than the small molecules in the QM9 reference set. This capability is further enhanced by ZnDraw, a web-based tool allowing for interactive, real-time molecular design.

Discussion and Limitations

While SiMGen offers a powerful "zero-shot" alternative to traditional generative models, some challenges remain. The hydrogenation step is currently a primary failure point, as adding hydrogens post-hoc can occasionally disrupt the validity of the heavy-atom skeleton. Additionally, the PSO-based element swapping can struggle with single-valence elements like halogens, which may prematurely terminate chain growth. Future work will focus on integrating hydrogen placement more deeply into the generation loop and refining the alchemical optimization process.

Reference: Elijošius, R., et al. (2024). Zero Shot Molecular Generation via Similarity Kernels. arXiv:2402.08708v1.

Summary updated

Abstract

Generative modelling aims to accelerate the discovery of novel chemicals by directly proposing structures with desirable properties. Recently, score-based, or diffusion, generative models have significantly outperformed previous approaches. Key to their success is the close relationship between the score and physical force, allowing the use of powerful equivariant neural networks. However, the behaviour of the learnt score is not yet well understood. Here, we analyse the score by training an energy-based diffusion model for molecular generation. We find that during the generation the score resembles a restorative potential initially and a quantum-mechanical force at the end. In between the two endpoints, it exhibits special properties that enable the building of large molecules. Using insights from the trained model, we present Similarity-based Molecular Generation (SiMGen), a new method for zero shot molecular generation. SiMGen combines a time-dependent similarity kernel with descriptors from a pretrained machine learning force field to generate molecules without any further training. Our approach allows full control over the molecular shape through point cloud priors and supports conditional generation. We also release an interactive web tool that allows users to generate structures with SiMGen online (https://zndraw.icp.uni-stuttgart.de).
BibTeX
@misc{elijosius2024zero,
  author = {Rokas Elijosius and Fabian Zills and Ilyes Batatia and Sam Walton Norwood and Dávid Péter Kovács and Christian Holm and Gábor Csányi},
  title = {{Zero Shot Molecular Generation via Similarity Kernels}},
  year = {2024},
  eprint = {2402.08708},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.08708},
}
Figure