U2.2 Why Does the Average Crowd Transport the Whole Distribution?
Builds on3 notes
How do we know the field transports the right distribution?
Our reference paths connect the intended endpoint distributions. Generation, however, follows their learned average field rather than an individual reference path.
Why should that field still transport to ?
How does a velocity field change a distribution?
Density describes how crowded a neighborhood is, rather than the location of one particular person.
We should ask whether motion increases or decreases the mass inside a small region.
Divergence describes net outward flow
The divergence of velocity describes local expansion or compression. To track density, we must also account for how much mass occupies that location.
SupplementWhy sum directional derivatives?
Divergence adds the outward changes in velocity along each coordinate direction.
In two dimensions,
The two terms measure horizontal and vertical expansion:
- : local volume expansion.
- : local compression.
- : no net local volume change.
In dimensions, sum over coordinates. See M0.1 for flux and the divergence theorem.
A crowded corridor with slow movement need not carry many people per second. Nor does an almost empty corridor with fast movement. Throughput depends on both density and speed.
Their product is
probability flux. In one dimension, density is probability per unit length and velocity is length per unit time:
The product is probability crossing a location per unit time.
For a small interval, compare incoming flux at the left boundary with outgoing flux at the right. More outflow decreases the enclosed mass.
Net outward flux per unit volume is the divergence of flux:
Positive net outflow requires falling density:
or equivalently,
This is the continuity equation: mass changes through movement across boundaries, without appearing or disappearing.
Try itDerive the one-dimensional inflow-minus-outflow equation
A short interval has mass approximately . Its change per unit time is
Divide by and take the limit:
In higher dimensions, replace endpoints by a closed boundary and the derivative by divergence.
Add the conservation laws for the conditional groups
Let denote an endpoint pair. Given , consider a conditional probability path with velocity .
Mixing the pairs gives the intended marginal path:
The crowd average can be written as
Its posterior weights select paths compatible with the current location and time.
Substitute the marginal density and flux into the continuity equation:
Each conditional path conserves mass, so the integrated expression vanishes.
Average the conditional fluxes, and the resulting velocity transports the correct marginal path.
This justifies Conditional Flow Matching [1]. Generated particles need not retrace individual training paths; they solve the ODE driven by the marginal field, using the neural-ODE viewpoint [2]:
Under the regularity and uniqueness conditions below, the terminal distribution is .
SupplementA weak proof that also handles singular conditional paths
We can prove the result directly from random reference paths, without assuming each conditional law has a density.
Let , define its law , and set
For a smooth compactly supported test function ,
Use the chain rule followed by conditional expectation. Integration by parts gives the weak continuity equation:
This also covers deterministic conditional paths represented by Dirac measures. If the resulting field is regular enough to uniquely determine the transported law, its ODE marginals equal the reference marginals.
SupplementHow do CFM and ideal FM losses differ?
If the marginal velocity were available, we could train with
CFM uses conditional labels instead. Expanding the square and conditioning gives
The extra variance term is independent of , so the gradients and minimizers agree. It measures conflicting reference labels at the same input.
SupplementDoes a density path determine a unique velocity?
No. If , then gives the same density evolution. A circular crowd can rotate without changing its density.
The continuity equation determines distribution evolution without uniquely fixing sample trajectories. This freedom becomes a sampling-efficiency issue in the next unit.
Check your understanding
References
- Lipman, Y., Chen, R. T. Q., Ben-Hamu, H., Nickel, M., Le, M. Flow Matching for Generative Modeling. ICLR 2023. Theorems 1 and 2.
- Chen, R. T. Q., Rubanova, Y., Bettencourt, J., Duvenaud, D. Neural Ordinary Differential Equations. NeurIPS 2018.