Manuscript Offprint
arXiv:2610.06468Latent Flow Matching for Molecular Graph Generation
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Modern graph generative models typically operate directly in the discrete graph space, explicitly generating node and edge variables, which can become costly as graphs grow. In this paper, we perform generation explicitly on latent representations of entire graphs obtained from a pretrained Variational Autoencoder with high reconstruction fidelity. The generated representations, obtained through flow matching, are then decoded only at the final step. Across molecular benchmarks of increasing size, our approach achieves strong validity and FCD while offering a favorable quality-efficiency trade-off compared with state-of-the-art explicit graph generative models. One of the main advantages of this formulation is that the graph representation only needs to be learned once, after which the same one can be reused across multiple generative objectives without retraining. We demonstrate generation guided by molecular properties and further introduce validity-aware generation though a classifier learned directly in latent space. All code will be made available upon acceptance.
1 Introduction
Recent advances in graph generation have been largely driven by diffusion and flow-based models operating directly on explicit node and edge representations [1, 2, 3]. These methods model the graph distribution in its original discrete space and have achieved strong results across several graph generation benchmarks, but they suffer from having to manipulate large objects (full adjacency matrices and node embeddings) as well as being potentially permutation-sensitive. An alternative line of work instead learns compact, permutation-invariant graph-level representations via autoencoder architectures [4, 5, 6, 7], decoupling representation learning from distribution modeling (see Section 2 for details). One main drawback is that such architectures are known to yield poor generative performance without domain-specific knowledge being injected [8, 9].
This raises the question of whether an approach could leverage the best of both world, by moving distribution modeling entirely into such a continuous graph-level representation space; doing so should offer a competitive alternative to explicit graph generation in terms of sample quality, distributional fidelity, while retaining computational efficiency. This question is the central problem addressed in this work. Beyond unconditional generation, we ask whether the same latent representation can support controlled generation toward prescribed graph-level properties, and whether
*equal contribution generation can be further biased toward latent regions that decode more reliably, improving chemical validity.
Our contributions are threefold. First, we train a flow-matching [10] model to learn the latent distribution of the of a pretrained high-fidelity graph-level autoencoder. Second, we combine conditional flow matching with gradient-based guidance from differentiable property predictors, and demonstrate accurate control of logP and molecular weight while maintaining high validity and diversity on molecular datasets. Finally, we introduce an endpoint-based validity-aware flow matching formulation, based on Variational flow [11], that substantially improves chemical validity and characterize the resulting trade-off between validity and distributional fidelity.
Graph-Level Continuous Representations Let denote the graph space, where a graph with nodes is represented as an matrix of node features and an adjacency tensor of shape representing edge classes. In contrast to node-level autoencoders [12] (which encodes the graph as a permutation-equivariant matrix), a graph-level encoder maps a complete graph to a fixed-dimensional permutation-invariant representation , while a decoder maps this representation back to graph space through , with an attempt at reconstructing . Several recent architectures pursue this direction such as PIGVAE [4], GRALE [5], or GraViti [6] differing primarily in how permutation invariance is enforced and in the fidelity of reconstruction on larger, more heterogeneous graphs. These approaches, and more particularly GraViti, demonstrate that compact continuous representations can retain sufficient structural information for near-exact graph reconstruction on molecular datasets of different scales. In particular, PigVAE and GraViti provide a variational autoencoder architecture [16], which structures the latent space explicitly with downstream generation in mind (Section 3); nonetheless, while cheap, one-shot VAE sampling is known to fail at generating consistently valid molecules [17, 8, 18, 19], making it a poor generative model on its own.
Generation in explicit graph space. Most recent graph generative models operate directly on node and edge variables, keeping the graph representation explicit throughout generation. DiGress [1] applies discrete denoising diffusion to categorical graph representations, while CatFlow [11] and DeFoG [2] similarly formulate generation directly in graph space through categorical or discrete Flow Matching. More recently, Categorical Flow Maps [3] introduced continuous trajectories over categorical variables by evolving them in the probability simplex, enabling few-step generation. Despite this continuous formulation, the generative state still explicitly represents node and edge categories rather than a learned representation of the graph itself.
Generation through continuous representations. While latent generation approaches for graphs exist, they usually operate on node-level representations [20, 21, 22, 23] due to the only recent emergence of high-fidelity graph-level approaches. These methods include highly specialized

Figure 1: Overview of latent graph generation and validity-guided sampling. Top: latent flow matching; Bottom: construction of the validity dataset and validity predictor training.
VAEs leveraging domain-dependant constraints [24, 8] offering high validity, but with capped distributional fidelity [1]. Building on those graph-level latents, ChemFlow [25] has shown interesting latent navigation, without being a generative model, while NGG [26] employs a small variational graph autoencoder on general graphs based on structure conditioning, limiting its applicability to more complex data.
3 Method
Latent Flow Matching We formulate graph generation as distribution learning in a graph-level continuous representation space. Representations are obtained from a pretrained GraViti-based variational autoencoder [6], since it is freely available and trainable and achieves high reconstruction quality. The encoder and decoder are considered as pretrained, and remain fixed, decoupling graph representation learning from generative modeling.
Let denote the graph encoder of our pretrained VAE and the latent representation of a graph . We learn the latent graph distribution using Flow Matching [10], transporting an isotropic Gaussian source distribution toward latent graph embeddings , where is the empirical distribution of encoder outputs obtained by applying to the training graphs. We adopt the standard Flow Matching formulation, detailed in Appendix E. To improve the coupling between source and target samples, we employ mini-batch optimal transport [27], which promotes shorter and straighter transport trajectories while preserving the source and target marginals.
In order to avoid data leakage from the VAE's training, we adopt the same training, validation and test splits that are provided with GraViti. Therefore, both our model and the pretrained VAEs are trained on the same molecules exactly. We then learn a neural flow model over the distribution of graph representations, such that the complete generative trajectory is modeled in continuous latent space and only the final representation is decoded back to graph space. At generation time, the learned field is integrated from t = 0 to t = 1 and the resulting latent endpoint is decoded into a graph only after the last step.
Validity Guidance We further exploit the differentiability of the latent dynamics to promote molecule validity. After an unconditional neural flow model is trained, a time-dependent classifier is trained on valid and invalid latent states. The classifier is time-dependent because, given an intermediate latent state and its flow time t, it predicts whether the corresponding sample is expected to decode into a valid graph at the end of the trajectory. To train this prediction throughout the flow, intermediate states are constructed along linear trajectories between noise samples and valid or invalid endpoint latents, with each state inheriting the validity label of its endpoint. Positive examples are obtained from encoded valid training graphs, while negative examples are generated by the latent Flow Matching model and retained when they decode into invalid graphs. The construction of this dataset is critical to obtaining informative guidance: rather than relying on easily separable negatives far from the graph latent distribution, we use hard negatives lying in regions actually explored by the generator. This encourages the classifier to learn the validity boundary relevant to the sampling trajectories. Following the principle of classifier guidance [13], sampling can be steered according to
Where is the validity probability obtained from and is a parameter that controls the steering intensity. For stability and diversity, we restrict guidance to the later part of the trajectory (after ), where samples approach the learned graph distribution.
Property-Controlled Generation A desirable property of generative models is the ability to be prompted by properties of the generated molecule. We condition the flow matching field on a target property vector c, yielding , and complement this conditioning with a differentiable property predictor trained on intermediate states of the generative trajectories (using a similar process to that of the validity classifier). For a target c, the predictor provides an adaptive correction during sampling,
where is the squared difference between the predicted property and the target value , and where guidance is applied only once exceeds a threshold , since 's gradient is unreliable while remains close to pure noise. Conditioning therefore shapes the global transport toward the requested property, while gradient guidance refines individual trajectories once sufficient structure has emerged. Property control remains entirely within the graph-level latent space and requires no modification of the graph decoder.
Validity-Aware Endpoint Generation Validity guidance modifies a pretrained generative field at sampling time. We also investigate whether validity can be incorporated directly into the generative distribution. Building on the endpoint formulation of Variational Flow Matching [11], we model a conditional distribution over final graph representations,
Let denote the validity score produced by a frozen classifier. When interpreted as an estimate of , where V denotes graph validity, the joint density of an endpoint and the validity event factorize as
Importantly, is a conditional validity probability and not a density over latent space. The probability that an endpoint sampled from the model is valid is therefore
Motivated by this factorization, we train the endpoint distribution with , where and . The first term preserves likelihood on observed graph representations, while the second explicitly moves probability mass toward endpoints predicted to decode into valid graphs. Since is convex, Jensen's inequality gives
Table 1: Statistics of the used datasets. Numbers of atoms and bonds are reported on average. Last column is the dimension of the latent representation.
| Name | # Graph | # atom | # bonds | Max Size | Atom types | Emb. Dim. |
|---|---|---|---|---|---|---|
| QM9 | 130k | 8.79 | 9.4 | 9 | 4 | 64 |
| PubChem16 | 12.89M | 13.87 | 14.19 | 16 | 31 | 256 |
| PubChem32 | 74.34M | 21.75 | 21.15 | 32 | 31 | 512 |
providing a direct probabilistic interpretation of the validity objective. The samples are reparam-eterized through , allowing validity gradients to update the endpoint distribution.
At inference, the endpoint distribution can be exploited in two ways. Its predicted mean provides a deterministic endpoint estimate, while stochastic sampling allows several plausible endpoints to be considered at each step. We draw candidates from and favor those with higher predicted validity,
This reweighting exploits the uncertainty of the learned endpoint distribution while favoring trajectories toward latent regions with higher predicted validity.
4 Experiments
4.1 Experimental Setup
Datasets. We evaluate our approach on QM9 [28] and PubChem [29], two molecular graph datasets with substantially different scales and structural complexity. For PubChem, we use two subsets clipped at a maximum size of 16 and 32 heavy atoms respectively. All datasets have 4 edge types, corresponding to simple, double, triple bonds, and one extra class for "no bond". Statistics are described in Table 1.
Baselines. We compare latent generation against explicit graph generative models: the diffusion-based DiGress [1], a the flow-based Categorical Flow Maps [3]. We additionally report Gaussian sampling from the VAE prior as a latent-space baseline, allowing us to quantify the benefit of learning the latent graph distribution with flow matching. All models are trained and evaluated on the same splits.
Evaluation protocol. For each configuration, we perform 20 independent generation runs of 1,024 molecules, for a total of 20,480 generated samples. Implementation details and hyperparameters are provided in appendix I.
4.2 Unconditional Graph Generation and Validity Guidance
We first evaluate whether graph generation can be performed effectively by modeling the distribution of compact graph-level continuous representations, rather than explicitly generating discrete node and edge variables. This comparison is designed to evaluate not only generation quality, but also the computational trade-offs associated with the different generative representations.
Table 2: Unconditional generation results on our three benchmarks. Validity, novelty and uniqueness are reported as mean ± standard deviation over 20 runs of 1,024 molecules. FCD is computed over the generated set. Time denotes end-to-end generation of 1,024 molecules and includes the VAE decoding for our method. NFE stands for number of function evaluations (1 per step for Euler, 2 per step for midpoint and Heun solver). The numerical solvers are detailed in Appendix E.3. Our approaches are Latent FM, Latent FM with validity guidance (VG) and Validity-Aware VFM (VA-VFM). Qualitative examples of pc32 generation are provided in Appendix F.
| Method | Sampler | NFE | Validity | Uniq. | Novelty | FCD | Time (s) | VUN/T |
|---|---|---|---|---|---|---|---|---|
| QM9 | ||||||||
| DiGress | Diffusion | 2 | N/A | 3.420 | 1457.5 | |||
| DiGress | Diffusion | 5 | N/A | 1.150 | 1234.6 | |||
| DiGress | Diffusion | 20 | N/A | 0.087 | 438.9 | |||
| DiGress | Diffusion | 500 | N/A | 18.6 | ||||
| CFM-CSD | CSD | 1 | N/A | 1.873 | 2442.8 | |||
| CFM-CSD | CSD | 2 | N/A | 0.280 | 2209.0 | |||
| CFM-CSD | CSD | 5 | N/A | 0.111 | 1596.0 | |||
| CFM-CSD | CSD | 20 | N/A | 0.082 | 668.3 | |||
| CFM-CSD | CSD | 500 | N/A | 0.069 | 33.71 | |||
| CFM-ECLD | ECLD | 1 | N/A | 1.791 | 2427.5 | |||
| CFM-ECLD | ECLD | 2 | N/A | 0.480 | 2240.6 | |||
| CFM-ECLD | ECLD | 5 | N/A | 0.327 | 1616.2 | |||
| CFM-ECLD | ECLD | 20 | N/A | 0.342 | 666.8 | |||
| CFM-ECLD | ECLD | 500 | N/A | 0.305 | 33.84 | |||
| VAE Sampling | N/A | N/A | N/A | 2.88 | N/A | N/A | ||
| Latent FM | Heun | 2 | N/A | 0.390 | 536.0 | |||
| Latent FM | Heun | 5 | N/A | 0.156 | 544.4 | |||
| Latent FM | Heun | 20 | N/A | 0.110 | 536.1 | |||
| Latent FM | Heun | 500 | N/A | 0.127 | 324.6 | |||
| Lat. FM + VG | Midpoint | 20 | N/A | 0.110 | 531.8 | |||
| VA-VFM | Euler | 20 | N/A | 0.760 | 539.3 | |||
| PubChem16 | ||||||||
| DiGress | Diffusion | 2 | 10.44 | 566.7 | ||||
| DiGress | Diffusion | 5 | 6.060 | 604.2 | ||||
| DiGress | Diffusion | 20 | 0.945 | 275.8 | ||||
| DiGress | Diffusion | 500 | 0.356 | 11.8 | ||||
| CFM-CSD | CSD | 1 | 6.978 | 1318.6 | ||||
| CFM-CSD | CSD | 2 | 2.901 | 1137.9 | ||||
| CFM-CSD | CSD | 5 | 1.768 | 730.7 | ||||
| CFM-CSD | CSD | 20 | 1.155 | 248.7 | ||||
| CFM-CSD | CSD | 500 | 0.70 | 10.71 | ||||
| CFM-ECLD | ECLD | 1 | 7.034 | 1227.2 | ||||
| CFM-ECLD | ECLD | 2 | 2.949 | 1231.6 | ||||
| CFM-ECLD | ECLD | 5 | 2.339 | 758.8 | ||||
| CFM-ECLD | ECLD | 20 | 2.083 | 249.8 | ||||
| CFM-ECLD | ECLD | 500 | 1.462 | 10.75 | ||||
| VAE Sampling | N/A | N/A | 4.201 | N/A | N/A | |||
| Latent FM | Heun | 2 | 2.33 | 146.1 | ||||
| Latent FM | Heun | 5 | 0.409 | 205.8 | ||||
| Latent FM | Heun | 20 | 0.190 | 189.9 | ||||
| Latent FM | Heun | 500 | 78.3 | |||||
| Lat. FM + VG | Midpoint | 20 | 0.210 | 183.1 | ||||
| VA-VFM | Euler | 20 | 1.370 | 187.4 | ||||
| PubChem32 | ||||||||
| DiGress | Diffusion | 20 | 3.24 | 107.23 | ||||
| DiGress | Diffusion | 500 | 1.17 | 3.406 | ||||
| VAE Sampling | N/A | N/A | 11.33 | N/A | N/A | |||
| Latent FM | Heun | 2 | 13.52 | 58.1 | ||||
| Latent FM | Heun | 20 | 0.868 | 73.8 | ||||
| Latent FM | Heun | 500 | 38.8 | |||||
DiGress operates explicitly in discrete graph space through a long denoising trajectory, while CFM is specifically designed for efficient few-step categorical generation. We report the standard metrics of validity, uniqueness, novelty, Fréchet Chemnet Distance [30] to assess distributional fidelity, and end-to-end sampling time. We additionally report computational efficiency to compare latent and explicit graph generation beyond sample quality. Finally, we compute a metric, which we call VUN/T, which is computed as the quadruple product of validity, uniqueness, novelty and batch size, divided by the generation time; it corresponds to the number of valid, unique and novel molecules obtained per second, and serves as a summary of the generation efficiency. All results are reported in Table 2.
Explicit methods dominate on QM9, composed of very small molecules, although all methods achieve high performance on this dataset. Already at this scale, a key advantage of latent flow matching emerges: total generation time grows affinely with the number of integration steps for both approaches, but with a much shallower slope for latent FM, and the dominant cost is the single, fixed final decoding step. Explicit approaches, by contrast, pay a substantially steeper per-step cost, as every integration step operates on the full graph representation.
On PubChem16, our model shows a clear advantage in distributional fidelity, achieving substantially better FCD than both CFM variants, even at only 20 NFE, and outperforming DiGress by a significant margin. Notably, increasing the number of integration steps has only a marginal effect on our model's fidelity, in contrast to explicit methods. DiGress attains the highest validity rate, but only in its 500-step regime, which requires 70 seconds per batch, compared to 4 seconds for our model at 20 NFE (or 10 seconds at 500 NFE), while our model still achieves significantly lower (better) FCD in both regimes, with a VUN/T up to 17 times higher.
On Pubchem32, we did not train CFM due to its very large training cost (73 hours on PubChem16, which is 7 times smaller). We therefore compare to DiGress only. First of all we notice that, like for the other datasets, our model has significantly improved the generation performance with regards to the base VAE, improving validity 7-fold. Nonetheless, it does not manage to fully compensate for this, stagnating around 74.5% validity while Digress reaches 99% with full 500 steps.
Validity guidance further improves the latent FM by increasing chemical validity while preserving its distributional fidelity. The validity-aware VFM increases validity on QM9 and PubChem16, but at the cost of significant FCD; it should therefore be viewed as a specialized alternative for applications in which validity is the primary objective. On PubChem32, validity guidance fails at improving the validity on that dataset, which we attribute to the complexity of the latent space for that dataset relative to the small size of the validity predictor's training set (800,000 samples).
Training efficiency. The computational profiles also differ substantially at training time, as reported in Tables 3. CFM provides the fastest inference but requires the longest training among the evaluated approaches. DiGress has a more moderate training cost, while its strongest generation results rely on long sampling trajectories. In contrast, latent flow matching is particularly inexpensive to train, as it exploits a pre-trained VAE, with a training cost on QM9 that is roughly two orders of magnitude below that of CFM.
Even when validity dataset construction, classifier training, and the validity-aware endpoint model are included, the complete latent pipeline remains substantially cheaper to train than CFM on QM9. A similar trend is observed on PubChem16, where the latent FM alone remains considerably less expensive to train than the explicit categorical flow models (Table 3). These comparisons exclude the one-time cost of learning the graph encoder-decoder used by the latent models. However, this representation is shared across downstream tasks rather than being trained specifically for each generative objective. Once learned, the same continuous graph space is reused for unconditional generation, validity guidance, validity-aware generation, and property control. Even if trained specifically for latent flow matching purposes, the cost of representation learning can therefore be amortized across multiple tasks, which is a central advantage of decoupling graph representation learning from generative modeling.
Table 3: Single-GPU training cost on QM9 and PubChem16. Times for the proposed methods assume a fixed pretrained graph representation and therefore exclude the one-time encoder-decoder pretraining cost.
| Method / component | QM9 | PubChem16 |
|---|---|---|
| DiGress | 7 h 34 min | 16 h 55 min |
| CFM-CSD | 63 h 49 min | 73 h 21 min |
| CFM-ECLD | 70 h 53 min | 71 h 40 min |
| Latent FM | 27 min | 3 h 50 min |
| Validity dataset construction | 2 h 06 min | 8 h 05 min |
| Validity predictor | 1 min 28 s | 1 min 12 s |
| Validity-aware VFM training | 15 min 24 s | 12 h 08 min |
| Latent FM + validity guidance | 2 h 35 min | 11 h 57 min |
| Complete latent pipeline | 2 h 50 min | 24 h 05 min |
Table 4: Effect of gradient-based property guidance on target fidelity. We compare conditional flow matching (CFM) with CFM augmented with property-predictor guidance. Lower MAE and higher Pearson correlation indicate better property control.
| Dataset | Property | Conditional FM | + Guidance | ||
|---|---|---|---|---|---|
| MAE ↓ | r ↑ | MAE ↓ | r ↑ | ||
| QM9 | logP | 0.100 | 0.978 | 0.063 | 0.988 |
| QM9 | MW | 1.705 | 0.979 | 1.674 | 0.981 |
| PubChem16 | logP | 0.282 | 0.966 | 0.154 | 0.978 |
| PubChem16 | MW | 3.040 | 0.976 | 2.578 | 0.977 |
4.3 Property-Guided Generation
We study independent control of two complementary molecular properties, molecular weight (MW) and logP, prescribing one property at a time. MW mainly reflects molecular size and atomic composition, whereas logP depends more strongly on molecular structure and functional-group arrangement. This allows us to assess whether a single continuous latent representation can support distinct forms of molecular control rather than a single property class.
Independent property control. For each property, we condition the latent Flow Matching model on the target and optionally refine sampling with gradient-based guidance from a property predictor. Targets cover both high-density and more extreme regions of the training distribution, allowing us to assess controllability beyond frequent property values.
Figure 2 compares requested and generated properties for the best guided configurations. Across QM9 and PubChem16, generated means closely track the targets over a broad range, showing that the same latent representation supports both unconditional generation and property control. Qualitative examples are provided in Appendix G.
Although conditioning alone already provides effective property control, gradient-based guidance proves substantially more effective at improving target fidelity, with the largest gains observed for logP and consistent improvements for MW (Table 4).
Influence of the latent representation. Both deterministic and variational GraViti representations support effective property control, although the variational latent space consistently yields more accurate target matching (Appendix H).
Validity under property control. Target fidelity alone is insufficient to characterize controlled generation: a model may reach increasingly extreme property values by moving toward latent regions that decode poorly. We therefore distinguish between global and local validity. Global validity evaluates the conditional generation regime in which target properties are sampled according to their empirical training distribution. It therefore gives greater weight to targets lying in high-density regions of the property space. Local validity instead evaluates validity separately at each prescribed target and reveals how generation quality evolves when moving toward rare or out-of-distribution property values.
Under global conditioning, property guidance preserves high validity and uniqueness on both datasets, remaining close to the unconditional regime on QM9 and above 0.92 validity with maximal uniqueness on PubChem16. Detailed results are reported in Appendix D.
Global validity, however, can conceal substantial variations across the property range. Since targets are sampled according to the empirical training distribution, the resulting average is dominated by high-density regions and provides limited information about the behavior of the model near the boundaries of, or beyond, the training distribution. We therefore additionally report local validity, computed independently for each prescribed target value. Local validity and uniqueness remain high within the training distribution, while target-wise results in Appendix B show that validity degrades primarily for increasingly rare or out-of-distribution targets. These results also qualitatively indicate that our models remain reasonably robust beyond the training range.
5 Conclusion
In this paper, we introduced a method for molecule generation using a flow matching algorithm in the latent space of a high-fidelity graph-level autoencoder, leveraging on the recent progress on whole-molecule representations. We showed that our approach reaches state-of-the-art distributional fidelity (measured as the FCD), even when set up against more complex explicit graph generation baselines. While a decrease in validity is observed compared to DiGress (up to 25 points on PubChem32), the efficiency makes up for that by allowing to generate up to 10 times faster while retaining the larger distributional fidelity. We also demonstrate that our approach integrates guided generation seamlessly, leveraging the same latent representation and providing highly fidel results even outside of the dataset's distribution ranges.
Overall, this work offers a promising approach to graph and molecule generation processes that scale better, avoiding the high cost of in-graph-space explicit propagation. Future work could include structuring the latent space with explicit chemical properties in mind to further push the performance and application-suitability of the generated molecules.

(a) QM9 - logP.

(b) PubChem16 - logP.

(c) QM9 - molecular weight.

(d) PubChem16 - molecular weight.
Figure 2: Independent property-controlled generation on QM9 and PubChem16. Points show the mean property of generated molecules for each requested target, with error bars indicating one standard deviation. The dashed line corresponds to ideal control, while the shaded region indicates the 5-95% range of the training distribution.
References
[1] Clement Vignac, Igor Krawczuk, Antoine Siraudin, Bohan Wang, Volkan Cevher, and Pascal Frossard. DiGress: Discrete denoising diffusion for graph generation. In International Conference on Learning Representations, 2023.
[2] Yiming Qin, Manuel Madeira, Dorina Thanou, and Pascal Frossard. Defog: Discrete flow matching for graph generation. In International Conference on Machine Learning (ICML), 2025.
[3] Daan Roos, Oscar Davis, Floor Eijkelboom, Michael Bronstein, Max Welling, Ismail Ilkan Ceylan, Luca Ambrogioni, and Jan-Willem van de Meent. Categorical flow maps. arXiv preprint arXiv:2602.12233, 2026.
[4] Robin Winter, Frank Noe, and Djork-Arné Clevert. Permutation-invariant variational autoencoder for graph-level representation learning. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 9559–9573. Curran Associates, Inc., 2021.
[5] Paul Krzakala, Gabriel Melo, Charlotte Laclau, Florence d'Alché Buc, and Rémi Flamary. The quest for the GRAph level autoencoder (GRALE). In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
[6] Roman Bresson, Konstantinos Divriotis, Johannes F. Lutzeyer, Iakovos Evdaimon, and Michalis Vazirgiannis. GraViti: Graph-level variational autoencoders with relaxed permutation invariance. arXiv preprint arXiv:2605.16668, 2026.
[7] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013.
[8] Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 2323–2332. PMLR, 10–15 Jul 2018.
[9] Kiarash Zahirnia, Oliver Schulte, Parmis Naddaf, and Ke Li. Micro and macro level graph modeling for graph variational auto-encoders. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, editors, Advances in Neural Information Processing Systems, volume 35, pages 30347–30361. Curran Associates, Inc., 2022.
[10] Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. In International Conference on Learning Representations, 2022.
[11] Floor Eijkelboom, Grigory Bartosh, Christian Andersson Naesseth, Max Welling, and Jan-Willem van de Meent. Variational flow matching for graph generation. In Advances in Neural Information Processing Systems, 2024.
[12] Thomas N. Kipf and Max Welling. Variational Graph Auto-Encoders. arXiv:1611.07308 [cs, stat], November 2016. arXiv: 1611.07308.
[13] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat GANs on image synthesis. In Advances in Neural Information Processing Systems, volume 34, 2021.
[14] Xiang Li, Rongrong Wang, and Qing Qu. Towards understanding the mechanisms of classifier-free guidance. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
[15] Yaron Lipman, Marton Havasi, Peter Holderrieth, Neta Shaul, Matt Le, Brian Karrer, Ricky T. Q. Chen, David Lopez-Paz, Heli Ben-Hamu, and Itai Gat. Flow matching guide and code, 2024.
[16] Diederik P. Kingma and Max Welling. Auto-Encoding Variational Bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
[17] Matt J. Kusner, Brooks Paige, and José Miguel Hernández-Lobato. Grammar variational autoencoder. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML'17, page 1945–1954. JMLR.org, 2017.
[18] Chao Hu, Song Li, Chenxing Yang, Jun Chen, Yi Xiong, Guisheng Fan, Hao Liu, and Liang Hong. ScaffoldGVAE: scaffold generation and hopping of drug molecules via a variational autoencoder based on multi-view graph neural networks. J. Cheminform., 15(1):91, October 2023.
[19] Trieu Nguyen and Aleksandra Karolak. Transformer graph variational autoencoder for generative molecular design. Biophysical Journal, 124(22):3867–3875, 2025.
[20] Ling Yang, Zhilin Huang, Zhilong Zhang, Zhongyi Liu, Shenda Hong, Wentao Zhang, Wenming Yang, Bin Cui, and Luxia Zhang. Graphusion: Latent diffusion for graph generation. IEEE Transactions on Knowledge and Data Engineering, 36(11):6358–6369, 2024.
[21] Cai Zhou, Xiyuan Wang, and Muhan Zhang. Unifying generation and prediction on graphs with latent graph diffusion. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
[22] Antoine Siraudin and Christopher Morris. Principled latent diffusion for graphs via laplacian autoencoders. arXiv preprint arXiv:2601.13780, 2026. Preprint.
[23] Minkai Xu, Alexander Powers, Ron Dror, Stefano Ermon, and Jure Leskovec. Geometric latent diffusion models for 3d molecule generation. In International Conference on Machine Learning. PMLR, 2023.
[24] Rafael Gómez-Bombarelli, Jennifer N. Wei, David Duvenaud, José Miguel Hernández-Lobato, Benjamín Sánchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D. Hirzel, Ryan P. Adams, and Alán Aspuru-Guzik. Automatic chemical design using a data-driven continuous representation of molecules. ACS Central Science, 4(2):268–276, 2018.
[25] Guanghao Wei, Yining Huang, Chenru Duan, Yue Song, and Yuanqi Du. Navigating chemical space with latent flows. In Advances in Neural Information Processing Systems, 2024.
[26] Iakovos Evdaimon, Giannis Nikolentzos, Christos Xypolopoulos, Ahmed Kammoun, Michail Chatzianastasis, Hadi Abdine, and Michalis Vazirgiannis. Neural graph generator: Feature-conditioned graph generation using latent diffusion models. arXiv preprint arXiv:2403.01535, 2024.
[27] Alexander Tong, Kilian Fatras, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Guy Wolf, and Yoshua Bengio. Improving and generalizing flow-based generative models with minibatch optimal transport. Transactions on Machine Learning Research, 2024.
[28] Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1:140022, 2014.
[29] Sunghwan Kim, Paul A. Thiessen, Evan E. Bolton, Jie Chen, Gang Fu, Asta Gindulyte, Lianyi Han, Jane He, Siqian He, Benjamin A. Shoemaker, Jiyao Wang, Bo Yu, Jian Zhang, and Stephen H. Bryant. Pubchem substance and compound databases. Nucleic Acids Research, 44(D1):D1202–D1213, 01 2016.
[30] Kristina Preuer, Philipp Renz, Thomas Unterthiner, Sepp Hochreiter, and Günter Klambauer. Fréchet chemnet distance: A metric for generative models for molecules in drug discovery. Journal of Chemical Information and Modeling, 58(9):1736–1741, 2018.
[31] Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. Film: Visual reasoning with a general conditioning layer. In AAAI, 2018.
A Influence of the Latent Representation on Property Control
To further assess the influence of the graph-level representation on property-controlled generation, we compare the deterministic and variational GraViti latent spaces on PubChem16. In both cases, we use the same dataset, controlled properties, and property-guidance protocol, changing only the latent representation in which the generative dynamics are learned.
Figure 3 reports the target-response curves obtained in the deterministic AE space. The generated properties closely follow the requested targets for both logP and molecular weight, showing that the representation originally learned for unconditional graph generation already provides a suitable continuous domain for property steering. This supports the main premise of our framework: controlled generation does not require learning a separate property-specific encoder-decoder.
The variational representation nevertheless improves target fidelity, as summarized in Table 7 in the main text. The MAE decreases from 0.247 to 0.154 for logP and from 3.923 to 2.578 for MW, together with increased Pearson correlations. These results suggest that the VAE latent space is more amenable to continuous property steering. This observation is also consistent with the molecular property-optimization experiments reported for GraViti, which found the variational latent representation to provide a favorable domain for navigating molecular properties.

(a)

(b) Molecular weight
Figure 3: Independent property-controlled generation in the deterministic GraViti AE latent space on PubChem16. Generated properties are shown as a function of the requested target for logP and molecular weight. The dashed line denotes ideal control , and the shaded region indicates the corresponding training-distribution range.
B Validity under Property Control
Figure 4 shows how validity and uniqueness evolve with the requested property. Both remain high within the training distribution, confirming that property control does not substantially degrade generation quality over the range observed during training. Validity decreases mainly for rarer or more extreme targets, revealing where stronger steering begins to move samples toward latent regions that decode less reliably. These results also qualitatively suggest that the models retain some robustness beyond the training distribution.

(a) QM9 - logP

(b) PubChem16 - logP

(c) QM9 – Molecular Weight

(d) PubChem16 – Molecular Weight
Figure 4: Validity and uniqueness as a function of the target property for property-guided molecular generation on QM9 and PubChem16.
C Extended CFM Training on PubChem16
To assess whether the performance of Categorical Flow Maps on PubChem16 is primarily limited by training duration, we additionally train the CSD and ECLD variants for 30 epochs, corresponding to approximately 107 GPU hours. Table 5 reports the resulting unconditional generation performance across different numbers of sampling steps.
Table 5: Unconditional generation results for CFM-CSD and CFM-ECLD on PubChem16 after 30 training epochs (~107 GPU hours). Validity, uniqueness, and novelty are reported as mean standard deviation.
| Method | Steps | Validity | Uniqueness | Novelty | FCD |
|---|---|---|---|---|---|
| CFM-CSD | 1 | ||||
| CFM-CSD | 2 | ||||
| CFM-CSD | 5 | ||||
| CFM-CSD | 20 | ||||
| CFM-ECLD | 1 | ||||
| CFM-ECLD | 2 | ||||
| CFM-ECLD | 5 | ||||
| CFM-ECLD | 20 |
D Global Validity under Property Control
Global validity evaluates property-guided generation when target properties are sampled according to their empirical training distribution. Under this setting, property guidance preserves high validity and diversity on both datasets, as reported in Table 6. On QM9, validity remains close to the unconditional regime for both properties, while uniqueness also remains high. On PubChem16, validity stays above 0.92 for both logP and MW and uniqueness remains maximal.
Table 6: Global validity and uniqueness under property-guided generation. Target properties are sampled according to their empirical training distribution before generating the corresponding molecules.
| Dataset | Property | Validity ↑ | Uniqueness ↑ |
|---|---|---|---|
| QM9 | logP | 0.9873 | 0.996 |
| QM9 | MW | 0.9824 | 0.998 |
| PubChem16 | logP | 0.9277 | 1.000 |
| PubChem16 | MW | 0.9268 | 1.000 |
E Flow Matching
E.1 Basic principle
Flow Matching [10] learns a continuous transport between a simple source distribution and a target distribution . In our setting, is the distribution of encoded graph representations. Given , , and , we consider the linear probability path
with conditional velocity
A neural vector field is trained through the conditional flow matching objective
At inference time, samples are generated by integrating the learned vector field from t = 0 to t = 1 and decoding the resulting latent representations. We additionally consider mini-batch optimal-transport couplings between source and target samples, following previous flow matching work, to construct more coherent training paths.
E.2 Guided generation
A continuous latent representation also provides a direct interface for controlled generation. Conditional flow matching augments the vector field with a target property c,
while post-hoc guidance can further modify the sampling dynamics using gradients from a differentiable predictor. Given a predictor and a target , the guided field takes the form
where controls the guidance strength. This follows the general principle of gradient-based generative guidance [13] and enables graph-level properties to be controlled directly through the continuous latent dynamics.
E.3 ODE Solvers
All latent flow models are sampled by numerically integrating the learned ordinary differential equation
where v denotes the learned velocity field, possibly augmented with a guidance term. We consider three explicit integration schemes: Euler, midpoint, and Heun. Let denote the current latent state at time and let .
Euler. The Euler method performs a single evaluation of the velocity field per integration step:
Midpoint. The midpoint method is a second-order Runge–Kutta scheme. It first evaluates the velocity at the beginning of the step,
and uses it to estimate the state at the midpoint,
The velocity is then evaluated at this intermediate state,
and the update is given by
Heun. Heun's method is also a second-order Runge–Kutta scheme. It first computes an Euler prediction,
then evaluates the velocity at the predicted endpoint,
and averages the two slopes:
Number of function evaluations. Euler requires one velocity-field evaluation per integration step, whereas midpoint and Heun require two. Consequently, S Euler steps correspond to S NFE, while S midpoint or Heun steps correspond to 2S NFE.
F Qualitative examples on PubChem32
Figure 5 shows 20 example molecules generated on PubChem32 using DiGress and our latent Flow Matching model.
Source: smiles_enterorall_samples_PC32_DiGress_500steps_Tepoch.smi


2








11









(a) 20 molecules generated by DiGress with 500 sampling steps.
Source: smiles_enterorall_pc32_unconditional_fm_20x1024.smi


2

















(b) 20 molecules generated by our Flow Matching model with 20 sampling steps.
Figure 5: Qualitative examples of molecules generated on PubChem32 by DiGress (top) and our Flow Matching model (bottom).
G Examples of Property-Guided Generation
Figure 6 provides qualitative examples of molecules generated under property guidance for molecular weight (MW) and logP. For targets within the training distribution, generated molecules generally remain close to the requested property value. As targets move outside the training distribution, larger deviations from the target can be observed, illustrating the increased difficulty of extrapolating property control beyond the training regime.
QM9 Conditional Flow Matching + logP regressor guidance
lambda=18979.6, t.start=0.6, 20 midpoint steps - 5 unique molecules per target
QM9 Conditional Flow Matching + MW regressor guidance
lambda=3673.47, t.start=0.6, 20 midpoint steps - 5 unique molecules per target
Target
logP = 1.00
(in distribution)
logP = 1.05
logP = 1.06
logP = 1.10
logP = 0.80
logP = 0.70
Target
logP = 1.00
(in distribution)
logP = 0.95
logP = 0.96
logP = 1.14
logP = 1.27
Target
logP = 3.50
(in distribution)
logP = 2.20
logP = 2.38
logP = 1.42
logP = 3.22
PC16 Conditional Flow Matching + logP regressor guidance
lambda=12857.1, t.start=0.6, 20 midpoint steps - 5 unique molecules per target
Target
logP = 0.00
(in distribution)
logP = 0.13
logP = 0.16
logP = 0.21
logP = 0.22
logP = 0.24
Target
logP = 3.00
(in distribution)
logP = 2.27
logP = 2.17
logP = 2.21
logP = 2.22
logP = 2.26
Target
logP = 5.00
(in distribution)
logP = 1.12
logP = 1.17
logP = 1.16
logP = 1.14
logP = 1.13
Figure 6: Examples of molecules generated with property-guided latent Flow Matching on QM9 and PubChem16 for logP and molecular weight (MW) targets. Examples are shown for both in-distribution and out-of-distribution target values. The achieved property value is reported below each generated molecule.
H Influence of the Latent Representation on Property Control
We further investigate whether the choice of latent representation affects property controllability. On PubChem16, we apply the same property-guidance protocol to the deterministic and variational GraViti latent spaces. This comparison isolates the effect of the representation itself, as both spaces are reused directly from the unconditional generation setting, without training a property-specific encoder or decoder.
As shown in Table 7, both representations support effective control of logP and molecular weight (MW). However, the variational representation consistently provides more accurate target matching, achieving lower MAE and higher Pearson correlation for both properties.
Table 7: Effect of the graph-level latent representation on independent property control on PubChem16. Both representations are evaluated using the same guidance protocol.
| Representation | Property | MAE ↓ | r ↑ |
|---|---|---|---|
| AE | logP | 0.247 | 0.966 |
| VAE | logP | 0.154 | 0.978 |
| AE | MW | 3.923 | 0.971 |
| VAE | MW | 2.578 | 0.977 |
These results suggest that the variational representation is more amenable to continuous property steering. This observation is consistent with the property-optimization results reported for GraViti, where the variational latent representation similarly provides a favorable space for navigating molecular properties.
I Training settings
Table 8 summarizes the main architecture, training, and sampling hyperparameters used for the models retained in our experiments.
I. 1 Vector Field Network
We parameterize the velocity field with a residual multilayer perceptron operating directly on the VAE latent space, . The scalar time is first mapped to a sinusoidal embedding and refined by a two-layer MLP with SiLU activation, yielding a time representation . The network is a stack of pre-norm residual blocks of hidden width , each of the form
where LN denotes layer normalization. Time conditioning is injected in one of two ways. In the plain variant, is concatenated to before a linear input projection to dimension , so time enters only at the input. In the FiLM variant, is projected on its own, and each block conditions on time through feature-wise linear modulation [31]:
followed by the same two-layer feed-forward path and skip connection, so that time information is available at every depth. A final layer normalization and linear projection map the hidden state back to , producing a velocity of the same dimension as the latent.
The model is trained with the conditional flow matching objective on normalized latents. Given a noise sample , a data latent , and , we form the linear interpolation and minimize
Optionally, the pairs are drawn from a Sinkhorn-regularized minibatch optimal transport plan rather than independently, which yields straighter trajectories. At inference, samples are generated by integrating from (Gaussian noise) to with an ODE solver (e.g., Heun's method), then denormalizing and decoding with the VAE decoder.
Table 8: Hyperparameters used for the models retained in our experiments.
| Hyperparameter | QM9NoHydro | PubChem16 |
|---|---|---|
| Latent dimension | 64 | 256 |
| Latent transform (FM) | None | Standardization |
| Flow Matching | ||
| Hidden dimension | 1024 | 2048 |
| Number of layers | 6 | 10 |
| Time embedding dimension | 1 | 64 |
| FiLM | Yes | Yes |
| Batch OT | Yes | Yes |
| Dropout | 0 | 0 |
| Optimizer | AdamW | AdamW |
| Learning rate | ||
| Weight decay | ||
| Batch size | 1024 | 1024 |
| Training epochs | 500 | 30 |
| Warmup steps | 1000 | 1000 |
| Gradient clipping | 1 | 1 |
| Validity predictor | ||
| Hidden dimension | 256 | 1024 |
| Number of layers | 3 | 6 |
| Time conditioning | Concatenated to input | Concatenated to input |
| Learning rate | ||
| Weight decay | ||
| Batch size | 1024 | 1024 |
| Maximum epochs | 300 | 300 |
| Selected epoch | 266 | 50 |
| Early-stopping patience | 50 | 30 |
| Validity Flow Matching | ||
| Latent transform | Standardization | Standardization |
| Hidden dimension | 1536 | 2048 |
| Number of layers | 8 | 10 |
| Dropout | 0 | 0 |
| Log-variance bounds | ||
| Learning rate | ||
| Minimum learning rate | ||
| Weight decay | ||
| Batch size | 512 | 1024 |
| Maximum epochs | 500 | 150 |
| Selected epoch | 500 | 32 |
| Early-stopping patience | 500 | 5 |
| Endpoint candidates | 8 | 32 |
| Reweighting strength | 1 | 5 |
| Sampling | ||
| Integrator | Euler | Euler |
| Integration interval | ||
| Default FM steps | 500 | 20 |
| VFM steps | 20 / 500 | 20 / 500 |
| Guidance scale | 25 | 10 |
| Guidance start | ||
Table 9: Hyperparameters used for property-guided generation on QM9NoHydro. Conditioning properties are standardized using training-set statistics. No latent transformation is applied.
| Hyperparameter | QM9 MW | QM9 logP |
|---|---|---|
| Latent dimension | 64 | 64 |
| Conditioning property | MW | logP |
| Property normalization | Standardized | Standardized |
| Latent transform | None | None |
| Conditional Flow Matching | ||
| Hidden dimension | 512 | 512 |
| Number of residual blocks | 6 | 6 |
| Conditioning mechanism | FiLM | FiLM |
| Condition dimension | 1 | 1 |
| Dropout | 0 | 0 |
| Batch OT | Yes | Yes |
| Optimizer | AdamW | AdamW |
| Learning rate | ||
| Weight decay | ||
| Batch size | 512 | 512 |
| Training epochs | 500 | 500 |
| Validation split | 0.1 | 0.1 |
| Gradient clipping | 0.5 | 0.5 |
| Property regressor | ||
| Hidden dimension | 256 | 256 |
| Number of hidden layers | 3 | 3 |
| Activation | SiLU | SiLU |
| Normalization | LayerNorm | LayerNorm |
| Time conditioning | Concatenated to input | Concatenated to input |
| Output dimension | 1 | 1 |
| Optimizer | Adam | Adam |
| Learning rate | ||
| Weight decay | ||
| Training epochs | 300 | 300 |
| Gradient clipping | 1.0 | 1.0 |
| Batch optimal transport | ||
| Sinkhorn batch size | 512 | 512 |
| Regularization | 1.0 | 1.0 |
| Maximum iterations | 1000 | 1000 |
| Convergence threshold | ||
| Sampling and guidance | ||
| ODE solver | Midpoint | Midpoint |
| Number of steps | 20 | 20 |
| Temperature | 1.0 | 1.0 |
| Guidance start | ||
| Guidance scale | 3673.47 | 18979.6 |
| Random seed | 42 | 42 |
| Samples per target | 512 | 512 |
| Global evaluation samples | 1024 | 1024 |
Table 10: Hyperparameters used for property-guided generation on PubChem16. Conditioning properties are standardized using training-set statistics. No latent transformation is applied.
| Hyperparameter | PubChem16 MW | PubChem16 logP |
|---|---|---|
| Latent dimension | 256 | 256 |
| Conditioning property | MW | logP |
| Property normalization | Standardized | Standardized |
| Latent transform | None | None |
| Conditional Flow Matching | ||
| Hidden dimension | 1024 | 1024 |
| Number of residual blocks | 6 | 6 |
| Conditioning mechanism | FiLM | FiLM |
| Condition dimension | 1 | 1 |
| Dropout | 0 | 0 |
| Batch OT | Yes | Yes |
| Optimizer | AdamW | AdamW |
| Learning rate | ||
| Weight decay | ||
| Batch size | 512 | 512 |
| Training epochs | 1000 | 1000 |
| Validation split | 0.1 | 0.1 |
| Gradient clipping | 0.5 | 0.5 |
| Property regressor | ||
| Hidden dimension | 256 | 256 |
| Number of hidden layers | 3 | 3 |
| Activation | SiLU | SiLU |
| Normalization | LayerNorm | LayerNorm |
| Time conditioning | Concatenated to input | Concatenated to input |
| Output dimension | 1 | 1 |
| Optimizer | Adam | Adam |
| Learning rate | ||
| Weight decay | ||
| Training epochs | 300 | 300 |
| Gradient clipping | 1.0 | 1.0 |
| Batch optimal transport | ||
| Sinkhorn batch size | 512 | 512 |
| Regularization | 1.0 | 1.0 |
| Maximum iterations | 1000 | 1000 |
| Convergence threshold | ||
| Sampling and guidance | ||
| ODE solver | Midpoint | Midpoint |
| Number of steps | 20 | 20 |
| Temperature | 1.0 | 1.0 |
| Guidance start | ||
| Guidance scale | 408.163 | 12857.1 |
| Random seed | 42 | 42 |
| Samples per target | 512 | 512 |
| Global evaluation samples | 1024 | 1024 |