Chapter 3 computed one training pair's exact velocity by hand — a fine warm-up, but not a generative model. A real sampler has to work on noise it's never seen. Can training on a handful of pairs produce a velocity field that generalizes to a brand-new starting point?
Pick a starting noise value and take Euler steps. None of these four starting points were in the training set — the field being applied was fit once, on four completely different pairs, and now generates from anywhere.
Fitting a constant velocity field by least squares against training pairs' velocities has a closed form — the mean:
- — the single constant velocity value being fit, applied identically at every point and every time.
- — the number of training pairs.
- — the noise sample from the -th training pair.
- — the data sample from the -th training pair.
- The smallest possible flow-matching model
This has no dependence on or at all — just one number.
- Real networks condition on x and t, same objective
Real flow-matching networks condition on both, so different starting points and different times along the path get genuinely different corrections — but the training objective being minimized is the exact same squared error between a predicted velocity and , just with a far more expressive model fitting it.
The trained field doesn't equal any single training pair's velocity — it's their average. Every pair pulled the fit a little differently, and the least-squares solution is the one number that minimizes total squared disagreement across all four, not the best match to any one of them.
Four training pairs: , , , :
- Each pair's velocity
Computed exactly as in Chapter 3, one subtraction each ():
- :
- :
- :
- :
- Train: average them
. This is the entire training procedure for this model.
- Generate from noise the model never trained on
(not one of the four training points): — one Euler step, exact, since the trained field is constant.
Find the noise point, among the four candidates, whose generated sample lands closest to the target value of 7.
This sampler generalizes in the most limited way possible — it applies the exact same shift to every starting point, so it can never do more than translate the noise distribution. A real flow-matching network's velocity depends on and , which is what lets different starting points end up in different parts of a genuinely multi-modal data distribution instead of all landing exactly apart. This closes Part XVI. The mechanisms covered — exact densities via invertible maps, score fields, straight-line training targets, single-step distillation, and discrete codebooks — are the building blocks behind essentially every modern image, audio, and video generator shipped today. The next part turns from generating a single output to a model that takes actions: calling tools, planning multi-step tasks, and orchestrating other models to get something done.