Optimal Flow Matching: Learning Straight Trajectories in Just One Step

Over the several recent years, there has been a boom in development of Flow Matching (FM) methods for generative modeling. One intriguing property pursued by the community is the ability to learn flows with straight trajectories which realize the Optimal Transport (OT) displacements. Straightness is crucial for the fast integration (inference) of the learned flow's paths. Unfortunately, most existing flow straightening methods are based on non-trivial iterative FM procedures which accumulate the error during training or exploit heuristics based on minibatch OT. To address these issues, we develop and theoretically justify the novel \textbf{Optimal Flow Matching} (OFM) approach which allows recovering the straight OT displacement for the quadratic transport in just one FM step. The main idea of our approach is the employment of vector field for FM which are parameterized by convex functions.

Paper

References (74)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer qt8g7/10 · confidence 3/52024-06-29

Summary

This paper aims to solve the optimal transport problem between two distributions within a flow matching framework. This can be achieved by finding the best velocity model $u_t$ in a class of optimal vector fields, i.e., $u_t$ be implicitly induced by defining the $x_1=\nabla \Phi(x_0)$ where $\Phi$ is a convex function. The authors prove that the resulting (optimal) flow matching loss is equivalent to the dual formulation of the OT problem and regression towards the dynamic OT field. However, optimizing the optimal flow matching loss can be computationally expensive, as the velocity model is only implicitly defined. Despite this, the study of the relationship between the optimal flow matching problem and optimal transport can be a strong contribution.

Strengths

- In general, this paper is well-written and easy to follow. - Lemma 1 and its corollaries make a strong contribution to the community. It proves that the OT problem can be equivalently solved by simply optimizing the flow matching loss in the ``optimal vector fields'' family. In fact, this is a rather surprising result for me. - In theory, the proposed optimal flow matching method can learn the OT map after one round of training, regardless of the reference distribution. - The experiments are well-designed and convincing. The 2D experiment with different reference distributions (especially the anti-minibatch) is illustrative.

Weaknesses

- The practical implementation of OFM is rather computationally expensive. It would be fine to add a table to directly compare the training times of different methods, or a figure showing the convergence as a function of computation time. I don't think this will lessen the contribution of this paper. - As the authors claim that OFM learns straighter trajectories, comparing OFM to other baselines on standard generation benchmarks, e.g., CIFAR10, would be better.

Questions

On the image-to-image transfer task, do you use unpaired training data? If the answer is yes, is it costly to compute the minibatch OT? Still, in this case, what is the tensor shape of the 512-dimensional latent space? I think 512 is much smaller than other latent space models.

Rating

7

Confidence

3

Soundness

4

Presentation

3

Contribution

4

Limitations

the authors adequately addressed the limitations

Reviewer nvT55/10 · confidence 4/52024-07-12

Summary

This work proposes Optimal Flow Matching (OFM), which restricts standard Flow Matching to specific vector fields that yield straight trajectories by design. This is implemented by considering vector fields such that a convex function exists whose gradient pushes the initial to the final point. The authors propose to solve this optimization problem with training that involves solving a convex optimization problem in each iteration to obtain the inverse of the flow map. Then, it is shown that this procedure has the same minimizer as the one minimizing the dual OT loss. The authors empirically validate OFM quantitatively on the Wasserstein-2 benchmark and qualitatively on FFHQ.

Strengths

- The authors derive a new training procedure based on Flow Matching restricted to fully straight vector fields implemented through the gradient of a convex function. - The authors provide a new insight into the connection between minimizing an OT loss and Flow Matching. Specifically, they show that the minimizer of these two losses is equivalent when restricted to straight vector fields.

Weaknesses

Missing comparison and contextualization of related work: - In [1], it was proposed to approximate the computation of the conjugate with amortized optimization and solve this with Adam or L-BFGS. The proposed *SubOpt* in this work (solved with Adam/L-BFGS) is equivalent to the convex conjugate optimization when $t=1$. A discussion between these two optimization schemes should be included. Specifically, how does OFM compare to [1] when only sampling $t=1$? What is gained by considering $t\sim \mathcal{U}[0,1]$? Additionally, the Wasserstein-2 benchmark results from [1] are not considered in the paper. This is the most related method and outperforms the method proposed in the paper on all dimensions. These results should be included as well as a comparative discussion. Experiments: - No quantitative results are provided for the unpaired image-to-image translation experiments. It is hard to generalize the results over a few qualitative results. Thus, including some commonly used quantitative metrics like FID or the ones used in the Wasserstein-2 benchmark on CelebA64, as done in [1], would be very beneficial. Minor Weaknesses: - Inconsistency on the optimizer used to solve *SubOpt*. In Appendix C, it is stated that "in all our experiments as the subOpt optimizer we use LBFGS"[line 557] while in Appendix B, it says "(with Adam optimizer)"[line 534]. Which one is actually used? How do Adam and LBFGS compare? - Some of the wording can be improved, e.g. "... via fancy formula (18) is not trivial and requires tricky integration techniques."[line 194] [1] Brandon Amos. "On amortizing convex conjugates for optimal transport". In ICLR 2023.

Questions

- The goal of OFM is to learn a time-independent one-step model that translates $x_0$ to $x_1$. Then, during inference, no ODE is solved. As mentioned above, some more motivation could improve clarity here. Specifically, explaining why it is beneficial to formulate this in the FM framework considering $t\sim \mathcal{U}[0,1]$. Would the proposed method also work when only sampling $t=1$? The authors only mention that the subproblem (20) is $(1-t)$-strongly convex, which gives a benefit compared to $t=1$. Are there other benefits of the proposed formulation? - In Figure 2, it is shown that OFM learns the same solution for different choices of couplings. In [2], it was shown that only the OT coupling is preserved when using standard Flow Matching. What do these illustrative examples look like for standard FM training? I assume they would learn different trajectories, but do the learned endpoints differ? - In this work, only ICNNs are considered. As shown in previous works, even when wanting to learn a convex function, MLPs can also work well, i.e., in [1], they work better compared to ICNNs. Does OFM also work with standard MLPs/CNNs/etc? How is the comparative performance? [1] Brandon Amos. "On amortizing convex conjugates for optimal transport". In ICLR 2023. [2] Valentin De Bortoli and Guan-Horng Liu and Tianrong Chen and Evangelos A. Theodorou and Weilie Nie. "Augmented Bridge Matching". In Arxiv 2023.

Rating

5

Confidence

4

Soundness

2

Presentation

2

Contribution

2

Limitations

- The limitations of the flow map inversion, the Hessian computation, and ICNNs are laid out in the paper, and details for the experiments' computational time are provided. - While these computational times give some insight, detailed information on time and space complexity with respect to the input dimension would be even more beneficial. Additionally, comparing the runtime of OFM and standard FM training would provide a more illustrative comparison of raw computational time.

Authorsrebuttal2024-08-12

The discussion period deadline is approaching...

Dear reviewer nvT5. Thank you for your time efforts to review our paper. The discussion period is coming to the end. We would appreciate your feedback on our responses. We are happy to answer any further questions during the remaining discussion period. Thank you in advance, Authors.

Reviewer YPMs6/10 · confidence 2/52024-07-13

Summary

The paper goal is to learn the optimal transport map between any two distributions. The approach derives a flow matching loss which is minimized by the velocity field of the optimal transport map.

Strengths

The paper investigate the interesting subject of the optimal transport problem.

Weaknesses

The paper is written in an unprofessional form: 1. Theorems and propositions are structured in a way which makes it very hard to follow. 2. The author does not make any attempt to give an accessible main proof idea/proof sketch in the main paper. Specifically, it is expected to provide one for Theorem 1 which seems to be the key claim of the paper. 3. The proof of Theorem 1 in the appendix is unclear and unsatisfying. 4. The experiment section is rather minimal. In particular, it is not clear what Figure 3 in the Image-to-Image task presents.

Questions

In essence, does the author claim that the $\mathcal{L}^{\pi}\_{OFM}(\Psi)$ loss presented in equation (16) is minimized by the velocity field of the optimal transport map for any plan $\pi$? As stated by the author, it seems this loss is by definition Flow Matching (FM) loss constrained to convex functions. For the independent plan, i.e., $\pi=p_0\times p_1$ the minimizer for the FM loss is explicitly given in [1], $$ u_t(x) = \frac{1}{p_t(x)}\int u_t(x|x_1)\frac{p_t(x|x_1)p_1(x_1)}{p_t(x)}dx_1, $$ where for the linear interpolant $u_t(x|x_1) = \frac{x_1-x}{1-t}$. This minimizer is dependent solely on the source and target distribution (i.e., the plan for this case) and does not yield the optimal transport. If you could please explain how you overcame this. [1] Lipman, Yaron, et al. "Flow matching for generative modeling." arXiv preprint arXiv:2210.02747 (2022).

Rating

6

Confidence

2

Soundness

2

Presentation

1

Contribution

2

Limitations

-

Reviewer YPMs2024-08-12

Reviewer response

I want to thank the authors for their response. Following the reviewers answers, I have invested more time in better following the authors claim and proofs. It is now my understanding that the key results of the paper is that the minimizer of FM loss constrained to velocity field which are a gradient of convex functions is the OT map. I acknowledged this is an important results and I will raise my score.

Reviewer Bhuh5/10 · confidence 4/52024-07-18

Summary

This paper introduces the Optimal Flow Matching (OFM) algorithm, which improves upon Rectified Flow and OT-CFM by generating exact straight trajectories and recovering the optimal transport map in one iteration. OFM optimizes Flow Matching loss using vector fields and a convex function. The algorithm is implemented with Input Convex Neural Networks (ICNNs) and includes an explicit gradient formula for loss calculation. Experiments demonstrate OFM's better performance on 2D, high-dimensional benchmarks, and in unpaired image-to-image translation. OFM achieves good results in the latent space of a pretrained autoencoder without needing ODE integration.

Strengths

Strengths: - The problem is sound and essential. - The proposal is supported by both theoretical and empirical evidence.

Weaknesses

- The success of the algorithm in high-dimensional tasks relies on pretrained autoencoders. To what extent does the performance of the pretrained autoencoders affect the performance of the proposal? - The assumption that the optimal transport map can be recovered in one iteration might not hold in all scenarios, particularly in more complex distributions. - How do you calculate the initial transport plan? Does OFM suffer from distorted or biased dynamic OT solutions like OT-CFM? - The proposal is compared with OT-CFM and Rectified flow. However, the main task of the baselines in their original paper was image generation in pixel space. Is it fair to exclude this task from the experiments? - It is essential to provide more justification for using metrics in the experimental section. What are the advantages of these metrics over others in works on Unpaired Image-to-Image Translation tasks, such as [1] and [2]?

Questions

- Does OFM still work in the pixel space or a higher-resolution dataset? - Could you provide empirical running time and OFM time complexity? - Does the method work for the conditional generation, which is feasible for Rectified flow? - OFM does not need ODE for the sampling process; however, could using an ODE solver for sampling improve the performance of OFM, which is some kind of quality-time tradeoff?

Rating

5

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

**References** [1] Zhu, Jun-Yan, et al. "Unpaired image-to-image translation using cycle-consistent adversarial networks." Proceedings of the IEEE international conference on computer vision. 2017. [2] Xie, Shaoan, et al. "Unpaired image-to-image translation with shortest path regularization." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2023.

Reviewer qt8g2024-08-08

I thank the authors for their clarifications and additional experiments. I will keep my score.

Reviewer Bhuh2024-08-12

Thank you the the authors for their responses. Your responses partially address my concerns about the paper. I have raised the score by one point to reflect my positive attitude toward the additional explanation and empirical results.

Reviewer nvT52024-08-12

Thank you for the detailed comments and added experiments. This cleared up a lot of my questions, and I've decided to raise my score 4->5 as I think the paper has an interesting theoretical contribution. I still have concerns regarding the scalability of the method because of its reliance on ICNNs making it very hard to scale up to real word examples like pixel-space image generative modeling. The authors mention that the main competitive methods of their proposed method are different Flow Matching methods but the work does not include results on any common generative modeling benchmarks as also mentioned by Reviewer Bhuh. These other FM methods don't have any problems scaling up to arbitrary dimensions. This should be sufficiently discussed and contextualized in the revised manuscript. Also as mentioned in my rebuttal, I believe [1] is a more closely related work to the proposed method with respect to the Optimal Transport benchmark and outperforms it across all dimensions.

Authorsrebuttal2024-08-14

Thank you! and concluding comments

Dear Reviewer, we thank you for your answer and for highlighting the theoretical contribution of our work. We are very grateful for the score increase. Let us leave some concluding comments. 1. We agree that the reliance on the ICNNs makes the practical adaptation of our methodology to high-dim generative image setups to be tricky. Following your suggestions, we will expand the corresponding limitation subsection (**ICNNs**) accordingly. 2. The work [1] which is based on the amortization methodology will receive due attention in our revised manuscript. In particular, we acknowledge that we will include the benchmark results of [1] in our Table. With regard to the superior performance of [1], we humbly believe that achieving the SOTA metrics on the benchmark lies primarily on the surface of technical solutions. I.e., particular architectures, optimizers, schedulers, regularizers etc. To support our point, we provide the additional results for our method fitted on the benchmark, but with additional exponential moving average (EMA) of the trained model weights. Note that EMA does not change the training process itself - it just creates a smoothed copy of the model whose weights are updated (at each new training iteration $t + 1$) as $W^{\text{ema}}\_{t + 1} = \alpha W^{\text{ema}}\_{t} + (1 - \alpha) W\_{t + 1}$, where $W_{t + 1}$ are the newly updated original trained weights. Our results for $\mathcal{L}^2$-UVP are in the table below ($\alpha = 0.999$). For completeness, we also recall the metrics for our models without EMA and additionally grab the benchmark results from [1]. | Solver/dim | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | |-------------------|----------|----------|---------|---------|---------|---------|----------|----------| | OFM MB (ema) | $\textit{0.15}$ | $\textit{0.52}$ | $\textit{1.2}$ | $\textit{1.0}$ | $\textbf{1.2}$ | 7.2 | $\textit{1.5}$ | 2.9 | | OFM MB | 0.33 | 0.81 | 1.5 | 2.0 | 3.4 | 10 | 6.7 | 11.7 | | [1] (ICNNs) | 0.26 | 0.78 | 1.6 | 1.1 | $\textit{1.9}$ | $\textit{4.2}$ | 1.6 | $\textit{2.0}$ | | [1] (MLP) | $\textbf{0.03}$ | $\textbf{0.22}$ | $\textbf{0.6}$ | $\textbf{0.8}$ | 2.0 | $\textbf{2.1}$ | $\textbf{0.67}$ | $\textbf{0.59}$ | As we can see, the utilization of a rather cheap technique allows obtaining much better results, compared to those reported in our article. Regarding [1], it seems they did not utilize EMA in their experiments. Probably, the usage of EMA in their experiments also will lead to better results. Our newly provided table is not about competing with [1]. We just want to stress that the point of our benchmark experiments is to demonstrate the applicability and success of our proposed methodology - and we humbly think that we managed to achieve this goal - by demonstrating rather good and close-to-the-best metrics. One more time, we are grateful to the reviewer for the valuable comments, and we will incorporate the necessary edits in the revised manuscript.

Authorsrebuttal2024-08-14

We are very grateful to the Reviewers for valuable questions, fruitful discussions and raising the scores. In the final version, we will make the following edits: 1) include time convergence graph (Appendix), extra OT baselines and OFM improved metrics (few rows in Table 1), I2I FID (Section $4.3$), FM examples and amortization (Appendix), (nvT5, qt8g); 2) restructure Section 3, (following the reply to YPMs); 3) discuss the intricacy of high-dimensional (i.e., image data) generation in Limitations section, (nvT5, Bhuh).

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC