Molecular generation with exact global count constraints achieved

TopoCompile: Molecular Generation with Exact Global Count Constraints

Machine Learning

Summary

Designing new molecules that meet exact size and composition rules is difficult for AI. The authors developed TopoCompile, a system that builds molecules piece by piece while making sure the overall count of atoms and rings matches targets exactly. It uses a smart method to only pick steps that can still lead to perfect results, which no earlier method could guarantee. This approach works without retraining for different molecule goals and performs very well on tests.

What this means in practice

  • For drug discovery teams: Create novel molecules that meet exact structural counts without retraining models for each target.$Commercial implications: Enables design of drug candidates with strict molecular composition requirements, improving efficiency of pharmaceutical R&D pipelines.
  • For chemical manufacturing engineers: Generate molecular designs with precise elemental and ring composition for synthesis planning and optimization.

Authors

Xiang Wu, Rong-Hua Li, Quanqing Xu, Kangfei Zhao, Guoren Wang

Abstract

Molecular generation designs novel molecules with desired structures and properties. Global count constraints specify molecular size, elemental composition, and ring content without prescribing detailed structure. Property-conditioned generators steer generation toward such targets but do not guarantee exact satisfaction. We introduce TopoCompile, which combines an autoregressive component-tree generator with a dynamic-programming compiler for supported component-additive integer counts. TopoCompile represents molecules as trees of intact ring systems and individual atoms, making each supported count additive over components. At each step, an autoregressive Transformer scores component and attachment actions, while the compiler masks actions with no target-satisfying completion. Within the fixed component vocabulary and typed attachment rules, constrained decoding guarantees exact equality for supported non-negative, component-additive integer counts. Applied at inference time, these checks let the same trained generator support different targets and count combinations without retraining. Across four benchmarks, TopoCompile achieves 100% Exact-valid yield for Common and Rare four-count target groups; the strongest baseline within each dataset reaches 44.9% or less on Rare targets. In unconditional generation, it achieves the highest validity or valid-unique-novel (V.U.N.) among the compared methods across all four benchmark datasets.