[Paper Review] Flow Matching in Latent Space
This paper proposes latent flow matching (LFM), a novel framework that applies flow matching in the latent space of pretrained autoencoders to improve computational efficiency and scalability for high-resolution image generation. By training flow matching on compressed latent representations and integrating classifier-free guidance for conditional generation, LFM achieves state-of-the-art performance on tasks like image inpainting, semantic-to-image synthesis, and class-conditional generation, with FID scores of 4.09 and 26.3 on CelebA-HQ 256, while maintaining fast sampling and reduced training costs.
Flow matching is a recent framework to train generative models that exhibits impressive empirical performance while being relatively easier to train compared with diffusion-based models. Despite its advantageous properties, prior methods still face the challenges of expensive computing and a large number of function evaluations of off-the-shelf solvers in the pixel space. Furthermore, although latent-based generative methods have shown great success in recent years, this particular model type remains underexplored in this area. In this work, we propose to apply flow matching in the latent spaces of pretrained autoencoders, which offers improved computational efficiency and scalability for high-resolution image synthesis. This enables flow-matching training on constrained computational resources while maintaining their quality and flexibility. Additionally, our work stands as a pioneering contribution in the integration of various conditions into flow matching for conditional generation tasks, including label-conditioned image generation, image inpainting, and semantic-to-image generation. Through extensive experiments, our approach demonstrates its effectiveness in both quantitative and qualitative results on various datasets, such as CelebA-HQ, FFHQ, LSUN Church & Bedroom, and ImageNet. We also provide a theoretical control of the Wasserstein-2 distance between the reconstructed latent flow distribution and true data distribution, showing it is upper-bounded by the latent flow matching objective. Our code will be available at https://github.com/VinAIResearch/LFM.git.
Motivation & Objective
- To address the high computational cost and slow sampling of pixel-space flow matching models.
- To enable efficient, scalable high-resolution image synthesis by transferring flow matching into the latent space of pretrained autoencoders.
- To extend flow matching to conditional generation tasks, including class-conditional image generation, inpainting, and semantic-to-image synthesis.
- To introduce classifier-free guidance into flow matching for improved conditional generation quality.
- To theoretically bound the Wasserstein-2 distance between the reconstructed and true data distributions in the latent space.
Proposed method
- Apply flow matching in the latent space of a pretrained autoencoder, using the bottleneck representation as the latent manifold for generative modeling.
- Design a conditional velocity field network that takes latent code, condition (e.g., class label, mask, or image), and time as input to predict flow dynamics.
- Integrate classifier-free guidance into the velocity field network by training with both conditional and unconditional flows, enabling flexible conditional sampling.
- Use adaptive ODE solvers (e.g., Runge-Kutta) for efficient and accurate sampling in the latent space.
- Jointly train the latent flow matching network and a conditional embedding head (e.g., for layout-to-image) using a flow matching objective.
- Theoretical analysis shows the Wasserstein-2 distance between the reconstructed and true data distributions is upper-bounded by the latent flow matching objective.
Experimental results
Research questions
- RQ1Can flow matching in the latent space significantly reduce computational cost while maintaining high image quality?
- RQ2How well can latent flow matching generalize across diverse conditional image generation tasks such as inpainting and semantic-to-image synthesis?
- RQ3Can classifier-free guidance be effectively adapted to flow matching to improve conditional generation performance?
- RQ4What is the theoretical relationship between the latent flow matching objective and the true data distribution in terms of Wasserstein-2 distance?
- RQ5How does the choice of autoencoder architecture affect the performance of latent flow matching?
Key findings
- LFM achieves an FID score of 4.09 on the CelebA-HQ 256 inpainting benchmark, outperforming most existing methods and approaching the SOTA score of 2.94 from MAT.
- On the semantic-to-image task, LFM achieves an FID score of 26.3 on CelebA-HQ 256, demonstrating strong performance with a simple architecture and no specialized design.
- The method enables fast sampling with only 50 steps using an adaptive ODE solver, achieving competitive inference speed.
- Classifier-free guidance in LFM leads to a significant performance gain, reducing FID from 16.71 to 8.58 under the same settings.
- Theoretical analysis confirms that the Wasserstein-2 distance between the reconstructed and true data distributions is upper-bounded by the latent flow matching objective, validating the method's statistical consistency.
- Despite using a smaller model than LDM, LFM achieves superior performance gains with classifier-free guidance, suggesting scalability potential with larger architectures.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.