When I first read the MeanFlow paper, the core equation looked really familiar. After staring at it for a while I realized why: it is basically a Bellman backup, the same one from Q-learning, except continuous in time and vector valued. This post is my attempt to make that intuition concrete, with a 1D toy you can play with.
If you haven’t seen flow matching before, my flow matching post is a good warm up. I’ll use the same convention here: flow time \(s\) goes from \(0\) (noise) to \(1\) (data).
The problem MeanFlow solves#
Flow matching learns an instantaneous velocity \(v(z_s, s)\) and generates by integrating it in many small steps. The trajectories are curved, so if you try to jump from noise to data in one step using the velocity at the start, you overshoot.
MeanFlow instead learns the average velocity over an interval:
$$u(z_s, s, t) = \frac{1}{t-s}\int_s^t v(z_\tau, \tau)\, d\tau$$so a jump of any size lands exactly on the trajectory:
$$z_t = z_s + (t-s)\, u(z_s, s, t)$$With \(s = 0, t = 1\) that is one-step generation. Drag the slider below to see the difference on a 1D example, where noise flows into a distribution with two peaks.
The MeanFlow identity#
The catch is that we can’t compute that integral during training. The trick in the paper is to differentiate the definition. Multiply both sides by \((t-s)\) and take the derivative with respect to \(s\) along the trajectory:
$$u(z_s, s, t) = v(z_s, s) + (t-s)\,\frac{d}{ds} u(z_s, s, t)$$where \(\frac{d}{ds}u = v\,\partial_z u + \partial_s u\) is a total derivative, computed with a single Jacobian-vector product. Now the right-hand side only needs the velocity and the network itself, so it can be used as a regression target (with a stop-gradient).
(The paper puts data at time 0 and noise at time 1, so its version has a minus sign. Same equation, flipped clock.)
It’s a Bellman backup#
Here is the part that clicked for me. Define the displacement \(J(z_s, s, t) = (t-s)\,u(z_s, s, t)\), the total distance you travel from \(s\) to \(t\). Now chop off one small step of size \(\Delta\). For small \(\Delta\), the distance covered in that step is just velocity times time:
$$J(z_s, s, t) \approx \underbrace{v(z_s, s)\,\Delta}_{\text{reward}} + \underbrace{J(z_{s+\Delta}, s+\Delta, t)}_{\text{value of next state}}$$The long jump is one step of velocity plus the slightly shorter jump from where that step lands. Taylor expand the right side to first order in \(\Delta\) and you get exactly the MeanFlow identity. Compare it with the Bellman equation from Q-learning:
$$V(s_k) = r_k + \gamma\, V(s_{k+1})$$| Bellman / TD learning | MeanFlow |
|---|---|
| state \(s_k\) | point on the path \(z_s\) and its time \(s\) |
| reward \(r_k\) | one step of velocity \(v(z_s, s)\,\Delta\) (a vector) |
| value \(V\) | displacement \(J = (t-s)\,u\) |
| horizon | interval length \(t - s\) (given to the network) |
| discount \(\gamma\) | \(1\), no discounting |
| base case: one step left, value = reward | \(t = s\): \(u = v\), plain flow matching |
| TD target with a frozen target network | stop-gradient on the MeanFlow target |
| sampled reward and next state | sampled velocity \(x_1 - x_0\) instead of the true \(v\) |
That last row is neat. During training we don’t know the true marginal velocity, so we plug in the conditional velocity \(x_1 - x_0\) from a single noise/data pair. Because the target is linear in the velocity, this is an unbiased stand-in, just like TD learning uses one sampled transition instead of the full expectation over next states.
So MeanFlow is a continuous, vector-valued, horizon-conditioned Bellman backup. Short horizons are learned almost directly (they are just flow matching), and long horizons bootstrap off the network’s own predictions for shorter ones.
The discrete cousin: shortcut models#
Shortcut models make the same move with finite steps. A jump of size \(2d\) is trained to equal two consecutive jumps of size \(d\), the second one starting where the first one landed. That is a two-step Bellman backup, applied over and over to double the horizon. MeanFlow is what you get when the chopped-off piece shrinks to zero: instead of stitching two finite jumps together, it uses the derivative.
Where the analogy breaks#
- There is no max. Q-learning picks the best action; here there are no actions, the flow is the dynamics. It is closer to policy evaluation (predicting value under a fixed policy) than to control.
- The reward is a vector. Every dimension of the image gets its own “return”.
- The horizon is an input. In RL the horizon is usually fixed or discounted away. Here the network sees \((s, t)\) and has to be right for every horizon at once.
Why I like this view#
If MeanFlow is a Bellman backup, then a lot of RL folklore should carry over. Bootstrapping means errors at short horizons leak into long ones, the same instability TD learning fights with target networks. And ideas like n-step returns map onto mixing a few real integration steps into the target. I haven’t tested any of this yet, but it makes MeanFlow feel a lot less like a magic trick and more like something I already know how to think about.



