Manuscript Offprint
arXiv:2610.05921Beyond Transport Cost: Routing Differences between Flow Matching and Optimal Transport
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
In generative models, Optimal Transport (OT) is used to improve Flow Matching (FM) by reducing noise-data coupling cost. However, different noise-to-output assignments can yield nearly equal costs, raising a key question. Is cost alone sufficient to guide coupling design? We address this question by separating transport cost from routing, i.e., the destination reached by each noise sample. We show numerically how FM and OT can differ in routing while remaining close in cost. We examine its consequences in learned neural FM. Using the exact FM routing as an oracle, we further construct a routing-aware training coupling and find that it yields a directionally consistent improvement in generation over a cost-matched, cost-only counterpart. Our findings highlight what cost minimization can overlook and motivate using both cost and routing to evaluate the design of OT-based FM couplings. Code will be released upon acceptance.
Index Terms— Flow Matching Models, Optimal Transport
1. INTRODUCTION
Flow Matching (FM) generates data such as images by learning a velocity field that transports noise samples to a data distribution. A conventional formulation randomly pairs noise and data samples and trains on straight interpolations between them [1, 2]. However, these resulting generation trajectories can be curved, making accurate few-step generation difficult [1, 3, 4, 5]. This has motivated more structured training couplings, which specify how noise samples are paired with data samples.
Optimal Transport (OT) [6, 7] provides a principled approach to constructing these couplings. It makes trajectories straighter, which enables efficient few-step generation. Quadratic OT [8, 9] minimizes the average squared Euclidean distance between paired samples, and minibatch OT [4] approximates this within training batches. That is, by using OT to optimize coupling cost, we make the coupling cost of FM similar to that of OT.
However, recent research [10, 11] shows that even if FM and OT have the same cost, the routing– which specifies exactly where they are placed– may differ. To accurately observe the differences in routing, prior studies adopt a semi-discrete FM setting. In this setting, the source distribution is defined as a continuous distribution (e.g., Gaussian distribution), while the target is defined as discrete atoms. Therefore, a routing and boundary can be obtained depending on which atoms each initial noise in the source distribution is assigned to (as shown in Figure 1).
This leads to an overlooked question: If OT and FM achieve nearly the same transport cost while routing the same noise samples to different destinations, is minimizing coupling cost alone sufficient for FM?

(a) OT
(b) Exact FM
(c) Boundary disagreement
Fig. 1: Similar transport cost but different routing between FM and OT. Noise samples in each region arrive at the same target atom in the data space.
To answer this question, we investigate the quantitative relationship between FM and OT beyond simply examining a counterexample. Our contributions are as follows:
(i) We show that similar transport cost does not imply similar routing, and quantify this gap between FM and OT in a semi-discrete setting. (ii) We empirically validate that this cost-routing gap is observed in learned neural FM. (iii) We demonstrate that a routing-aware training objective yields a directional improvement in generation over a cost-only coupling.
Geometric Difference between FM and OT. FM does not generally recover the OT map. Rectified flow [1] reduces cost through iterative reflow, but the result remains suboptimal [10]. Prior work [11] offer some counterexamples showing that FM and OT can differ. However, it remains unclear how this difference in assignments arises numerically and how it affects generation. This distinguishes our work from neural OT methods that directly learn the OT map [16, 17].
3. PROPOSED METHOD
We aim to compare the rates at which cost and routing in FM and OT diverge. By demonstrating that cost diverges more slowly than routing, we highlight the risk of overlooking differences in routing when we optimize only the cost.
In Section 3.1, we define and to compare them through precise quantification. represents the difference in routing and represents the difference in cost. To enable an accurate comparison, we refine the semi-discrete FM setting [11] to a 4-target atom setting, as shown in Figure 2.
Corresponding author

Fig. 2: Different routing-boundary responses of FM and OT to the same atom rotation. Red: Exact FM, Blue: OT.
In Section 3.2, we observe how the routing changes each in FM and OT by moving one atom that changes routing. We define and to measure boundaries where the routing changes and as the difference between them. And we examine in closed form and show how it changes.
In Section 3.3, we go beyond moving one atom to moving the whole boundary. By observing this whole boundary, we measure the difference in the rates at which and differ in closed form.
Finally, Section 3.4 extends these results in the two-dimensional space to a general ambient dimension d.
3.1. Setup
We use a semi-discrete setting [11, 18]: a 2-dimensional continuous Gaussian source and four target atoms with law , where is a unit point mass and
Here is fixed, is counterclockwise rotation by radians, and . As shown in Figure 2, starting from where both cost and routing are identical in FM and OT we will vary to move the atom and observe how the routing and boundary change.
We can obtain the exact velocity of FM in this setting, which is used to compute where FM actually sends each noise sample, and to compute the cost of the map. For independent and , we set , where by linear interpolation [1, 2, 11]. Before calculating the velocity, we compute the posterior probability that given . This probability follows directly from Bayes' rule since each atom gives a Gaussian distribution over ,
Then, using , the velocity is obtained as
We define and to evaluate differences in routing and cost between FM and , respectively.
(4)
where is the destination index for and denotes the atom reached by solving the ODE from . is the probability that FM and OT disagree on which atom to send the noise to. measures how much extra cost FM pays compared to OT. Since OT achieves the minimum cost, always.
3.2. Boundary response to a single-atom moving
In this section, we show how the exact forms of routing and boundaries differ between FM and OT. Since routing ultimately depends on which atom noise moves to, we will move one of the four atoms set up in Section 3.1 by to observe how routing becomes different between FM and OT (see Figure 2). Furthermore, to examine the changes in the boundary where the routing changes, we define and as the boundaries for FM and OT, respectively, and derive the difference between them in closed form.
To observe changes in the boundary, we define the horizontal coordinate , , perpendicular to the boundary and use it as a reference to calculate how the boundaries change. Here refers to height of boundary. Since our goal is to show that the boundary changes rapidly relative to the cost, we take a first-order Taylor expansion of around :
where indicates the linear rate at which moves by . accounts for remaining higher-order terms; which vanishes faster than .
FM response. FM trajectory is denoted as , starting from a noise point at . To track how this trajectory moves as turns on, we rewrite it in coordinates that remove from the equations.
We make three substitutions: rescale the atoms by , , replace with , so runs from to as runs from to , with the final FM output at and rescale the trajectory, , to remove the contraction term in the velocity field. The exact velocity (3) then simplifies to
with primes now denoting u-derivatives.
At , the symmetric boundaries decouple the two coordinates of : each evolves independently by . A point started on the boundary between atoms 1 and 2 has , for all , while its vertical coordinate evolves as , the solution of started at height . We write this boundary trajectory as .
We now perturb and ask: how must the starting horizontal coordinate change at fixed to stay on the boundary? A point is on the boundary when it is equally likely, under FM, to reach either atom– the equal-posterior condition. Since this cannot be evaluated at directly, we first impose it at a finite time , and let only afterward. Let be the starting coordinate satisfying this finite-time condition. Differentiating it with respect to at 0 gives a linear ODE for the sensitivity :
(7)
Here is the quantity we want, up to horizon . Solving this linear ODE with an integrating factor gives
To recover the terminal response, we let , which requires an assumption:
Assumption A1. The finite-horizon boundaries converge, together with their first derivatives in , to their terminal boundaries as , locally near and away from the origin-i.e., the limit and the derivative in can be exchanged.
A1 lets us take directly inside the integral above, recovering the terminal response in Eq. 8
which is always finite since .
OT response and signed gap. We now compute the same way, but using OT's rule for assignment instead of an ODE. OT does not simply send each point to its nearest atom. It adjusts each atom's cost by an offset , called a dual potential, and sends each point to the atom with the lowest adjusted cost,
These offsets exist because without them, a plain nearest-atom rule would not send exactly probability of the Gaussian mass to each atom once the square is perturbed. The dual potentials are chosen exactly so that this equal-mass condition holds for all four atoms [9, 19]. We fix the one free constant in their definition by requiring .
Because is quadratic in , the boundary where two adjusted costs are equal is always a straight line, unlike the curved FM boundary above. In particular, the boundary between atoms 1 and 2 sits at since , where . This is independent of , so the upper OT boundary remains vertical and shifts horizontally. Differentiating the four equal-mass constraints with respect to gives
where is the standard Gaussian density and .
We can now compare the two responses directly. Define their difference,
so that . This tells us, at each height , how differently FM and OT respond to the same small change in .
changes sign. As increases, grows too (since and ). This pushes toward 0 for every fixed , so the integral in Eq. 12 shrinks and increases with . At the two extremes,
Since is monotonic and changes sign, there is exactly one height where . Below and above , FM and OT disagree in opposite ways: for small positive below , FM sends the strip near the boundary to the upper-left atom while OT sends it to the upper-right, above , this reverses. Either way, the two upper atoms only exchange samples between each other, neither atom's total share of samples changes.
The same pattern holds at all four boundaries. So far we studied only the upper boundary. The same steps apply to the other three boundaries (left, bottom, right) in Figure 2, each measured by its own axial distance :
| e | ||
|---|---|---|
| U(Upper), L(Left) | ||
| B(Bottom), R(Right) |
(14)
with . Every boundary shares the same signed gap , even though each one's individual shift differs. In other words, the sign change we found above is not special to the upper boundary. It appears at all four boundaries around the square.
3.3. First-order routing, second-order excess cost
Note that is the difference between the FM and OT boundary response, at each height on one boundary. This is a local quantity. But and , defined in Eq. 4, are global: they average over the whole noise distribution. In this section, we add up our local result over every height and every boundary, to obtain these global quantities. We will see that they grow at different rates as : routing disagreement grows quickly, in proportion to , excess cost grows only slowly, in proportion to . We call these two rates first-order and second-order in , respectively.
Why routing disagreement is first-order. Recall from Section 3.2 that, at height , FM and OT disagree over a thin strip of width as
This width is proportional to . Near the boundary, the density of noise samples does not depend on , only the strip's width does. So the probability mass inside the strip is proportional to the width and . Since is exactly this mass, summed over the four strips, grows linearly in .
Why excess cost is second-order. Exactly on the OT boundary, sending a point to either neighboring atom costs the same. Moving away from the boundary, this equality breaks, and the gap between the two costs grows. On the upper boundary, this gap grows linearly with the distance from the boundary: it equals exactly . Integrating this growing penalty across the strip, from the boundary () out to its far edge (), gives
Since is as in Eq.15, the above is . This is because both the strip's width and the penalty inside it shrink with , so the cost shrinks twice over, as rather than . The other three boundaries behave the same way.
Using the reduced costs from Section 3.2, the true cost of atom is . FM and OT both send probability to each atom, so the expected offset is the same, , for both, and cancels in their difference as
Two more assumptions. To add up the four strips rigorously, we need two assumptions. Near , all four boundaries meet at the origin, so this is where their interactions are hardest to control, so we isolate this region in a small square around the origin, whose size shrinks in proportion to . A2: outside , the disagreement consists of four disjoint adjacent-atom strips, parameterized by . Anything unusual, such as points where three or more atoms meet, stays confined inside . A3: farther out, for some fixed whose integral converges. Like A1, these are hypotheses on the exact terminal boundaries.
Conditional separation result. Under A1–A3, summing the mass and cost of the four strips, weighted by the Gaussian density, gives
The central junction contributes only mass at penalty each, i.e. total cost, which is negligible next to the above.
Equivalently, since ,
excess cost grows only as the square of routing disagreement. A large routing gap can therefore coexist with a small cost gap.
3.4. Extension to higher ambient dimensions
For with , we embed the atoms as and use source . Orthogonal decomposition reduces both assignments to [11]. Indexing the same metrics by ambient dimension gives
Thus are unchanged for these planar embeddings.
4. EXPERIMENTS
We test our theory in three steps. (i) We check whether predicts the boundary shift and the separation law in Eq. 18 in the exact, synthetic setting. (ii) We test whether this cost-routing gap survives when FM is learned by a network, and whether it affects generation quality. (iii) We test whether the gap extends to image data.
4.1. Setup
Exact setting. We use the Gaussian source and one-target rotation family of (1), sweeping (positive, negative, and the symmetric control). are computed once from the unperturbed dynamics and never refit, so all comparisons below are out-of-sample. FM is integrated to . OT offsets are solved independently.
Learned FM. We fix the source bank, targets, network, and training budget, and vary only the training coupling. We use 3-layer MLP with SiLU activations and train it with Adam ( ) for 8,000 updates with batch size 512, across ten random seeds. Cost Only (CO) minimizes pairing cost. Routing Aware (RA) maximizes agreement with the exact FM routing under a cost budget matched to CO (using exact routing as an oracle). Routing Bad (RB) matches the same cost budget but maximizes disagreement with instead.
4.2. Results
Table 1 confirms the theory in the exact setting. The Displacement rows show that our closed-form prediction matches the measured boundary shift, including the predicted sign change at . The Routing mass and Excess cost rows show that integrating this local prediction over the whole boundary reproduces the separation law: log-log slopes of 0.999 and 1.998 confirm that disagreement
Table 1: Numerical validation of the boundary-displacement prediction and the resulting cost-routing separation in Eq. 18.
| Quantity | Metric | Theory | Measured |
|---|---|---|---|
| Displacement | , full grid | - | 0.9986 |
| - | 0.9991 | ||
| Sign change at | 0.6455 | 0.6455 | |
| Routing mass | Log-log slope | 1 | 0.9992 |
| A vs. | 0.038038 | 0.038040 | |
| Excess cost | Log-log slope | 2 | 1.9976 |
| B vs. | 0.010222 | 0.010226 |
Table 2: Cost-matched learned-FM diagnostic. Coupling metrics are computed once. Routing and generation metrics report mean ± std over ten runs. MMD = Maximum Mean Discrepancy. FD = Fréchet Distance
| CO | .814 | .020 | .022 ± .008 | .022 ± .008 |
| RA | .818 | .013 | .020 ± .008 | .020 ± .008 |
| RB | .819 | .063 | .025 ± .008 | .025 ± .008 |
| CO | .076 ± .011 | .038 ± .008 | .012 ± .001 | .005 ± .002 |
| RA | .074 ± .012 | .038 ± .008 | .009 ± .000 | .003 ± .000 |
| RB | .076 ± .012 | .040 ± .006 | .011 ± .001 | .007 ± .002 |
Table 3: Cost-routing diagnostics and generation quality on MNIST.
| Coupling | C | FD | |
|---|---|---|---|
| CO | 0.818 | 0.025 | 24.72 |
| RA | 0.820 | 0.011 | 21.32 |
| RB | 0.821 | 0.071 | 28.54 |
mass grows linearly in while excess cost grows only quadratically, exactly as Eq. 18 predicts.
Table 2 shows that this separation survives learning, and it matters. Despite nearly identical , CO, RA, and RB differ sharply in : matching cost does not fix routing. This gap carries over to the trained network, with and lowest for RA and highest for RB. It also matters for generation. RA improves both MMD and FD over CO, while RB does not. This improvement is significant ( from paired t-tests over seeds).
4.3. Generalization to image data
To test whether this gap extends beyond the synthetic setting, we repeat the CO/RA/RB comparison on MNIST () under a continuous Gaussian source and a ten-class discrete target. We parameterize the velocity field with a time-conditioned U-Net with Adam optimizer, , and 8,000 updates with batch size 64. Since exact FM routing is unavailable here, we use the terminal assignments of a pretrained CO network as the routing oracle for RA and RB under the same cost constraint as Section 4.1.
Table 3 shows the same pattern as before. RA improves generation quality over CO. This suggests the cost-routing separation is not an artifact of the four-atom, though large-scale validation remains future work.
5. CONCLUSION
We showed that FM and OT couplings can attain nearly identical transport cost while routing samples to substantially different destinations and validated these results in learned neural FM. Our findings suggest that cost minimization alone may not fully characterize the quality of an OT-based coupling for FM, motivating routing-aware objectives as a complementary criterion in broader OT-FM training algorithms.
6. REFERENCES
[1] Xingchao Liu, Chengyue Gong, and Qiang Liu, “Flow straight and fast: Learning to generate and transfer data with rectified flow,” International Conference on Learning Representations, 2023.
[2] Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le, “Flow matching for generative modeling,” International Conference on Learning Representations, 2023.
[3] Zhengyang Geng, Mingyang Deng, Xingjian Bai, Zico Kolter, and Kaiming He, “Mean flows for one-step generative modeling,” Advances in Neural Information Processing Systems, vol. 38, pp. 75460–75482, 2026.
[4] Aram-Alexandre Pooladian, Heli Ben-Hamu, Carles Domingo-Enrich, Brandon Amos, Yaron Lipman, and Ricky TQ Chen, “Multisample flow matching: Straightening flows with minibatch couplings,” Proceedings of the 40th International Conference on Machine Learning, vol. 202, pp. 28100–28127, 2023.
[5] Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine, “Elucidating the design space of diffusion-based generative models,” Advances in neural information processing systems, vol. 35, pp. 26565–26577, 2022.
[6] Cédric Villani et al., Optimal transport: old and new, vol. 338, Springer, 2009.
[7] Marco Cuturi, “Sinkhorn distances: Lightspeed computation of optimal transport,” Advances in neural information processing systems, vol. 26, 2013.
[8] Yann Brenier, “Polar factorization and monotone rearrangement of vector-valued functions,” Communications on pure and applied mathematics, vol. 44, no. 4, pp. 375–417, 1991.
[9] Peyré Gabriel and Cuturi Marco, “Computational optimal transport with applications to data sciences,” Foundations and trends® in machine learning, vol. 11, no. 5-6, pp. 355–607, 2019.
[10] Johannes Hertrich, Antonin Chambolle, and Julie Delon, “On the relation between rectified flows and optimal transport,” Advances in Neural Information Processing Systems, vol. 38, pp. 172578–172610, 2026.
[11] Emile Pierret, Johannes Hertrich, Samuel Hurault, and Julie Delon, “Tessellations of semi-discrete flow matching,” arXiv preprint arXiv:2605.07513, 2026.
[12] Michael Albergo, Nicholas M Boffi, and Eric Vanden-Eijnden, “Stochastic interpolants: A unifying framework for flows and diffusions,” Journal of Machine Learning Research, vol. 26, no. 209, pp. 1–80, 2025.
[13] Alexander Tong, Kilian Fatras, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Guy Wolf, and Yoshua Bengio, “Improving and generalizing flow-based generative models with minibatch optimal transport,” Transactions on Machine Learning Research, 2024.
[14] Kilian Fatras, Younes Zine, Szymon Majewski, Rémi Flamary, Rémi Gribonval, and Nicolas Courty, “Minibatch optimal transport distances; analysis and applications,” arXiv preprint arXiv:2101.01792, 2021.
[15] Bharath Bhushan Damodaran, Benjamin Kellenberger, Rémi Flamary, Devis Tuia, and Nicolas Courty, “Deepjdot: Deep joint distribution optimal transport for unsupervised domain adaptation,” in European conference on computer vision. Springer, 2018, pp. 467–483.
[16] Ashok Makkuva, Amirhossein Taghvaei, Sewoong Oh, and Jason Lee, “Optimal transport mapping via input convex neural networks,” in International Conference on Machine Learning. PMLR, 2020, pp. 6672–6681.
[17] Litu Rout, Alexander Korotin, and Evgeny Burnaev, “Generative modeling with optimal transport maps,” International Conference on Learning Representations, 2021.
[18] Thibaut Le Gouic and Jean-Michel Loubes, “Existence and consistency of wasserstein barycenters,” Probability Theory and Related Fields, vol. 168, no. 3, pp. 901–917, 2017.
[19] Chloé Jimenez and Filippo Santambrogio, “Optimal transportation for a quadratic cost with convex constraints and applications,” Journal de mathématiques pures et appliquées, vol. 98, no. 1, pp. 103–113, 2012.