Efficient Flow Matching using Latent Variables

Anirban Samaddar, Yixuan Sun, Viktor Nilsson, Sandeep Madireddy

TL;DR

This paper introduces Latent-CFM, a novel flow matching framework that leverages latent variables extracted from data using pre-trained deep latent variable models. This approach significantly improves training efficiency and generation quality for high-dimensional datasets by explicitly incorporating their underlying clustering structure, outperforming existing methods in both natural image generation and physically-constrained data modeling.

What Problem Does This Paper Address?

Generative models like Flow Matching (FM) learn to transform a simple distribution (e.g., Gaussian noise) into a complex data distribution. However, current FM models often overlook the inherent structure within the target data, such as low-dimensional manifolds and clustering. This oversight leads to inefficient training and suboptimal generation quality, especially for complex, real-world datasets. The paper aims to address this by developing a more efficient FM framework that explicitly utilizes the data's underlying structure.

Methods

The core contribution is Latent-CFM, a framework that enhances conditional flow matching (CFM) by incorporating latent variables. Instead of directly conditioning the flow on source and target data points, Latent-CFM conditions it on latent features extracted from the data using pre-trained deep latent variable models (like VAEs or GMMs).

Here's a breakdown:

  • Latent Variable Extraction: A pre-trained encoder (e.g., from a VAE) extracts a low-dimensional latent representation f from the input data x.
  • Conditional Flow Network: The flow matching network v(x, f, t) is then conditioned on both the current data point x and the extracted latent feature f.
  • Efficient Training: This conditioning allows the model to leverage the data's inherent clustering structure, leading to more efficient learning and improved sample quality. The framework can either jointly train the encoder and flow network or fine-tune a pre-trained encoder, offering flexibility and efficiency.
  • Interpretability: The use of latent features also enables conditional generation based on these features, providing a degree of interpretability to the generation process.

Datasets

The authors evaluated Latent-CFM on several datasets:

  • Synthetic Data: A 2D triangle dataset with 16 modes was used to demonstrate the model's ability to capture multimodal distributions.
  • Natural Image Datasets: MNIST, CIFAR10, and ImageNet (256x256) were used for unconditional image generation tasks.
  • Physical Process Data: A 2D Darcy flow dataset was used to evaluate the model's ability to generate physically accurate spatial fields.

Key Insights and Ideas

  • Structure is Key: Explicitly incorporating the underlying clustering structure of data into generative models, rather than treating data as a monolithic distribution, is crucial for efficiency and quality.
  • Leveraging Pre-trained Models: Reusing pre-trained deep latent variable models (like VAEs) as feature extractors is a highly effective strategy for Latent-CFM, significantly boosting training speed and performance.
  • Interpretability through Latents: Conditioning generation on latent features opens doors to understanding why certain samples are generated and allows for controlled, feature-based generation.
  • Beyond Natural Images: The success on the Darcy flow dataset highlights the broad applicability of Latent-CFM to scientific modeling tasks where physical consistency is paramount.

Key Results

  • Improved Generation Quality: Latent-CFM consistently achieved better or comparable generation quality (measured by FID for images and PDE residuals for Darcy flow) compared to state-of-the-art flow matching methods like I-CFM and OT-CFM.
  • Significant Training Efficiency: Latent-CFM demonstrated substantial reductions in training time and computation, often requiring up to 50% fewer training steps to reach comparable performance levels. For example, on CIFAR10, it achieved similar FID with 50% fewer steps.
  • Physically Accurate Samples: On the 2D Darcy flow dataset, Latent-CFM generated samples that were more physically accurate, as evidenced by lower residuals of the governing partial differential equations, outperforming I-CFM even with smaller model sizes.
  • Multimodal Data Handling: Latent-CFM successfully captured the multimodal structure of synthetic datasets, a feat that other conditional FM models struggled with.

Limitations and Future Work

  • Hyperparameter Tuning: The paper notes that selecting the optimal KL regularization parameter β for Latent-CFM can be challenging, and a formal strategy for this selection is an interesting future research direction.
  • Disentangled Latent Spaces: While Latent-CFM enables conditional generation, further work on disentangling latent features could lead to more controlled and interpretable generation.
  • Learned Priors: Exploring data-driven learned priors for the latent space could potentially tighten the upper bound in the loss function and further improve performance.
  • Multifidelity Modeling: The authors suggest exploring Latent-CFM's application in scientific machine learning, particularly in multifidelity modeling, where it could inform expensive simulations with insights from cheaper ones.

Summary updated

BibTeX
@inproceedings{samaddar2026efficient,
  author = {Anirban Samaddar and Yixuan Sun and Viktor Nilsson and Sandeep Madireddy},
  title = {{Efficient Flow Matching using Latent Variables}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=P7Wbb1wYLK},
}
Figure