Recovering molecules from coarse-grained beads: free-energy-conditioned generative backmapping across chemical space
Authors: Luis Itza Vazquez-Salazar, Tristan Bereau
Organizations: Institute for Theoretical Physics, Heidelberg University, Heidelberg, Germany. · Interdisciplinary Center for Scientific Computing (IWR), Heidelberg University, Heidelberg, Germany.
Transferable coarse-grained (CG) force fields compress chemical space: by aggregating atoms into a reduced set of interaction beads, models such as MARTINI reduce the number of distinguishable compounds by roughly three orders of magnitude, making high-throughput screening of thermodynamic properties tractable across soft matter, with drug--membrane permeability as a well-developed example. The compression is lossy and, so far, one-way: a screen returns a combination of beads, with no established route back to the compounds it stands for. Recovering those compounds--compositional backmapping--is a one-to-many inverse map, distinct from the better-studied conformational problem of rebuilding atomic coordinates from a known mapping. Here we formulate compositional backmapping as conditional graph generation by introducing juniper, a discrete denoising diffusion model over molecular graphs conditioned on the octanol--water partition free energy ΔGW↦O, the principal driver of MARTINI bead type assignment and hence a proxy for bead identity. Trained on molecules of up to 9 heavy atoms mapped onto one or two beads, juniper generates molecules that are 93% valid and 92% unique for two-bead targets, and whose ΔGW↦O distributions track the target ΔGW↦OCG linearly (r2≥0.96), departing only in the hydrophobic and hydrophilic tails. Although the model receives no chemical information beyond a single scalar, the functional groups shift systematically with the imposed free energy, from branched hydrocarbons at the apolar end to amides, imides, and isocyanates at the polar end. A bead combination flagged by a CG screen can therefore be turned into candidate molecules for atomistic study or synthesis.
Figures & tables
Figure 1: Backmapping in chemical space. Four combinations of the main set of MARTINI beads are shown. The C bead (blue) is apolar, N (green) is intermediate, and P (red) is polar. The horizontal axis orders the combinations by the octanol–water partition free energy ( ΔGW↦O ), from the apolar C-C pair on the left to the polar P-P pair on the right; the vertical axis indicates resolution, with the bead pair at the bottom of each panel and the corresponding molecules above. Because each bead type comprises several subtypes, the four combinations are representatives placed schematically along the ΔGW↦O axis rather than at their nominal values. The backmapping procedure converts each bead combination into a set of molecules with defined physicochemical properties, through a generative process constrained by the value of ΔGW↦O . Molecular examples are selected at random for each combination.
Figure 2: Diffusion model for backmapping. An initial molecule is transformed into a graph G=(X,E) . The obtained graph is passed through the forward process (left to right), in which noise is progressively added to nodes and edges over T steps, updating the marginal distributions of nodes and edges in the training dataset. The inverse process involves obtaining denoising probabilities from a transformer model conditioned on ΔGW↦OCG .
Figure 3: Basic metrics and unconditional generation. (A) Radar chart for the basic performance metrics of the model trained with the coarse-grained dataset. The performance of juniper for generating samples without guidance (blue line). For comparison, we also report the performance of the conditional variational autoencoder (CVAE) in Ref. 39 on the same dataset for unconditional generation: models trained with information on multiple properties (purple line) and only with ΔGW↦O (red line). Finally, the performance for the mean of the generated samples using guidance (green line) for molecules that can be mapped to MARTINI bead dimers is reported. (B) 2D kernel density representation of the chemical space in terms of the octanol–water partition free energy and the solvent-accessible surface area of the training dataset (black line). Samples generated without explicit guidance are shown as blue points.
Figure 4: Sampling in chemical space. 2D kernel density estimate of the joint distribution of ΔGW↦O and the solvent-accessible surface area (SASA). The figure margins show 1D kernel density estimates for each quantity. Solid lines and filled contours refer to generated molecules, dash-dotted lines to the training data. The grey dash-dotted contours in the background show the full training dataset. The filled contours and scattered points represent the conditional samples generated for three cases: C1-C1 (very hydrophobic), Na-Nda (intermediate), and P3-P4 (hydrophilic); the coloured dash-dotted lines in the margins give the training distributions for the same bead combinations, and the vertical dashed lines mark the conditioning value ΔGW↦OCG of each. The effect of the conditioning on the sampling is visible in all three cases. Values of ΔGW↦O were obtained with ALOGPS. In the SI, Figure S5 shows examples of the molecules generated for the ΔGW↦O value corresponding to each bead combination.
Figure 5: Comparison between ΔGW↦OCG and ΔGW↦OAA . (A) Scatter plot of the value of ΔGW↦OCG versus the mean value of ΔGW↦OAA for the generated molecules. The markers are coloured by bead family, except for values of ΔGW↦O that can correspond to multiple bead combinations, which are coloured in magenta. (B) Residual plot of the absolute difference between the mean of ΔGW↦OAA and the value of ΔGW↦OCG for all combinations; the signed version is available in the SI. A trend line fitted to a second-order polynomial is shown for each value of γ . The background shows the histogram of the training dataset.
Figure 6: Functional groups by bead family. In the centre, the probability distribution of ΔGW↦O coloured with respect to the main MARTINI family. The surrounding insets show the ten most common functional-group fragments identified by Ertl’s algorithm. Bonds shown in light grey denote query bonds whose order is not fully specified; by default, these match either single or double bonds.
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Validity
Uniqueness
Novelty
Repetition
Coverage
JT-VAE* (ZINC-250K)
1.00
1.00
0.89
0.00
0.00
DiGress* (ZINC-250K)
0.85
1.00
1.00
0.15
0.00
MG-DIFF* (ZINC-250K)
0.96
0.99
0.99
0.03
0.00
DrugDiff † (ZINC-250K)
1.00
0.99
1.00
0.01
0.00
CVAE Mult. Prop. (CG dataset)
0.71
0.71
0.50
0.00
0.21
CVAE Sing. Prop. (CG dataset)
0.73
0.72
0.47
0.00
0.25
Appendix
Table S1: Performance metrics for state-of-the-art models for the generation of molecular graphs. Data with an * is taken from Ref. 51 and † is taken from Ref. 50 . The dataset used to train the models is shown in brackets. Validity, uniqueness, and novelty are reported as fractions; the repetition rate and coverage follow Eqs. 3 and 4 of the main manuscript, and all five metrics are defined in Section 2.4.1 there.
Property
Train/Juniper
Train/CVAE Single
Train/CVAE Mult. Prop.
ΔGW↦O
0.004
0.012
0.007
SASA
0.005
0.013
0.005
Juniper/CVAE Sing. Prop.
Juniper/CVAE Mult. Prop.
ΔGW↦O
0.011
0.007
SASA
0.011
0.007
Appendix
Table S2: Jensen–Shannon divergence between the distributions of ΔGW↦O and SASA for the generated samples without guidance by Juniper and CVAE models. In the first half, we calculate DJS between the training and unconditioned distributions. The second half shows values for comparison between the models’ distributions.
Figure S1 : Histogram of bead population as a function of ΔGW↦O for samples in the training dataset.
Figure S2 : Unguided sampling. 2D kernel density representation of the chemical space in terms of the octanol–water partition free energy and the solvent-accessible surface area of the training dataset (black line). The samples generated without explicit guidance are shown in different colours by the model used to generate them. The figure margins show 1D kernel density estimates for each quantity.
Figure S3 : Basic metrics for the generated molecules for dimers. Left: fraction of valid molecules. Centre: fraction of unique generated samples. Right: fraction of novel molecules among those that are valid and unique. From top to bottom, the value of γ increases.
Figure S4 : Repetition and novelty rate for dimers. On the left, the repetition rate as defined in Eq. 3 of the main manuscript. On the right, the novelty rate from Eq. 5 . From top to bottom, the value of γ increases.
Figure S5 : Examples of molecules generated at the specific values of ΔGW↦O used in Figure 4 of the main manuscript. From left to right: (A) C1-C1, (B) Na-Nda, and (C) P3-P4.
Figure S6 : Sampling in chemical space. 2D kernel density estimate of the joint distribution of ΔGW↦O and the solvent-accessible surface area (SASA). The figure margins show 1D kernel density estimates for each quantity. In the background, the solid black line shows the distribution for all molecules in the training dataset. The scattered points represent the conditional samples generated for three cases: C1-C1 (very hydrophobic), Na-Nda (intermediate), and P3-P4 (hydrophilic). Distributions of each property by bead of the training dataset are shown as colour-filled representations and with dashed-dotted lines in the figure margins. The effect of the conditioning on the sampling is visible in all three cases. Values of ΔGW↦O were obtained with RDKit. Figure S5 shows examples of the molecules generated for the ΔGW↦O value corresponding to each bead combination.
Figure S7 : Comparison between ΔGW↦OCG and ΔGW↦OAA . (A) Scatter plot of the value of ΔGW↦OCG versus the mean value of ΔGW↦OAA for the generated molecules. The markers are coloured by bead family, except for values of ΔGW↦O that can correspond to multiple bead combinations, which are coloured in magenta. (B) Residual plot of the absolute difference between the mean of ΔGW↦OAA and the value of ΔGW↦OCG for all combinations. A trend line fitted to a second-order polynomial is shown for each value of γ . The background shows the histogram of the training dataset.
Figure S8 : Signed residual plot for the difference between ΔGW↦OCG and the mean value of ΔGW↦OAA using ALOGPS.
Figure S9 : Statistical distances between the distributions of ΔGW↦O of training and generated samples with a value of γ=1 . (A) Jensen–Shannon divergence (cf. Eq. 7 of the main manuscript). (B) Square of the maximum mean discrepancy (cf. Eq. 8 ). The dotted green line shows the average value, while the shaded region corresponds to ± one standard deviation. For the MMD, plots of the generated and reference distributions as well as the witness function for each combination are shown in Figure S10 .
Figure S10 : Distributions of P(ΔGW↦Otrain) and P(ΔGW↦Ogen) , and witness function, for dimer combinations using γ=1 .
Figure S11 : Chemical network comparison of common functional groups between the training and generated sets. The functional groups shown are present in at least 50 bead combinations. The network structure was determined using the t-SNE decomposition of the SMARTS fragments obtained from Ertl’s functional group decomposition, ranked by the similarity between fragments. The FGs shared between the training and generated sets are circled in blue, FGs present only in the training set are circled in red, and FGs present only in the generated set are highlighted in green.
Figure S12 : Internal chemical diversity (ICD) on the generated molecules for different combinations of beads. From left to right, the value of γ is increased. The colour scale ranges from 0.7 to 0.9. An ICD value closer to one indicates greater diversity in the generated molecules.
Figure S13 : Changes in the value of the internal chemical diversity (ICD) of the generated molecules with respect to the value of γ . In red, the three bead combinations with the largest decrease in ICD are highlighted. Conversely, the combinations with the largest increase in ICD are coloured in blue. The bold black line shows the mean change across all combinations.
Figure S14 : Fréchet ChemNet distance (FCD) between the training and generated molecules. The colour code and point radii illustrate the distance between training and generated molecules. From top to bottom, the value of γ is increased. Larger values of FCD correspond to larger differences between the structures of the generated compounds and those in the training set.
Estimating free energy differences quantifies thermodynamic preferences in molecular interactions, which is central to chemistry and drug discovery. Despite fruitful progress, existing methods still face key limitations: classical computational approaches remain prohibitively expensive due to their reliance on extensive molecular dynamics simulations, while deep learning-based methods are constrained by either less-expressive generative models or input dimensions tied to a specific system, resulting in negligible generalization. To address these challenges, we propose CARD, a generative framework that employs a novel radix-based decomposition to bijectively convert 3D coordinates into mixed discrete-continuous sequences, enabling coarse-to-fine autoregressive modeling with enhanced expressiveness. Notably, the model corresponds to a distribution with zero free energy, serving as a proposal for absolute free energy computation of arbitrary systems without relying on alchemical pathways. Experiments across diverse tasks demonstrate that CARD matches the accuracy of classical computational methods on unseen systems with diverse topologies, while achieving an approximately 40-fold speedup in inference.
Ziyang Yu, Yi He, Wenbing Huang +2
ByteDance Seed · Department of Computer Science and Technology, Tsinghua University · Institute for AI Industry Research (AIR), Tsinghua University +2
Molecules in equilibrium follow a Boltzmann distribution, making the underlying energy landscape a physically grounded modeling objective. However, such landscapes are difficult to learn from data and, once learned, hard to sample from. Diffusion and flow-matching models sidestep these difficulties by learning a time-conditional score or transport field between noise and data, losing the energy inductive bias in exchange for a more tractable training objective. We introduce EBMol, an energy-based model (EBM) that restores this inductive bias by learning an atom-additive scalar potential without explicit simulation during training. Our method employs a flow-inspired Restoring Field Matching objective to approximate the energy landscape. We adopt the Mirror-Langevin algorithm for sampling, enabling unified updates of atomic positions and types, and incorporate parallel tempering for inference-time compute scaling. EBMol is the first EBM for 3D molecular generation to achieve state-of-the-art performance on QM9 and GEOM-Drugs. Moreover, we show that the learned energy landscape serves as a principled quality metric for ranking and filtering configurations, and demonstrate controllable generation without retraining through shape-steered sampling via potential composition and zero-shot linker design.
Christoph Griesbacher, Lea Bogensperger, Andreas Habring +1
Graz University of Technology · University of Zurich
Molecular discovery is increasingly framed as an inverse design problem: identifying molecular structures that satisfy desired property profiles under feasibility constraints. While recent generative models provide continuous latent representations of chemical space, targeted optimization within these representations often leads to degraded validity, loss of structural fidelity, or unstable behavior. We introduce MoltenFlow, a modular framework that combines property-organized latent representations with flow-matching generative priors and gradient-based guidance. This formulation supports both conditioned generation and local optimization within a single latent-space framework. We show that guided latent flows enable efficient multi-objective molecular optimization under fixed oracle budgets with controllable trade-offs, while a learned flow prior improves unconditional generation quality.