Weighted Conditional Flow Matching

Sergio Calvo-Ordonez, Matthieu Meunier, Alvaro Cartea, Christoph Reisinger, Yarin Gal +1 more
7/29/2025
cs.LG

No official code found. Best implementation: primepake/w-cfm (6 stars, last commit 2025-09-28).

Abstract

Conditional flow matching (CFM) has emerged as a powerful framework for training continuous normalizing flows due to its computational efficiency and effectiveness. However, standard CFM often produces paths that deviate significantly from straight-line interpolations between prior and target distributions, making generation slower and less accurate due to the need for fine discretization at inference. Recent methods enhance CFM performance by inducing shorter and straighter trajectories but typically rely on computationally expensive mini-batch optimal transport (OT). Drawing insights from entropic optimal transport (EOT), we propose Weighted Conditional Flow Matching (W-CFM), a novel approach that modifies the classical CFM loss by weighting each training pair $(x, y)$ with a Gibbs kernel. We show that this weighting recovers the entropic OT coupling up to some bias in the marginals, and we provide the conditions under which the marginals remain nearly unchanged. Moreover, we establish an equivalence between W-CFM and the minibatch OT method in the large-batch limit, showing how our method overcomes computational and performance bottlenecks linked to batch size. Empirically, we test our method on unconditional generation on various synthetic and real datasets, confirming that W-CFM achieves comparable or superior sample quality, fidelity, and diversity to other alternative baselines while maintaining the computational efficiency of vanilla CFM.

View on arXivView PDF

Code Implementations(1)

primepake/w-cfmCommunity72%

Implement of W-CFM (Weighted Conditional Flow Matching)

61PythonAug 3, 20251 years ago

Similar Papers

Cite this paper

@article{calvoordonez2025weighted,
  title  = {Weighted Conditional Flow Matching},
  author = {Sergio Calvo-Ordonez and Matthieu Meunier and Alvaro Cartea and Christoph Reisinger and Yarin Gal and Jose Miguel Hernandez-Lobato},
  year   = {2025},
  eprint = {2507.22270},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.22270v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.22270.svg)](https://codeofpaper.com/paper/2507.22270)

Discussion