VLA · Paper guide
Rectified Flow: A Marginal Preserving Approach to Optimal Transport
What regressing straight lines between noise and data actually guarantees, explained by concept.
This is the companion to the Flow Matching guide: read that one first for the training recipe, and this one for what the straight-line idea guarantees. It is a guide to the paper, not a sentence-by-sentence paraphrase, and it is a theory paper with no experiments. Part A is a 4-minute overview. Parts B to D explain the method, the algorithm and the theorems one idea at a time. Equations and optimal transport background are folded away in Part E, and Part F is a critical review of how far the claims reach, including what they mean for π0, GR00T N1 and AsyncVLA.
How to use this page
- In a hurry: read Part A (about 4 minutes).
- To understand the method: add Parts B to D. Each idea follows the same pattern: intuition, the problem it solves, how it works, an example, then technical details and where to find them in the paper.
- To check it: open the folded sections (equations, theorems, background, runnable examples) and read Part F.
Open the paper (arXiv:2209.14577) beside this page; section, theorem and equation references are to it. We paraphrase and never reproduce its text. Statements are labelled: Reported by the paper, Our calculation, Our interpretation. Runnable examples are marked Toy illustration when they are our own small models and are never presented as results of the paper.
Part A · about 4 minutes
Start here: the paper at a glance
The problem
Optimal transport (OT) asks: given two piles, say a pile of random noise and a pile of data, what is the cheapest way to move every grain of the first pile to a place in the second? Formally, one looks for a coupling, a way of pairing noise samples with data samples so that the noise samples still follow the noise distribution and the data samples still follow the data distribution, that minimises the average cost of the moves. For continuous, high-dimensional distributions that are only seen through samples, this is hard. The usual remedies either turn the problem into an unstable two-player game or enforce the “both piles stay correct” constraint only approximately.
Why this matters here: rectified flow, the idea this paper builds on, is the same “draw straight lines between noise and data and regress the direction” recipe that the Flow Matching guide describes and that π0, GR00T N1 and AsyncVLA use to generate actions. This paper explains what that recipe guarantees and what it does not.
The main contribution
- A view of rectified flow as optimisation. Pair noise with data (for instance at random), draw a straight line for each pair, and learn the average direction of the lines through each point and time by ordinary least squares. Following that average field with an ordinary differential equation (ODE) gives a new pairing. The paper shows this keeps both distributions exactly right and never raises the cost, for every convex cost function at once.[1]
- When two processes share their distributions. Two motions can have the same distribution at every time while differing by a “swirl”, a rotation-only part that moves samples around without changing the picture.
- c-rectified flow. A variant for one chosen cost c: allow only velocities that are the gradient of a scalar function, and use a different loss, the matching loss. Repeating it lowers the chosen cost, and the process stops exactly at the optimal pairing.
How the model works, in one paragraph
Start with any valid pairing, for example independent random pairs. Draw the straight line for each pair; many lines cross. Train a network to predict, at each point and time, the average direction of the lines through it. Then follow the network’s field from every noise sample, and record where each one ends up: those (noise, end point) pairs are the new pairing, with the same distributions, lower cost and straighter lines. Repeat. The c-rectified version changes only how the network is built and trained, so that the swirl is removed.
What it learns from, and what it is tested on
Nothing: this is a theory paper. There are no datasets, no trained models and no experiments. The two distributions are assumed to be available through samples, and a neural network stands for the velocity (or for the scalar function whose gradient is the velocity). The results are theorems with stated assumptions.
What the paper reports
The paper’s main statements, with the conditions each one needs:
| Property | Rectified flow | c-rectified flow |
|---|---|---|
| Both distributions stay exactly right | yes | yes |
| The transport cost cannot go up in a step | for every convex cost at once | for the chosen cost c |
| What the fixed points are | straight pairings, not necessarily optimal | exactly the optimal pairings for c |
| Convergence to optimal | no guarantee | the smallest loss over K steps falls like 1/K (a surrogate, not the cost gap) |
| What the network learns | the unconstrained average direction | a gradient-form velocity, with the matching loss |
What to keep in mind
- It is a theory paper with no experiments and no code; the practical behaviour of the algorithm is not tested.
- The 1/K result bounds a loss that measures how far a pairing is from optimal, not the cost gap itself; the authors list the cost gap as an open question.
- In practice each step accumulates errors from imperfect training and imperfect ODE simulation, which the paper discusses but does not measure.
- For the robot papers: a straight-line path does not make the pairing optimal. Straight is a fixed point of rectification, not necessarily the cheapest pairing.
If you read nothing else: regressing the average direction of straight lines between paired noise and data samples, then following that field, turns any valid pairing into a new one with the same distributions and no larger cost; pairings that no longer change are “straight”. Adding a gradient-form restriction and the matching loss makes the fixed points exactly the optimal ones for a chosen cost.
Check your understanding: Why does the method need to “average” the directions of the lines at each point?
Because a deterministic flow can follow only one direction at each point and time, but lines from different noise-data pairs can cross there. The least-squares regression produces the average direction, and following it removes the crossings while keeping the distributions right.
Part B
Understand the method
The paper is mathematical, so we build the ideas step by step with one running picture: pairing noise action chunks with demonstration action chunks (the pairing used when training the robot policies in the other guides). Plain words first, technical names second; the equations are collected in Part E.
1. Optimal transport: cheapest way to move one distribution into another
- Intuition
- Moving a pile of soil to fill a hole with the least total effort. Every grain needs a destination, and the effort of a move depends on its distance or on some other cost.
- The problem it solves
- We want a pairing of noise with data that keeps both distributions exactly right and is as cheap as possible, and we only have samples, not formulas, for the distributions.
- How it works
- A coupling is a joint distribution of a noise sample X0 and a data sample X1 whose two separate distributions are the given ones, π0 and π1. Its transport cost is the average of c(X1 − X0) for a convex cost function c (for example the squared length of the move). The Monge problem allows only deterministic maps, X1 = T(X0); the Monge–Kantorovich problem allows random pairings; for continuous noise they agree. Solving these directly is hard: the constraint “the marginals are right” has infinitely many parts, so people use minimax games from duality or soft penalties, and the paper says both have drawbacks. There is also a dynamic view: the cost of a whole path is the integral of c of its velocity, and for a convex c the cheapest path between two points is the straight line (Jensen’s inequality).
- Example
- Illustration, not from the paper Noise action chunks must be matched to demonstration chunks. A pairing that sends nearby noise to nearby demonstrations is cheaper than one that sends noise to far-away demonstrations, even though both give the same two distributions.
- Why the authors chose it
- OT is a standard way to define “good” maps between distributions, used for generative models, transfer between domains and approximate inference; the paper’s approach avoids the minimax and penalty methods.
- Technical details
Run the example: straight lines are the cheapest paths
Our calculationWhat each part does
- Fix two end points and add a wiggle of growing size to the straight path between them.
- Compute the path-wise cost (the integral of the squared velocity) numerically.
- Compare with the direct cost and with the formula 2π²a² for the extra cost.
import numpy as np # Jensen's inequality (Section 2): between fixed end points, the straight line is the cheapest path. # Path-wise cost with the quadratic cost c(v) = v^2: the integral over t of (dx/dt)^2. x0, x1 = -1.0, 3.0 t = np.linspace(0.0, 1.0, 100_001) dt = t[1] - t[0] def path_cost(a): # x_t = straight line + a * sin(2 pi t): same end points for every a velocity = (x1 - x0) + a * 2 * np.pi * np.cos(2 * np.pi * t) return float(np.sum(velocity ** 2) * dt) print("cost of the direct move c(x1 - x0) =", (x1 - x0) ** 2) for a in (0.0, 0.1, 0.5, 1.0): print(f"wiggle amplitude {a:3.1f}: path-wise cost {path_cost(a):8.3f} (extra {path_cost(a) - (x1 - x0) ** 2:.3f}, theory 2 pi^2 a^2 = {2 * np.pi ** 2 * a * a:.3f})") print("the straight line (amplitude 0) attains the direct cost; every wiggle costs more")Output:
cost of the direct move c(x1 - x0) = 16.0 wiggle amplitude 0.0: path-wise cost 16.000 (extra 0.000, theory 2 pi^2 a^2 = 0.000) wiggle amplitude 0.1: path-wise cost 16.198 (extra 0.198, theory 2 pi^2 a^2 = 0.197) wiggle amplitude 0.5: path-wise cost 20.935 (extra 4.935, theory 2 pi^2 a^2 = 4.935) wiggle amplitude 1.0: path-wise cost 35.740 (extra 19.740, theory 2 pi^2 a^2 = 19.739) the straight line (amplitude 0) attains the direct cost; every wiggle costs more
A numerical check of the Jensen-inequality statement in Section 2, for the squared-length cost.
- Evidence in the paper
- §1 · §2 (Equations 1 and 5 to 10)
Check your understanding: Why is the straight line the cheapest path between two points under a convex cost?
A convex cost penalises large velocities more than proportionally, so spreading the movement evenly over time, a constant velocity along the straight line, is the cheapest. Any detour or speed change costs more (Jensen’s inequality).
2. Rectified flow: draw lines, average the directions, follow the field
- Intuition
- Draw a straight line from every noise sample to its paired data sample. Where lines cross, a flow cannot go two ways at once, so replace the crossing directions by their average and follow that.
- The problem it solves
- An arbitrary pairing, such as independent random pairs, gives crossing, expensive paths. We want a deterministic motion (an ODE) that produces the same distributions at a lower cost.
- How it works
- For a pairing (X0, X1) the straight-line interpolation is Xt = t·X1 + (1 − t)·X0. Learn a velocity v by least squares: predict the line direction X1 − X0 from the point and time (Xt, t). The best predictor is the average direction of all lines through that point and time. The rectified flow is the ODE that starts at Z0 = X0 and follows this field; its endpoints (Z0, Z1) form the rectified coupling. Two properties: (1) it has the same distributions as the original pairing at every time, so it is a valid coupling; (2) its cost is no larger for every convex cost c simultaneously. Applying the step recursively never increases any convex cost.
- Example
- Illustration, not from the paper Random pairs of noise and demonstration chunks give many crossing lines. After one rectification each noise chunk follows a single smooth path to a demonstration chunk, and the pairing has lower cost.
- Why the authors chose it
- Training is a simple unconstrained regression solved with ordinary stochastic gradient descent, with no minimax game, and the process stays inside the set of valid couplings (an “interior” method).
- Technical details
- The example below uses noise and data that is either −2 or +2, where the exact average direction can be written down. One rectification keeps the distribution of the endpoints (half near each data point), lowers the cost for several different convex costs, and, in one dimension, reaches the same cost as the best possible pairing. It also checks the paper’s cost identity (Equation 28 for the squared cost): the cost drop equals the regression loss plus a straightness gap.
Run the example: one round of rectified flow in one dimension
Toy illustrationWhat each part does
- Pair noise with the two data points at random (independent coupling).
- Use the exact average-direction field, follow the ODE from every noise sample, and record the path-wise cost.
- Compare the cost of the independent, rectified and sorted (optimal) pairings, and check cost drop = regression loss + straightness gap.
import numpy as np rng = np.random.default_rng(0) # One round of rectified flow in one dimension (Section 3 of the paper). # pi0 = standard normal noise, pi1 = the two points -2 and +2 (equal probability). N = 40_000 x0 = rng.normal(size=N) x1 = rng.choice([-2.0, 2.0], N) # start with the independent coupling: noise and data paired at random def velocity(z, t): # v_t(z) = E[X1 - X0 | X_t = z] for the straight-line interpolation X_t = t X1 + (1 - t) X0 (exact for this toy). w_pos = np.exp(-0.5 * ((z - 2.0 * t) / (1 - t)) ** 2) w_neg = np.exp(-0.5 * ((z + 2.0 * t) / (1 - t)) ** 2) p = w_pos / (w_pos + w_neg) m = 2.0 * p - 2.0 * (1 - p) # E[X1 | X_t = z] return m - (z - t * m) / (1 - t) # E[X1 - X0 | X_t = z] # Follow the ODE dZ = v(Z, t) dt from Z0 = X0 (midpoint method, many small steps), and record the path-wise cost. steps = 600 dt = 1.0 / steps z = x0.copy() path_cost = 0.0 # integral over time of E[ (dZ/dt)^2 ] for k in range(steps): t = k * dt mid = z + 0.5 * dt * velocity(z, t) v_mid = velocity(mid, t + 0.5 * dt) path_cost += np.mean(v_mid ** 2) * dt z = z + dt * v_mid z1 = z # the rectified coupling is (Z0, Z1) = (x0, z1) # The least-squares loss of the regression (Equation 3), by Monte Carlo over random times. ts = (np.arange(200) + 0.5) / 200 loss = np.mean([np.mean(((x1 - x0) - velocity((1 - t) * x0 + t * x1, t)) ** 2) for t in ts]) print("marginal of Z1: share of samples above 0 =", round(float(np.mean(z1 > 0)), 3), "(target 0.5);", "mean |Z1| =", round(float(np.mean(np.abs(z1))), 3), "(target 2)") for name, c in (("c(x) = x^2", lambda d: d ** 2), ("c(x) = |x|", np.abs), ("c(x) = x^4", lambda d: d ** 4)): before, after = np.mean(c(x1 - x0)), np.mean(c(z1 - x0)) print(f"cost {name:<10} independent coupling {before:6.3f} -> rectified coupling {after:6.3f}") # The optimal coupling in one dimension pairs the smaller half of the noise with -2 and the larger half with +2. optimal_z1 = np.where(x0 > np.median(x0), 2.0, -2.0) print("cost x^2 of the optimal (sorted) coupling:", round(float(np.mean((optimal_z1 - x0) ** 2)), 3)) # Equation 28 for the quadratic cost: cost drop = loss of the regression + straightness gap S. drop = np.mean((x1 - x0) ** 2) - np.mean((z1 - x0) ** 2) S = path_cost - np.mean((z1 - x0) ** 2) print(f"cost drop {drop:.3f} against regression loss + S = {loss:.3f} + {S:.3f} = {loss + S:.3f}")Output:
marginal of Z1: share of samples above 0 = 0.499 (target 0.5); mean |Z1| = 2.0 (target 2) cost c(x) = x^2 independent coupling 4.996 -> rectified coupling 1.804 cost c(x) = |x| independent coupling 2.015 -> rectified coupling 1.236 cost c(x) = x^4 independent coupling 43.176 -> rectified coupling 4.673 cost x^2 of the optimal (sorted) coupling: 1.804 cost drop 3.192 against regression loss + S = 2.038 + 1.149 = 3.187
One-dimensional toy with an exact field and no neural network; it illustrates the theory (Theorem 3.2 and Equation 28), it is not an experiment from the paper.
- Evidence in the paper
- §1 “Rectified flow” · §3 · Equations 2, 3 and 11 to 15 · Theorem 3.2 · Lemma 3.3
Check your understanding: The rectified pairing has the same marginal distributions as the original. Why is that important?
Because the pairing must still turn the noise distribution into the data distribution. If the marginals changed, the cost could be lowered trivially by not reaching the data at all.
3. Straight pairings, fixed points, and the limit of plain rectified flow
- Intuition
- A pairing is “straight” when no two of its lines cross while pointing different ways, so there is nothing left for the averaging step to change.
- The problem it solves
- We need to know when the repeated rectification has finished, what has been gained, and whether the end result is the optimal pairing.
- How it works
- A pairing is straight if it is unchanged by rectification (a fixed point). For a strictly convex cost this is the same as the regression loss being zero: the line directions are fully determined by the point and time. Straight pairings are useful because their paths are straight lines that can be followed in a single step without an ODE solver. In one dimension the straight pairing is unique and is optimal for every convex cost. From two dimensions on there are many straight pairings, the one reached depends on the starting pairing, and none needs to be optimal for any cost.
- Example
- Illustration, not from the paper A pairing that rotates every noise chunk by a fixed angle into a demonstration chunk can be straight (its lines never cross) and still be much more expensive than the identity pairing that leaves each chunk where it is.
- Why the authors chose it
- This explains what plain rectified flow cannot do: it lowers all convex costs together without targeting any of them, and it can stop at a straight but non-optimal pairing.
- Technical details
- Example 3.5 takes noise and data that are both standard Gaussians. The best pairing is the identity, with cost 0. A 90-degree rotation of the noise is also a valid, straight pairing, but it costs about 2 under the squared cost.
Run the example: straight does not mean optimal
Toy illustrationWhat each part does
- Rotate Gaussian noise by 90 degrees to build a second valid pairing.
- Check that the rotated data still has the right distribution and compute the cost.
- Compute the regression field and check that it leaves no error: the pairing is straight.
import numpy as np rng = np.random.default_rng(0) # Example 3.5: pi0 = pi1 = N(0, I) in two dimensions. The best coupling is the identity (X0, X0), with cost 0. # Rotation coupling (X0, A X0), where A rotates by 90 degrees, is also a valid coupling of the two distributions. theta = np.pi / 2 A = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]) I = np.eye(2) N = 200_000 x0 = rng.normal(size=(N, 2)) x1 = x0 @ A.T print("marginal of X1 is still standard normal: mean", np.round(x1.mean(axis=0), 3).tolist(), ", covariance", np.round(np.cov(x1.T), 2).tolist()) # Cost with the quadratic cost c(x) = |x|^2 / 2. cost_rot = np.mean(0.5 * np.sum((x1 - x0) ** 2, axis=1)) print("cost of the rotation coupling:", round(float(cost_rot), 3), "| theory: 2(1 - cos(theta)) =", round(2 * (1 - np.cos(theta)), 3), "| cost of the identity coupling: 0") # Straightness: on the straight line interpolation, the velocity at X_t is fully determined by X_t, # v_t(x) = (A - I)(tA + (1-t)I)^-1 x, so regression leaves no residual (Equation 32 of the appendix). t = 0.3 xt = (1 - t) * x0 + t * x1 direction = x1 - x0 v = xt @ (((A - I) @ np.linalg.inv(t * A + (1 - t) * I)).T) print("largest difference between the line direction and the regression field:", float(np.abs(direction - v).max())) print("-> the coupling is straight (a fixed point of the rectification), yet its cost is", round(float(cost_rot), 3), "instead of 0")Output:
marginal of X1 is still standard normal: mean [0.001, 0.001] , covariance [[1.0, 0.0], [0.0, 1.0]] cost of the rotation coupling: 2.006 | theory: 2(1 - cos(theta)) = 2.0 | cost of the identity coupling: 0 largest difference between the line direction and the regression field: 1.7763568394002505e-15 -> the coupling is straight (a fixed point of the rectification), yet its cost is 2.006 instead of 0
Numerical illustration of the paper’s Example 3.5; the proof is in the appendix.
- Evidence in the paper
- §3 “Straight couplings” · Example 3.5 · Appendix A
Check your understanding: If a straight pairing can be non-optimal, why is the straight-line path still useful for generation?
Because straight paths are cheap to follow: with few solver steps a straight trajectory is followed accurately. The pairing need not be optimal for that. Optimality matters when the cost itself is the goal.
4. Same distributions, different motion: the rotation-only part
- Intuition
- A swirling current in a pool moves the water around without changing where the water is. Two motions can fill space in the same way at every moment even though individual drops move differently.
- The problem it solves
- To lower the cost further, we need to know exactly which changes of the velocity field leave the distributions untouched, so they can be removed or added without breaking the marginals.
- How it works
- The paper calls a velocity change marginal-preserving if it does not move the distribution at any time; this is the same as the change being divergence-free (a rotation-only field in the classical sense). Lemma 4.2: two motions that start with the same distribution have the same distribution at every time if and only if the difference of their average velocity fields is marginal-preserving. So matching the average velocity is sufficient, not necessary: there is room to remove the swirl.
- Example
- Illustration, not from the paper A field that turns every action chunk about the origin leaves a round cloud of noise looking the same at all times, while each individual chunk takes a longer path and so costs more.
- Why the authors chose it
- Removing the swirl lowers the cost while keeping the marginals, which is what plain rectified flow cannot do, and it is the idea behind the next section.
- Technical details
- The test functions used in the definition are smooth functions with compact support, and the equivalence with the continuity equation follows by integrating by parts. Uniqueness of the ODE’s solution is assumed.
- Evidence in the paper
- §4 · Definition 4.1 · Lemma 4.2 · Equations 18 to 21
Check your understanding: Why is “same average velocity” only a sufficient condition for “same distribution over time”?
Because a swirl added to the velocity does not change the distribution. Two different velocity fields can therefore give the same marginals.
5. c-rectified flow: removing the swirl for a chosen cost
- Intuition
- Rectified flow with one extra rule: no swirling. Only the part of the velocity that pushes mass “downhill” of some potential function is kept.
- The problem it solves
- Make the repeated rectification converge to the optimal pairing for a specific convex cost c, which plain rectified flow does not.
- How it works
- Two changes. (1) Restrict the velocity to the form
vt = ∇c*(∇ft): a scalar function f (a network that outputs one number) whose gradient, passed through the gradient of the convex conjugate c*, gives the direction. (2) Replace least squares by the matching lossmc(x; y) = c(x) − xᵀy + c*(y)applied to the line direction and ∇f. For the squared cost this is half the squared error. The paper shows the best such field is the projection of the average velocity onto gradient-form fields (a “Bregman Helmholtz decomposition”: average velocity = gradient part + marginal-preserving swirl). Consequences: the distributions are preserved (Theorem 5.2); the flow is the cheapest process with the same distributions at all times (Theorem 5.3); its coupling has no larger cost for the chosen c (Theorem 5.5); and fixed points are exactly the optimal pairings for c (Theorem 5.6). - Example
- Illustration, not from the paper For squared cost, the network outputs a single number per point and time, and the velocity is the gradient of that number: the field cannot swirl.
- Why the authors chose it
- It turns the OT problem into repeated unconstrained regressions with a guarantee that, in the limit, the pairing is optimal for the chosen cost.
- Technical details
- The matching loss is never negative and is zero exactly when the predicted direction corresponds to the true line direction (the Fenchel–Young inequality). The example checks it for the cost x⁴/4.
Run the example: the matching loss is never negative
Our calculationWhat each part does
- Define the cost c(x) = x⁴/4 and its conjugate c*(y) = (3/4)|y|^(4/3).
- For several x, search over y for the smallest value of the matching loss and where it occurs.
- Check the quadratic special case against half the squared error.
import numpy as np # The matching loss of Equation 23: m_c(x; y) = c(x) - x*y + c*(y), where c* is the convex conjugate of c. # Example cost c(x) = x^4 / 4, whose conjugate is c*(y) = (3/4) |y|^(4/3) (in one dimension). c = lambda x: x ** 4 / 4 c_star = lambda y: 0.75 * np.abs(y) ** (4 / 3) grad_c = lambda x: x ** 3 # derivative of c def m(x, y): return c(x) - x * y + c_star(y) xs = np.linspace(-2, 2, 9) ys = np.linspace(-8, 8, 4001) print("x | smallest value of m_c(x; y) over y | the y where it is smallest | derivative of c at x") for x in xs: values = m(x, ys) j = values.argmin() print(f"{x:5.1f} | {round(float(values[j]), 6) + 0.0:34.6f} | {ys[j]:26.3f} | {grad_c(x):>8.3f}") print() print("m_c is never negative on the grid:", bool(all(m(x, ys).min() > -1e-9 for x in xs))) # For the quadratic cost c(x) = x^2 / 2 (so c* = c) it reduces to half the squared error. cq = lambda x: 0.5 * x ** 2 mq = lambda x, y: cq(x) - x * y + cq(y) x, y = 1.3, -0.4 print("quadratic cost: m_c(1.3; -0.4) =", round(float(mq(x, y)), 4), "and (x - y)^2 / 2 =", round(0.5 * (x - y) ** 2, 4))Output:
x | smallest value of m_c(x; y) over y | the y where it is smallest | derivative of c at x -2.0 | 0.000000 | -8.000 | -8.000 -1.5 | 0.000000 | -3.376 | -3.375 -1.0 | 0.000000 | -1.000 | -1.000 -0.5 | 0.000001 | -0.124 | -0.125 0.0 | 0.000000 | 0.000 | 0.000 0.5 | 0.000001 | 0.124 | 0.125 1.0 | 0.000000 | 1.000 | 1.000 1.5 | 0.000000 | 3.376 | 3.375 2.0 | 0.000000 | 8.000 | 8.000 m_c is never negative on the grid: True quadratic cost: m_c(1.3; -0.4) = 1.445 and (x - y)^2 / 2 = 1.445
A numerical check of a standard inequality on a grid, not a proof.
- Evidence in the paper
- §1 “c-Rectified flow” · §5.1 to 5.3 · Equations 4 and 22 to 27 · Theorems 5.2, 5.3, 5.5 and 5.6
Check your understanding: What do the two changes (gradient form and matching loss) buy compared with plain rectified flow?
They remove the rotation-only part of the velocity, so repeating the step lowers the chosen cost and stops only at optimal pairings; plain rectified flow keeps the swirl and can stop at straight but non-optimal pairings.
Part C
Understand the algorithm and its losses
There is no training run in this paper, so this part describes the procedure one would run, the losses it uses, and two ways the paper interprets it as an optimisation algorithm.
The iterative procedure in practice
- Intuition
- Learn a field, use it to create better pairs, learn a field for those, and so on.
- The problem it solves
- The theory describes exact operations; a practical method must work from samples, with neural networks and numerical ODE solvers.
- How it works
- Start from the independent pairing or any other pairing built from unpaired samples. At step k: draw pairs (Z0k, Z1k); train the velocity network by regression on the interpolated points (Equation 3, or the c-version with the matching loss); then simulate the network’s ODE from fresh noise samples to get the pairs for step k + 1. The paper notes that errors accumulate because neither the training nor the ODE simulation is perfect, and, citing the original rectified flow paper, that one or two iterations were enough for practical applications.
- Example
- Illustration, not from the paper Iteration 0 trains on random (noise chunk, demonstration chunk) pairs. Iteration 1 trains on pairs made by running the learned flow from noise.
- Why the authors chose it
- Each step is an ordinary regression solved with off-the-shelf optimisers, so no minimax game or inner loop is needed.
- Technical details
- The paper suggests ways to limit error accumulation as an open question: adjust the new end points toward real samples, by reweighting or by a one-to-one matching, ideally in near-linear time. It gives no experiments on this.
- Evidence in the paper
- §1 “Rectified flow” · §6 (open questions 3 and 4)
Check your understanding: Why does error accumulate over iterations?
Each step’s pairs come from simulating the previous learned flow, which is imperfect. The next regression then learns from slightly wrong pairs, so errors compound.
The losses: least squares and the matching loss
- Intuition
- Least squares measures the distance between predicted and true directions; the matching loss measures how wrong a prediction is in a way that matches the cost c.
- The problem it solves
- Plain least squares recovers the average direction but cannot tell the gradient part from the swirl; the matching loss, with the gradient-form restriction, targets the gradient part.
- How it works
- Plain rectified flow minimises the average squared difference between the line direction X1 − X0 and v(Xt, t) (Equation 3). c-rectified flow minimises the average matching loss between the line direction and ∇f (Equation 4 and 23), where the network now outputs the scalar f. The matching loss equals a Bregman divergence in a transformed variable, which is why the best f corresponds to projecting the average velocity onto gradient-form fields (Equations 24 to 26).
- Example
- Illustration, not from the paper A network that outputs a single number for each (action chunk, time) and whose gradient gives the velocity, trained against the line direction of each pair.
- Why the authors chose it
- It lets the fixed-point condition mean “optimal for c”: when the loss reaches zero the lines are exactly the flow lines, and that implies optimality (Theorem 5.6).
- Technical details
- For the squared cost c(x) = ½‖x‖² the conjugate is the same function, the matching loss is half the squared error, and the only change from plain rectified flow is that the velocity is a gradient field. The paper also remarks that when Xt = αtX1 + βtξ with Gaussian ξ, as for probability-flow and DDIM diffusion paths, the average velocity is already a gradient field, so the two methods coincide.
- Evidence in the paper
- §1 · §3 “A primal-dual relation” · §5.1 · Equations 3, 4 and 23 to 27
Check your understanding: For the squared cost, what is the only difference between plain and c-rectified flow?
The velocity must be the gradient of a scalar function. The loss is the same up to a factor, because the matching loss reduces to half the squared error.
Two ways to see the procedure as optimisation
- Intuition
- Alternate between two easy moves, each of which lowers the cost: straighten the paths, then remove the crossings.
- The problem it solves
- To trust the procedure we want to see it as a known kind of optimisation algorithm and to understand why its fixed points are optimal.
- How it works
- The paper gives three interpretations. (1) Alternating-direction descent on the dynamic OT problem: first, for fixed end points, the cheapest path is the straight line; second, for fixed distributions at all times, the cheapest process is the c-rectified flow; each step keeps the two end distributions. (2) A majorize–minimize algorithm on the static problem: each step minimises an upper bound that touches the true cost at the current pairing, so the cost never rises. (3) Why fixed points are optimal: if all trajectories of a gradient-form ODE are straight lines, the Hamilton–Jacobi equation and the Hopf–Lax formula (classical OT results) imply that the pairing is optimal (Lemma 5.9).
- Example
- Illustration, not from the paper Alternate: connect each (noise chunk, end chunk) pair by a straight line; then replace the crossing lines by a flow with the same distribution at every time and lower cost.
- Why the authors chose it
- Placing the method in the family of descent and majorize–minimize algorithms explains the monotone decrease of the cost.
- Technical details
- The paper notes that its alternation differs from the Benamou–Brenier approach, which restricts to ODE-induced processes throughout, whereas here the straight-line process, which is not an ODE flow except at the fixed point, alternates with the rectified flow.
- Evidence in the paper
- §5.4 · Equations 29 and 30 · Proposition 5.8 · §5.5 and Lemma 5.9
Check your understanding: Why can the cost never go up in a majorize–minimize algorithm?
The upper bound touches the true cost at the current point, and each step minimises the bound. The new point’s true cost is at most its bound, which is at most the bound at the old point, which equals the old cost.
Part D
Understand the results: theorems, not experiments
The paper has no experiments, so “results” here means its theorems. This part lists what each one states and under which conditions, and checks the main inequalities on small examples of our own. The examples are numerical sanity checks, not evidence from the paper.
What the theorems claim, and the conditions behind them
- How it works
- Section 3 shows that one rectification keeps the distribution of the end points, and of the process at every time, unchanged (the “marginal preserving” property), and that it cannot raise the transport cost for any convex cost function. Section 3 also shows that the pairings left unchanged by rectification are the “straight” ones, in which all trajectories are straight lines. Section 5 then shows, for a chosen cost, that c-rectified flow lowers that cost at every step, that its fixed points are exactly the optimal pairings, and that a surrogate of non-optimality shrinks like 1/K.
- Technical details
Our summary of Sections 3 and 5; “regular enough” is our short form for the paper’s assumptions. Claim Applies to Conditions the paper needs Both distributions are preserved rectified flow and c-rectified flow the average field is regular enough that the ODE has a unique solution The cost does not increase, for every convex cost at once rectified flow the same, and convexity of the cost Straight pairings are exactly the fixed points rectified flow the same Fixed points are optimal; the cost decreases at every step c-rectified flow a strictly convex cost and the gradient-form restriction The smallest loss over K steps is at most (initial cost) / K c-rectified flow the loss and a correction term S, a surrogate of non-optimality Our interpretation All of these hold for the exact procedure: the exact average direction, the exact ODE solution and the true distributions. The paper does not claim, or test, that they hold for a network trained on finite samples and an ODE solved with a few steps.
- Evidence in the paper
- §3 · §5 · Theorems 3.3, 3.5, 5.2, 5.3, 5.5 and 5.6
Check your understanding: Which claims apply to plain rectified flow and which need the c-version?
Preserving the distributions, not raising the cost and having straight pairings as fixed points hold for plain rectified flow. Optimality of the fixed points, a decrease of the chosen cost at every step and the 1/K statement need the c-version with its gradient-form velocity.
The cost drops after one round (a one-dimensional check)
- How it works
- The paper proves that one rectification cannot increase the cost. In one dimension we can see the size of the effect: pair noise with data independently, rectify once, and compare the costs. The example in Part B (“One round of rectified flow in one dimension”) does this for three costs and also checks that the drop in the squared cost equals the sum of the regression loss and a second term, as the paper’s decomposition (Equation 28) says.
- Technical details
Toy illustration The numbers there: the squared cost falls from 4.996 to 1.804, which is also the cost of the best possible pairing in one dimension (sort both piles and match them in order); the cost drops by 3.192 and the regression loss plus the second term adds up to 3.187. The absolute-value cost falls from 2.015 to 1.236 and the fourth-power cost from 43.176 to 4.673. These are the results of one random seed on one example, so they illustrate the theorem and do not test it. Open the example.
- Evidence in the paper
- §3 “Rectified flow” · Theorem 3.5 · Equation 28
Check your understanding: Why is it striking that one round reached the best possible cost here?
In one dimension all the crossing lines are removed by a single rectification, and the ordered pairing is optimal for every convex cost. In higher dimensions the paper gives no such guarantee; one round generally lowers the cost without reaching the optimum.
What the 1/K statement means in practice
- How it works
- Theorem 5.5 says the smallest value of “loss + S” over K + 1 steps is at most the initial cost divided by K + 1, because the cost decreases at each step by at least that sum. The paper stresses that this bounds a surrogate, a quantity that is zero exactly at an optimal pairing, not the distance of the cost from the optimum.
- Technical details
Our calculation The example below turns the bound into a budget: with an initial cost of 5, ten steps guarantee only that some step has loss + S below 0.5, and a thousand steps 0.005. It also checks the argument behind it: decreases that add up to no more than the initial cost cannot all be larger than the initial cost divided by the number of steps.
Run the example: the 1/K bound as a budget
Our calculationWhat each part does
- Choose an initial cost of 5.
- List the guaranteed bound on the smallest loss + S after K steps.
- Take five example decreases that add up to less than the initial cost and check that the smallest one respects the bound.
# Corollary 5.7: summing the cost decreases of K + 1 rectification steps cannot exceed the cost you started with, # sum over k of ( loss_k + S_k ) <= E c(X1 - X0) => min over k of ( loss_k + S_k ) <= E c(X1 - X0) / (K + 1). initial_cost = 5.0 # a made-up starting transport cost print("steps K+1 | guaranteed bound on the smallest (loss + S) among the steps") for steps in (1, 2, 5, 10, 50, 100, 1000): print(f"{steps:>9} | at most {initial_cost / steps:.4f}") # A made-up sequence of costs after each rectification, with its decreases (each equals loss_k + S_k). costs = [5.0, 2.0, 1.2, 1.0, 0.95, 0.93] drops = [a - b for a, b in zip(costs[:-1], costs[1:])] print() print("decreases:", [round(d, 2) for d in drops], "| they add up to", round(sum(drops), 2), "<= initial cost", initial_cost) print("smallest decrease so far:", round(min(drops), 2), "<=", round(initial_cost / len(drops), 2), "= initial cost / number of steps") print("note: the bound is on loss + S, a surrogate of optimality; it does not say how far the cost is from the optimal cost")Output:
steps K+1 | guaranteed bound on the smallest (loss + S) among the steps 1 | at most 5.0000 2 | at most 2.5000 5 | at most 1.0000 10 | at most 0.5000 50 | at most 0.1000 100 | at most 0.0500 1000 | at most 0.0050 decreases: [3.0, 0.8, 0.2, 0.05, 0.02] | they add up to 4.07 <= initial cost 5.0 smallest decrease so far: 0.02 <= 1.0 = initial cost / number of steps note: the bound is on loss + S, a surrogate of optimality; it does not say how far the cost is from the optimal costArithmetic on the form of the bound, not an experiment.
- Evidence in the paper
- §5.3 · Theorem 5.5 · §6 (open question 2)
Check your understanding: Does a small loss + S mean the cost is close to the optimum?
No. It means the pairing is close to a fixed point in the sense of the surrogate. The paper does not bound the gap between the cost and the optimal cost and lists this as an open question.
What the authors leave open
- How it works
- Section 6 lists open questions: whether the surrogate bound can be turned into a bound on the cost gap, how to choose or learn the network family so that the gradient form is respected, how to control error accumulation over iterations (for example by reweighting or matching the new pairs to real samples), and how the method behaves for costs beyond squared distance.
- Technical details
Our interpretation For a reader who wants to use the method this list matters more than any single theorem: it says that the guarantees describe an idealised procedure and that three practical ingredients (a statistical estimate of the field, a numerical ODE solver and a finite number of iterations) are not analysed.
- Evidence in the paper
- §6
Check your understanding: Name two things between the theory and a working implementation that the paper does not analyse.
For example: the error from fitting the field with a network on finite samples, the error from solving the ODE with a few steps, and how these errors build up over repeated rectifications.
What the paper establishes
- One rectification keeps both distributions and cannot raise the cost for any convex cost.
- Pairings that rectification leaves unchanged are those whose trajectories are straight lines.
- With a gradient-form velocity and the matching loss, the cost falls at every step and fixed points are optimal.
What it does not establish
- That straight paths are optimal: the rotation example is straight with cost 2 where 0 is possible.
- How close the cost gets to the optimum after K steps.
- That the guarantees survive neural-network fitting, numerical ODE solving and error accumulation; there are no experiments.
- Anything about robot actions.
Part E · optional
Engineering deep dive
The main equations, the theorems in words, the optimal transport background and the assumptions, for readers who want to audit the argument. Everything is collapsed; Parts A to D do not depend on it.
The equations
Time runs from 0 to 1. Symbols: X0 and X1 a (noise, data) pair, Xt the point on the line at time t, v the velocity field, c a convex cost, c* its convex conjugate.
Reported by the paper The straight line between a pair, and the rectified flow’s regression (Equations 1 to 3):
Reported by the paper The new pairing: follow the ODE from the noise sample:
Reported by the paper The cost of a pairing (static) and of a process (path-wise); the path-wise cost of a straight line equals the static cost:
Reported by the paper The c-version: the velocity is a gradient, v = ∇c*(∇f), and the loss is the matching loss (Equations 4 and 23):
Our calculation This is the standard Fenchel–Young gap, which is how we read the paper’s matching loss (Equations 23 to 27; check the exact form there). For c(x) = ½‖x‖² it equals ½‖x − y‖². The numerical check in Part B uses c(x) = x⁴/4.
Reported by the paper The decomposition behind the cost decrease (Equation 28), for the squared cost: the drop in cost equals the regression loss plus a term S that measures how far the field is from a pure gradient.
The theorems, in words
- Marginal preserving (Theorem 3.3). The rectified process has the same distribution as the interpolation at every time t, so the end points have the right distributions. Idea: the average field and the interpolation satisfy the same continuity equation, and a regular field determines the solution.
- The cost does not increase (Theorem 3.5). For any convex cost, the rectified pairing costs no more than the one it came from. Idea: Jensen’s inequality applied to the averaging; moving along an average direction cannot cost more than moving along the individual directions.
- Straight pairings are fixed points (Theorem 3.6 and Example 3.5). If all lines of the pairing already form a flow (no crossings), rectification returns the same pairing; the rotation example shows such fixed points need not be optimal.
- c-rectified flow (Theorems 5.2 and 5.3). With the gradient-form constraint the cost decreases by at least the loss plus a correction S, and S is zero only for a gradient field.
- Convergence (Theorems 5.5 and 5.6). The smallest loss + S over K steps is at most (initial cost)/K; fixed points have loss + S = 0 and are optimal.
These are our summaries; the theorem numbers follow the paper’s labelling as we read it, and the assumptions are in the paper.
Optimal transport background
- Reported by the paper Static form (Monge–Kantorovich): minimise E[c(X1 − X0)] over all pairings that keep the two distributions. Dual form: maximise a difference of two expectations over pairs of potentials; the optimal potentials are linked by a Legendre-type transform.
- Reported by the paper Dynamic form (Benamou–Brenier): minimise the integral of the cost of the velocity over all processes that start and end at the two distributions. For the squared cost the optimal process moves each particle along a straight line at constant speed.
- Reported by the paper Hamilton–Jacobi and Hopf–Lax: if a gradient-form flow has only straight trajectories, the potential satisfies a Hamilton–Jacobi equation whose solution has the Hopf–Lax form, and this identifies the pairing as optimal (Lemma 5.9).
- Our interpretation The paper’s new element is not the OT problem but a procedure made of repeated regressions, which can be run with generic neural networks.
Remark on diffusion and Gaussian paths
Reported by the paper If the interpolation has the form Xt = αtX1 + βtξ with Gaussian ξ, as for the probability-flow ODE and DDIM, the average velocity is already a gradient field, so plain rectified flow and c-rectified flow for the squared cost coincide. Our interpretation This is why the straight-line path of the Flow Matching guide and the diffusion paths are all instances of the same regression, differing only in the interpolation.
Assumptions to keep in mind
- The two distributions have finite expectations of the cost and the ODE has a unique solution, which requires some regularity of the average field (for example, a Lipschitz field).
- For the c-version: a strictly convex, differentiable cost, so that c* and its gradient are well defined.
- The velocity network can represent the exact average direction (or the exact potential). Finite samples, network error and solver error are not modelled.
Notation
| Symbol | Meaning |
|---|---|
| X0, X1 | a noise sample and a data sample forming a pair (a coupling) |
| Xt | the point on the straight line between them at time t |
| v* | the average direction of the lines through a point and time (conditional expectation) |
| Zt | the process obtained by following v* from X0 |
| c, c* | a convex cost and its convex conjugate |
| mc | the matching loss |
| S | the correction term that is zero only for gradient-form fields |
Part F
Critical paper review
Everything above reports what the paper says. This part is our independent reading of how far its statements reach, especially for readers who arrive from the robot papers. The paper is a theory paper with no experiments, so there are no tables to cross-check; the findings are about scope and wording, and each links to the concept it affects.
How far the claims go
-
F1. “Straight” is not “optimal” Ambiguity
What the paper says. Plain rectified flow keeps both distributions and does not raise the cost for any convex cost; its fixed points are straight pairings.
What we found. The rotation example (Example 3.5) shows that a straight pairing can have a cost of 2 where 0 is possible, and our example reproduces that: the regression field matches the line direction to rounding error, yet the cost is 2.006. The title and framing, “an approach to optimal transport”, are therefore only justified for the c-version.
Why it matters. A model whose sampling paths look straight is not thereby optimal, and repeated plain rectification can stop at a non-optimal pairing. Concept: Straight pairings and fixed points · example
-
F2. The 1/K rate bounds a surrogate Method caveat
What the paper says. The smallest loss + S over K + 1 steps is at most the initial cost divided by K + 1.
What we found. The quantity is zero exactly at optimal pairings, but it is not the gap between the cost and the optimal cost, and the paper lists a bound on that gap as an open question. Our example shows what the bound guarantees: after 1,000 steps, some step has loss + S below 0.005 for an initial cost of 5, and nothing about the other steps.
Why it matters. The result should not be read as “the cost converges to the optimum at rate 1/K”. Concept: What the 1/K statement means · example
-
F3. No experiments Limitation
What the paper says. The paper presents the method and its theory. It notes that, in practice, one or two iterations of the original rectified flow procedure were enough, citing an earlier paper.
What we found. There is no experiment, dataset or code in this paper, so the claims about error accumulation, the choice of network and the practical value of repeating the procedure are not tested here. The practical statement about one or two iterations is cited, not shown.
Why it matters. The paper explains what the recipe guarantees in the exact setting; evidence for its use in images or robotics has to come from other papers. Concept: Part A · What the authors leave open
-
F4. The guarantees are for the exact procedure Method caveat
What the paper says. Each step is an exact operation: the average direction, the ODE solution and the true distributions.
What we found. With a network trained on samples and an ODE solved with a few steps, none of these is exact. The paper recognises error accumulation but gives no bound for it; the conditions (a unique ODE solution, a strictly convex cost for the c-version) are not checked for neural networks either.
Why it matters. It is reasonable to take the theorems as an explanation of why the recipe is sensible, not as a guarantee about a trained model. Concept: What the theorems claim · The procedure in practice
For the robot papers
-
F5. The robot action generators use one round, not repeated rectification Limitation
What the paper says. The theorems describe repeating the rectification, with the new pairs of each step feeding the next.
What we found. As far as their papers describe, π0, GR00T N1 and AsyncVLA train one velocity network on random (noise, action chunk) pairs, which is the first step of the procedure, and then sample with a few Euler steps. The guarantee that applies to them is the first step’s: the distributions are preserved by the exact field and the cost is not larger than the independent pairing’s. Straight fixed points, the c-version and the 1/K statement are not part of what they use.
Why it matters. Citing this paper to say that their action paths are “optimal” or “straight” would go further than either side supports. The few-step sampling works because lines from independent pairs mostly average to smooth fields, which is an empirical matter for them. Concept: Rectified flow · Flow Matching guide F7 · π0 guide
-
F6. The direction convention Numerical inconsistency
What the paper says. The line is Xt = tX1 + (1 − t)X0 with the regression target X1 − X0 (data minus noise), integrated forward from t = 0 at noise.
What we found. This is the same convention as the Flow Matching paper and the opposite sign from the target printed in the π0 and GR00T N1 papers (noise minus data) when they also integrate forward. Two independent theory papers agreeing on data minus noise supports the reading, in the guides to the robot papers, that the printed sign is probably a typo or a change of convention.
Why it matters. If you reimplement a robot paper, check the sign against the authors’ code before trusting the printed equation. Concept: Overview · Flow Matching guide F10 · π0 guide F1 · GR00T N1 guide F1
Knowledge check
Try each question first, then reveal the explanation.
Question 1
In your own words: what does one round of rectified flow do?
Explanation
It pairs noise and data, draws a straight line per pair, learns the average direction of the lines through each point and time, and follows that field from each noise sample. The new pairs have the same distributions, a cost that is no larger and fewer crossings.
Question 2
Why is a straight pairing not necessarily optimal?
Explanation
Rectification leaves any pairing without crossings unchanged, so it cannot improve it. A rotation of a Gaussian onto itself has no crossings and costs 2 where the identity costs 0.
Question 3
What does c-rectified flow change, and what does it buy?
Explanation
It restricts the velocity to a gradient and trains with the matching loss. The chosen cost then falls at every step and the fixed points are exactly the optimal pairings.
Question 4
Which guarantees apply to a robot action generator that uses one round of straight-line regression?
Explanation
Only the first step’s: the distributions are preserved by the exact field and the cost is not larger than the independent pairing’s. The fixed-point, optimality and 1/K statements concern repeated rectification and the c-version.
Glossary
- Optimal transport (OT)
- Finding the cheapest way to move one distribution onto another.
- Coupling
- A pairing of samples of two distributions that keeps both distributions right.
- Cost function
- A rule that says how expensive a move is, for example the squared distance.
- Convex
- A cost whose graph bends upward, so that averaging two moves never costs more than the moves themselves.
- Rectified flow
- Regressing the average direction of straight lines between paired samples and following the resulting field.
- Rectification
- One round of that procedure, which turns a pairing into a new one.
- Marginal preserving
- The distribution at every time stays the same as that of the straight-line interpolation.
- Straight coupling
- A pairing whose flow lines are all straight, a fixed point of rectification.
- Fixed point
- A pairing that another round leaves unchanged.
- Velocity field
- A rule that gives a direction and speed at every point and time.
- ODE
- Ordinary differential equation: here, “position changes at the speed the field gives”.
- Divergence-free field
- A field that rearranges points without changing the picture; the “swirl” in this guide.
- c-rectified flow
- The variant for a chosen cost, with a gradient-form velocity and the matching loss.
- Convex conjugate
- A transform c* of a convex function c that pairs gradients of c with points; it appears in the matching loss.
- Matching loss
- A non-negative loss that is zero exactly when the predicted direction matches the true one for the chosen cost.
- Bregman divergence
- A distance-like quantity defined by a convex function; the matching loss is one.
- Hamilton–Jacobi equation
- A classical equation for the potential of a gradient flow; used to show fixed points are optimal.
- Majorize–minimize
- An optimisation scheme that minimises an upper bound touching the true objective at the current point.
- Surrogate
- A stand-in quantity that is zero exactly when the real goal is met, but does not measure the gap.
References
Numbered notes in the text, like [1], point here. Each entry says what it is cited for and how that was checked. Papers and books can be revised or misread, so follow the links before relying on a detail. Code marked “Toy model” is our own illustration of an idea, not the code of the cited system.
(2023). Flow matching for generative modeling. ICLR 2023 / arXiv. arXiv:2210.02747
Cited for:
- Flow Matching is a simulation-free way to train continuous normalizing flows by regressing the vector fields of fixed conditional probability paths; sampling works with off-the-shelf numerical ODE solvers. Checked against the paper’s abstract.