Drug discovery requires efficient exploration of an astronomically large chemical space. Molecular graph diffusion models offer a promising approach to this task, but many require graph size to be fixed before generation. Although atom-level insertion and deletion can enable flexible-size generation, jointly modeling molecular size, atom types, and bonds while maintaining chemical validity remains challenging. We introduce FragFlex, a flexible-length discrete diffusion model that performs node insertion and deletion at the fragment level. During denoising, FragFlex jointly learns the size, fragment identities, and inter-fragment connectivity of the fragment graph. A neural attachment-site predictor and valence-aware assembler then convert the generated fragment graph into an atom-level molecule. In large-scale experiments generating 10 million molecules, FragFlex achieves near-perfect chemical validity while maintaining high uniqueness, demonstrating a strong balance between the two.
Figures & tables
Figure 1: Overview of FragFlex. An atom-level molecule M is preprocessed into a clean fragment graph G0 . Forward diffusion applies categorical noise Qˉt and structural deletion ζ′(t) while protecting one root, yielding the single-fragment state GT . During sampling, gϕ predicts the insertion count Δt , and fθ predicts the node types and edge connections of the added \textscdel∗ placeholders. At the final denoising step, predicted attachment sites guide the valence-aware assembly of the final molecule.
Figure 2
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Symbol
Meaning
M
Atom-level molecule.
V={F1,…,FK}
Fixed vocabulary of K molecular fragments.
G0=(X0,E0,S0)
Clean fragment graph with fragment labels, binary fragment edges, and directed attachment sites.
Gt
Fragment graph after structural deletion and categorical corruption at timestep t .
V0={1,…,N}
Node set of the clean fragment graph.
Ai
Number of atoms in the fragment assigned to node i .
Appendix
Table 2: Notation used in the main text and Appendix A .
Component
Setting
Diffusion
T=500 with a cosine noise schedule αˉt ( s=0.008 )
Deletion/insertion schedule
Logistic ζ′(t) with sp=0 , w=0.05
Terminal prior GT
One fragment from the empirical fragment marginal
Main denoiser fθ
7 layers, node width 384, edge width 96, 8 heads
Count model gϕ
2 layers, node width 128, edge width 32, 8 heads
Maximum graph size
Nmax=32 fragments
Appendix
Table 5: Hyperparameters and model configuration
Figure 4: The 100 fragment types used by FragFlex, arranged in descending order of frequency in the ZINC training set.
Figure 5: 50 random samples generated by FragFlex.
We introduce Fraglingo, an autoregressive molecular generator that constructs molecules step by step from chemically meaningful fragments connected through predefined attachment sites. At each generation step, Fraglingo jointly predicts which fragment to add and how it should attach by producing an attachment-aware fragment embedding and retrieving the nearest fragment through latent-space search. A wildcard-anchored readout represents both the growing molecule and candidate fragments relative to their attachment sites, enabling a single latent prediction to determine both fragment identity and attachment configuration. Because prediction operates in a continuous embedding space rather than over fixed fragment identifiers, larger fragment libraries can be introduced at inference time without retraining. This retrieval-based formulation provides a unified generation primitive for molecule generation, scaffold generation, scaffold decoration, and molecule optimization. Fraglingo also supports property-conditional generation, allowing desired molecular properties to guide the generation process. On controlled property-conditional benchmarks, Fraglingo achieves stronger joint property control than comparably trained baselines while maintaining competitive validity, uniqueness, and novelty. It also generalizes to fragment libraries up to four times larger than those used during training without retraining. Code is available at: https://anonymous.4open.science/r/FragLingo-3551.
Thao Nguyen, Jeonghwan Kim, Zhenhailong Wang +1
Siebel School of Computing and Data Science University of Illinois Urbana-Champaign Urbana, IL 61801, USA
Molecular generation with diffusion models has emerged as a promising direction for AI-driven drug discovery and materials science. While graph diffusion models have been widely adopted due to the discrete nature of 2D molecular graphs, existing models suffer from low chemical validity and struggle to meet the desired properties compared to 1D modeling. In this work, we introduce MolHIT, a powerful molecular graph generation framework that overcomes long-standing performance limitations in existing methods. MolHIT is based on the Hierarchical Discrete Diffusion Model, which generalizes discrete diffusion to additional categories that encode chemical priors, and decoupled atom encoding that splits the atom types according to their chemical roles. Overall, MolHIT achieves new state-of-the-art performance on the MOSES dataset with near-perfect validity for the first time in graph diffusion, surpassing strong 1D baselines across multiple metrics. We further demonstrate strong performance in downstream tasks, including multi-property guided generation and scaffold extension.
Hojung Jung, Rodrigo Hormazabal, Jaehyeong Jo +5
KAIST AI · LG AI Research · Seoul National University
In this work, we present FRIGID, a framework with a novel diffusion language model that generates molecular structures conditioned on mass spectra via intermediate fingerprint representations and determined chemical formulae, training at the scale of hundreds of millions of unlabeled structures. We then demonstrate how forward fragmentation models enable inference-time scaling by identifying spectrum-inconsistent fragments and refining them through targeted remasking and denoising. While FRIGID already achieves strong performance with its diffusion base, inference-time scaling significantly improves its accuracy, surpassing 18% Top-1 accuracy on the challenging MassSpecGym benchmark and tripling the Top-1 accuracy of the leading methods on NPLIB1. Further empirical analyses show that FRIGID exhibits log-linear performance scaling with increasing inference-time compute, opening a promising new direction for continued improvements in de novo structural elucidation. FRIGID code is publicly available at https://github.com/coleygroup/FRIGID