Source-linked AI summary

Latent Flow Matching for Molecular Graph Generation

Mathis Goupillon, Roman Bresson, Konstantinos Divriotis, Michalis Vazirgiannis

arXiv:2610.06468v1cs.LGcs.AI

TL;DR

Explicit graph generation manipulates node and edge variables, which can become costly as graphs grow. This paper applies flow matching to pretrained graph-level latent representations, reporting favorable fidelity and efficiency against explicit baselines while also exploring property and validity guidance.

  • Problem

    Explicit graph-generation methods operate on node and edge representations that can require manipulating large graph objects and may be permutation-sensitive.

    Source: §1 · p. 1
  • Method

    The method flow-matches embeddings from a pretrained high-fidelity graph-level autoencoder and adds property and validity guidance in latent space.

    Source: §1 · p. 2, §3 · pp. 3–4
  • Results

    Across molecular benchmarks, latent flow matching offers higher distributional fidelity and faster generation than explicit baselines, though validity can trail DiGress on PubChem32.

    Source: §4.2 · p. 7, §5 · p. 9
  • Takeaways & Limitations

    The same learned graph representation supports unconditional generation, molecular-property guidance, and validity-aware generation without retraining the representation.

    Source: §1 · p. 2, §4.3 · p. 8

    The latent space is not explicitly structured around chemical properties; the authors identify this as a direction for future work.

    Source: §5 · p. 9

Abstract

from arXiv · show

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

Explicit graph generation can be costly and permutation-sensitive, while graph-level autoencoders offer compact representations but may generate poorly without domain-specific knowledge. This work tests whether modeling distributions in continuous graph-level latent space can retain quality and efficiency while enabling property control and improved validity.

1 Introduction

  • Explicit graph models manipulate large adjacency matrices and node embeddings and may be permutation-sensitive, whereas graph-level autoencoders can generate poorly without domain-specific knowledge.These limitations motivate combining latent graph representations with distribution modeling.Source: §1 · p. 1
  • The paper asks whether modeling distributions in continuous graph-level representations can match explicit graph generation in sample quality and distributional fidelity while retaining computational efficiency.It also asks whether the same representation can support property control and bias generation toward regions that decode more reliably.Source: §1 · pp. 1–2
  • The proposed contributions combine latent flow matching, property-guided generation, and endpoint-based validity-aware flow matching using a pretrained high-fidelity graph-level autoencoder.The paper reports control of logP and molecular weight and a validity–distributional-fidelity trade-off for the validity-aware formulation.Source: §1 · p. 2

2 Background and Related Work

Flow matching learns transformations from a simple source distribution to data, and conditioning can steer generation toward desired properties. Graph-level autoencoders provide compact, permutation-invariant representations, but one-shot VAE sampling is not consistently valid; prior graph-generation approaches use either explicit graph variables or varied latent representations.

2 Background and Related Work

  • Flow matching learns a time-dependent vector field that transports samples from a simple source distribution to data along a prescribed probability path.Conditional flow matching conditions the field on desired properties; unlike diffusion, it avoids iterative denoising schedules while retaining comparable sample quality.Source: §2 · p. 2
  • Graph-level encoders map complete graphs to fixed-dimensional, permutation-invariant representations that can support near-exact molecular reconstruction, but one-shot VAE sampling often fails to produce valid molecules.The passage describes GraViti and PigVAE as variational autoencoders that structure latent space with downstream generation in mind.Source: §2 · p. 2
  • Explicit graph-space methods such as DiGress, CatFlow, DeFoG, and Categorical Flow Maps generate using node and edge categories rather than a learned representation of the whole graph.Categorical Flow Maps use continuous trajectories over categorical variables, but their generative state remains explicit.Source: §2 · p. 2
  • Existing graph latent-generation approaches often use node-level representations, while graph-level VAE approaches may rely on domain constraints or offer latent navigation without generative modeling.The cited work also includes NGG, which uses a small variational graph autoencoder with structure conditioning and is described as limited for more complex data.Source: §2 · pp. 2–3

3 Method

The method learns a flow over embeddings from a fixed pretrained graph-level VAE, decodes only the final latent state, and adds property and validity guidance in latent space. It also trains an endpoint distribution to favor predicted-valid outputs while retaining a likelihood objective.

3 Method

  • The latent flow transports Gaussian source samples toward the empirical distribution of pretrained graph embeddings, using mini-batch optimal transport to promote shorter, straighter trajectories.The encoder and decoder remain fixed, separating representation learning from generative modeling; the latent endpoint is decoded after the flow integration.Source: §3 · p. 3
  • Validity guidance trains a time-dependent classifier on valid and invalid latent states, using generated invalid graphs as hard negatives in regions explored by the generator.Sampling follows the classifier’s validity gradient only after tstart, when samples approach the learned graph distribution, for stability and diversity.Source: §3 · pp. 3–4
  • Property-controlled generation conditions the flow field on a target vector and uses a differentiable predictor to adapt sampling toward the requested property.The predictor is trained on intermediate trajectory states; gradient guidance is applied after tstart because its gradient is unreliable near pure noise, and the decoder is unchanged.Source: §3 · p. 4
  • The validity-aware endpoint formulation weights endpoint likelihood by a frozen classifier’s validity score, which is a conditional probability rather than a latent-space density.Its objective combines a likelihood term on observed representations with a validity term that moves probability toward endpoints predicted to decode as valid.Source: §3 · p. 4
  • At inference, the endpoint distribution can provide a deterministic mean estimate or support stochastic sampling of multiple candidate endpoints, favoring candidates with higher predicted validity.Reweighting candidate endpoints uses the distribution’s uncertainty while favoring trajectories toward latent regions with higher predicted validity.Source: §3 · p. 5

4 Experiments

The experiments compare latent flow matching with explicit graph generators on QM9 and two PubChem size subsets, evaluating generation quality, validity, and computational costs. Latent flow matching achieves better FCD and higher VUN/T than explicit methods on PubChem16, while property guidance tracks molecular targets across QM9 and PubChem16.

4.1 Experimental Setup

  • Experiments use QM9 and PubChem subsets capped at 16 and 32 heavy atoms, compare against DiGress, Categorical Flow Maps, and VAE-prior sampling, and evaluate 20 runs of 1,024 molecules per configuration.All models use the same data splits.Source: §4.1 · p. 5

4.2 Unconditional Graph Generation and Validity Guidance

  • On PubChem16, VUN/T is up to 17 times higher for our model, which achieves better FCD than CFM variants and DiGress; DiGress has the highest validity only at 500 steps.At 20 NFE, our model takes 4 seconds per batch versus 70 seconds for DiGress at 500 steps.Source: Table 2 · p. 6, §4.2 · p. 7
  • On QM9, explicit methods dominate generation quality, but latent flow matching has a shallower increase in generation time as integration steps grow.Latent generation's dominant cost is the single final decoding step, whereas explicit methods operate on the full graph at every step.Source: §4.2 · p. 7
  • On PubChem32, latent flow matching improves validity sevenfold over the base VAE but reaches about 74.5%, below DiGress at 99% with 500 steps; CFM was not trained there.The reported reason was CFM's 73-hour training cost on PubChem16, a dataset seven times smaller.Source: §4.2 · p. 7
  • Validity guidance improves chemical validity while preserving distributional fidelity on QM9 and PubChem16, but incurs a significant FCD cost and does not improve validity on PubChem32.The authors attribute the PubChem32 result to latent-space complexity relative to the validity predictor's 800,000 training samples.Source: §4.2 · p. 7
  • Latent flow matching costs roughly two orders of magnitude less to train than CFM on QM9, and its graph representation can be reused across generative tasks.The training-cost comparison excludes one-time encoder-decoder pretraining, whose cost can be amortized across tasks.Source: §4.2 · p. 7, Table 3 · p. 8

4.3 Property-Guided Generation

  • Across QM9 and PubChem16, generated property means track targets over a broad range, and gradient guidance improves target fidelity more than conditioning alone.The largest gains are for logP, with consistent improvements for molecular weight.Source: §4.3 · p. 8
  • Both deterministic and variational GraViti representations support property control, with the variational latent space yielding more accurate target matching.Source: §4.3 · p. 8

Validity under property control.

Global validity is strongest for common training-distribution targets, while target-wise validity reveals weaker performance for rare or out-of-distribution properties. Local validity and uniqueness remain high within the training distribution.

Validity under property control

  • Above 0.92 validity with maximal uniqueness on PubChem16; on QM9, global validity remains close to the unconditional regime.Global conditioning samples targets according to their empirical training distribution.Source: Validity under property control · p. 9
  • Local validity and uniqueness remain high within the training range, but validity degrades mainly for increasingly rare or out-of-distribution targets.The authors also report qualitative robustness beyond the training range.Source: Validity under property control · p. 9
  • Global validity can conceal target-wise variation because empirical target sampling gives greater weight to high-density regions.Local validity is computed independently for each prescribed target value.Source: Validity under property control · p. 9

5 Conclusion

The paper uses flow matching in a high-fidelity graph-level autoencoder’s latent space and reports strong distributional fidelity against explicit graph-generation baselines. It also describes a validity trade-off and proposes property-aware latent structure as future work.

5 Conclusion

  • The method reaches state-of-the-art FCD against more complex explicit graph-generation baselines, while generating up to 10 times faster and retaining larger distributional fidelity.Validity decreases relative to DiGress by up to 25 points on PubChem32.Source: §5 · p. 9
  • Future work could structure the latent space around explicit chemical properties to further improve performance and application suitability.The conclusion presents this as a possible future direction.Source: §5 · p. 9

A Influence of the Latent Representation on Property Control

The deterministic GraViti autoencoder space supports property steering, while the variational representation improves target fidelity. Validity and uniqueness remain high within the training distribution but weaken for rarer or more extreme targets.

A Influence of the Latent Representation on Property Control

  • Generated logP and molecular-weight properties closely follow requested targets in the deterministic AE space on PubChem16.The same dataset, properties, and guidance protocol are used for the deterministic and variational comparisons.Source: A Influence of the Latent… · p. 14, Figure 3 · p. 14
  • MAE falls from 0.247 to 0.154 for logP and from 3.923 to 2.578 for MW in the variational representation.The authors report increased Pearson correlations alongside these MAE decreases.Source: A Influence of the Latent… · p. 14

B Validity under Property Control

C Extended CFM Training on PubChem16

The extended PubChem16 experiment trains CFM-CSD and CFM-ECLD for 30 epochs, approximately 107 GPU hours, and reports unconditional-generation metrics across sampling-step counts.

C Extended CFM Training on PubChem16

  • 30 training epochs, approximately 107 GPU hours, are used for the extended CFM-CSD and CFM-ECLD runs on PubChem16.The experiment assesses whether performance is primarily limited by training duration.Source: C Extended CFM Training on PubChem16 · p. 16
  • Performance is reported across different numbers of sampling steps for both CFM variants.The passage specifies the evaluation scope but supplies no numerical outcomes.Source: C Extended CFM Training on PubChem16 · p. 16, Table 5 · p. 16
  • The reported unconditional-generation metrics are validity, uniqueness, and novelty, each given as mean ± standard deviation.The table covers CFM-CSD and CFM-ECLD on PubChem16 after the extended training.Source: Table 5 · p. 16

D Global Validity under Property Control

With targets sampled from their empirical training distribution, property guidance preserves high validity and diversity on QM9 and PubChem16. The section also describes latent flow sampling, guided dynamics, and qualitative examples.

D Global Validity under Property Control

  • Above 0.92 validity and maximal uniqueness are retained on PubChem16 under both logP and molecular-weight guidance.On QM9, validity remains close to the unconditional regime for both properties, while uniqueness also remains high.Source: D Global Validity under Property Control · p. 17

E.1 Basic principle

  • Flow matching transports samples from a simple source distribution to encoded graph representations, then integrates the learned field and decodes the resulting latents.Mini-batch optimal-transport couplings can be used to construct more coherent training paths.Source: §E.1 · p. 18

E.2 Guided generation

  • Conditional flow matching and post-hoc predictor gradients guide latent sampling toward specified graph-level properties.The guidance strength λ controls the gradient-based adjustment to the vector field.Source: §E.2 · p. 18

E.3 ODE Solvers

  • Euler uses one velocity evaluation per integration step, while midpoint and Heun use two, so S steps correspond to S versus 2S function evaluations.The section considers these three explicit integration schemes.Source: §E.3 · pp. 18–19

F Qualitative examples on PubChem32

G Examples of Property-Guided Generation

H Influence of the Latent Representation on Property Control

The comparison reuses deterministic and variational GraViti latent spaces without training property-specific encoders or decoders. Both permit property control, but the variational representation matches targets more accurately.

H Influence of the Latent Representation on Property Control

  • The variational representation achieves lower MAE and higher Pearson correlation than the deterministic representation for logP and molecular weight control.Both representations are evaluated with the same guidance protocol on PubChem16, using spaces reused from unconditional generation.Source: H Influence of the Latent… · p. 24, Table 7 · p. 24
  • The variational representation's stronger target matching is consistent with GraViti property-optimization results favoring that latent space for navigating molecular properties.Source: H Influence of the Latent… · p. 24

I Training settings

The training-settings section summarizes the retained models' hyperparameters and describes a residual MLP velocity field trained on normalized VAE latents. Sampling integrates that field before denormalizing and decoding.

I Training settings

  • The retained models' architecture, training, and sampling hyperparameters are summarized in Table 8.The property-guided settings tables specify standardized conditioning properties for QM9NoHydro and PubChem16, with no latent transformation applied.Source: I Training settings · p. 25, Table 8 · p. 26, Table 9 · p. 27

I.1 Vector Field Network

  • A residual MLP models the velocity on normalized VAE latents, with sinusoidal time embeddings and either input concatenation or per-block FiLM conditioning.Its final projection produces a velocity matching the latent dimension.Source: §I.1 · p. 25
  • Training interpolates Gaussian noise and a data latent linearly, then minimizes the conditional flow-matching objective; sampling integrates the field, denormalizes, and decodes.Noise-data pairs may optionally be drawn from a Sinkhorn-regularized minibatch optimal-transport plan, yielding straighter trajectories.Source: §I.1 · p. 25
Loading 2610.06468v1…