Transformer Variational Autoencoder with Latent DDPM Flow Matching for Synthetic Molecular Generation
\(^{1}\) QuNB group, Department of Chemistry, University of New Brunswick, Fredericton, New Brunswick E3B 5A3, Canada
\(^{2}\) Department of Mathematics & Statistics, University of New Brunswick, Fredericton, New Brunswick E3B 5A3, Canada
Molecular generation is an important task in computer-aided drug discovery, where deep generative models can be used to explore novel chemical structures. In this work, we present a molecular generation framework that combines a Transformer-based variational autoencoder with latent flow matching. Molecular structures are first converted from SMILES strings into SELFIES representations to improve syntactic robustness during generation. The variational autoencoder uses a Transformer encoder with class-token pooling to learn continuous latent representations of molecules, together with an autoregressive Transformer decoder for sequence reconstruction and generation. To improve latent-space sampling, a diffusion model utilizing flow matching technique is trained on the learned molecular latent vectors and used to generate new latent samples.
Generated molecules are evaluated using standard molecular generation metrics, including validity, uniqueness, novelty, quantitative estimate of drug-likeness, Jenson-Shannon distance across more than 30 chemical properties, and diversity. The results demonstrate that combining attention-based molecular representation learning with latent flow matching provides a flexible framework for generating chemically valid, diverse, and novel molecular structures. This approach offers a promising direction for molecular design and virtual screening applications.