Manuscript Offprint
arXiv:2609.00198A Lagrangian View of Flow Matching
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Modern explicit-time generative models, such as Flow Matching [Lipman et al., 2023] and Rectified Flow [Liu et al., 2023], are typically derived top-down via Optimal Transport and the continuity equation. This standard Eulerian approach focuses on the macroscopic transport of probability mass. In this paper, we present an alternative, bottom-up mechanical derivation grounded in a Lagrangian (particle-centric) perspective. By analyzing the local Taylor expansion of a continuous denoiser, we motivate a strict invariance condition required for optimal, single-step generation: the conservation of target identity. Enforcing this condition yields a governing quasi-linear advection Partial Differential Equation (PDE). We demonstrate that solving this PDE via the Method of Characteristics analytically yields the straight-line trajectories of Flow Matching. This geometric perspective isolates the Jacobian of the denoiser as the primary source of trajectory curvature, providing a direct mathematical explanation for why straight-line flows enable massive step sizes, and why empirical models require distillation to flatten intersecting characteristics.
1 The Predictor-Corrector and the Moving Target
Consider a generative process mapping noise to data over a continuous time parameter , where defines the clean data manifold. Let be the state of the trajectory. We rely on a differentiable denoising function whose objective is to predict the final clean data state from the current state .
As the state moves infinitesimally along the trajectory by over time , the denoiser's prediction of the target changes according to its total continuous differential:
where is the spatial Jacobian matrix and represents the temporal drift.
This continuous drift presents a fundamental challenge for the discrete ODE solvers used in standard generative models (such as Gaussian diffusion). To understand this algorithmic penalty, consider what happens when a discrete solver attempts to navigate this changing field across a single, finite time step. Suppose the solver is currently at state at time :
-
The Predictor: The solver applies the denoiser to get its first prediction, . It calculates the residual error between its current state and this target, , and uses this to dictate the discrete step forward, .
-
The Corrector: The solver arrives at the new state, , at the advanced time . It must now apply the denoiser a second time to re-evaluate the target.
We can observe the denoiser's behavior during this second application by taking a first-order Taylor expansion at the new state, which acts as the discrete, macroscopic version of the total differential:
This expansion reveals a fundamental bottleneck. Because the noise schedule curves the underlying manifold, the destination is constantly shifting. The Jacobian corrects the estimate by reacting to the newly revealed local geometry at , while the temporal derivative accounts for the receding timeline. Consequently, in standard diffusion, the denoiser's prediction of the clean image changes at every single step. Because the target is continuously moving, solvers are forced to take extremely small, conservative step sizes ( ) to avoid overshooting the shifting destination.
For this to hold continuously, the total rate of change of the denoiser's output along the path must be exactly zero:
This consistency constraint has been used elsewhere [Geng et al., 2025] to construct a finite-difference training loss. Here however, we use it to introduce a complete shift in perspective. Standard Flow Matching and stochastic interpolant literature [Lipman et al., 2023, Albergo and Vanden-Eijnden, 2023] derives the velocity field from an Eulerian (field-centric) perspective, relying on the Continuity Equation to dictate the conservation of probability mass across space.
In contrast, Equation (3) represents a Lagrangian (particle-centric) perspective. Rather than standing at a fixed coordinate watching probability mass flow past, we are conceptually sitting inside a specific particle riding the flow. Geometrically, the ideal denoiser acts as the inverse flow map . Thus, our invariance principle demands that the target identity (the origin ) of the particle is perfectly conserved as it flows.
Applying the multivariate chain rule, we expand this total derivative into its spatial and temporal components:
Let be the velocity vector field driving the generative state. Substituting this, we arrive at the governing equation for an invariant generative field:
Equation (6) is a system of first-order, quasi-linear advection PDEs. It dictates that any temporal drift in the target manifold must be perfectly neutralized by advecting the state through the local geometry of the denoiser. While the Eulerian continuity equation describes the same underlying dynamics at macro scale, this Lagrangian PDE isolates the local spatial Jacobian, making it well suited to analyze the mechanical difficulties of discrete ODE solvers.
3 Solving the PDE: Deriving Flow Matching
Rather than relying on Optimal Transport, the Conservation Equation, or Fokker–Planck marginals, we can construct a generative model by directly designing a velocity field that solves this PDE. To do so, we employ the Method of Characteristics.
The governing PDE (6) constrains the pair jointly, but does not by itself pick out a unique velocity field: for an arbitrary denoiser , infinitely many fields satisfy at a given point. To make progress, we therefore posit a candidate velocity field, motivated by Tweedie's formula [Efron, 2011] and the residual-driven flow of Milanfar and Delbracio [2024], rather than deriving it from the PDE alone. Recall Tweedie's formula-based residual flow,
where the velocity is driven entirely by the residual error between the current state and the optimal MMSE denoiser. Generalizing the ideal denoiser to our continuous denoiser , and absorbing the noise-schedule coefficients into a single arbitrary scalar scheduling function , we postulate the residual-based velocity field
The role of the Method of Characteristics here is not to derive Equation (8), but to test whether this specific ansatz can be made self-consistent with the invariance principle of Section 2, and — if so — to solve for the resulting trajectories.
We evaluate the denoiser along a curve whose velocity is defined to match our ansatz,
By the chain rule this gives, identically and for any choice of ,
Note that Equation (10) is not yet a statement about invariance — it is simply the chain rule applied along . The content of our construction lies entirely in imposing the invariance condition on this specific curve, i.e. requiring
along . This is a choice, not a consequence of Equation (8) alone — it is the same Section 2 invariance principle, now applied to the particular trajectory generated by our ansatz. Equation (11) tells us that if such a self-consistent trajectory exists, must be constant along it. The boundary condition then fixes that constant:
This is now a genuine consequence we can exploit. Substituting the constant target (12) back into the ansatz (8) turns the coupled PDE system into a single, closed, separable ODE in alone:
This is now a separable, linear ODE. Integrating both sides with respect to time yields:
where serves as the noise schedule, and is the constant of integration representing the initial noise state at .
Equation (16) is the exact formulation of Flow Matching and Rectified Flow [Lipman et al., 2023, Liu et al., 2023]. By requiring the velocity field to be reconciled with the generative advection PDE, the only self-consistent characteristic curves under this residual ansatz are straight lines radiating from the data to the noise .
What this derivation shows, precisely. We have not proven that the residual ansatz (8) is the unique velocity field solving the invariance PDE — other choices of could in principle also be made self-consistent. What we have shown is narrower, and we believe still instructive: (i) the residual ansatz can be reconciled with the invariance principle, (ii) doing so forces to be constant along the resulting characteristics, and (iii) that single requirement, combined with the boundary condition at , is sufficient to pin down the trajectories completely — and they are exactly the straight lines of Flow Matching. The Method of Characteristics does real work in step (iii); the ansatz in Equation (8) does the work of narrowing which PDE solution we look for in the first place.
4 The Jacobian Penalty and Trajectory Curvature
This PDE framework cleanly isolates why standard diffusion models require thousands of solver steps, while Flow Matching requires very few. We can rearrange the advection PDE to solve for the temporal drift of the target:
In standard diffusion models, the noise schedules non-linearly warp the intermediate marginal distributions. Because the probability mass diffuses non-linearly over time, the optimal target prediction inherently shifts at every timestep. Consequently, standard diffusion trajectories do not lie on the straight-line characteristics of our PDE.
When a trajectory deviates from the characteristic curve, the temporal drift becomes heavily non-zero. Equation (17) shows that tracking this shifting target requires continuously multiplying the velocity by the Jacobian matrix .
To understand the physical mechanics of this drift, we can view the denoiser through a statistical lens. For an optimal MMSE denoiser (or an “ideal” denoiser with a symmetric Jacobian), the spatial Jacobian is directly proportional to the posterior covariance matrix of the signal given the noisy observation [Manor and Michaeli, 2024]: .
Because any valid covariance matrix is Positive Semi-Definite (PSD), this imposes a strict geometric constraint on the target drift. If we measure how the target shifts along the direction of travel by taking the dot product of Equation (17) with the velocity , we find:
This provides a clear demonstration of solver instability: the temporal drift of the target is guaranteed to be negatively correlated with the velocity. The target will always retreat or resist the direction of travel, forcing standard curved ODE solvers to take infinitesimal steps to avoid overshooting. Furthermore, the target drifts exactly along the principal axes of the model's internal uncertainty ().
Geometrically, as , the target data manifold becomes infinitely sharp, causing the eigenvalues of the spatial Jacobian (i.e., posterior covariance) to diverge. If the trajectory is curved (), discrete ODE solvers are subjected to this exploding Jacobian, requiring infinitesimal step sizes to maintain stability.
Conversely, because Flow Matching analytically solves the PDE along straight characteristics, the target is static (). The Jacobian penalty is mathematically neutralized, allowing the solver to confidently traverse the space in massive step sizes without being thrown off course by the local geometry.
5 The Engineering Reality: Intersecting Characteristics
While the analytical solution to the PDE yields straight lines, empirical training of neural networks introduces a fundamental violation of the PDE's assumptions.
During the training of a Flow Matching model, straight characteristic lines are drawn independently between random noise vectors and data samples . In high-dimensional space, the path to one data point may physically intersect with the path to another.
At an intersection point , the PDE demands two different target values for , which is mathematically impossible for a deterministic function. To minimize loss, a neural network learns to output the expected (average) velocity at these intersections [Liu et al., 2023]. Statistically, this intersection represents a point of extreme ambiguity where the model's internal belief system is split. Consequently, the posterior covariance explodes at this coordinate, exhibiting massive eigenvalues along the principal axes spanning the conflicting targets.
This marginalization warps the vector field, bending the learned trajectories off the perfect characteristic curves. Consequently, is no longer zero, the Jacobian penalty returns, and baseline Flow Matching models still require intermediate solver steps (e.g., 20 to 50 steps) to navigate the resulting curvature.
To achieve true single-step generation, the characteristics must be uncrossed. This is achieved through Reflow (distillation) [Liu et al., 2023]. A baseline model simulates valid, non-intersecting trajectories from to . A new model is then trained to draw straight lines between these pre-matched pairs. Viewed through our statistical lens, Reflow is fundamentally an uncertainty elimination protocol. By untangling the paths, the mapping from any point on the trajectory to the final data point becomes deterministic. Without conflicting targets, the model's posterior uncertainty drops to zero, causing the covariance matrix to vanish (). Because the covariance vanishes, the spatial Jacobian becomes a zero matrix (), completely starving the mechanism that generates target drift. This process effectively constructs a true analytical solution to the advection PDE where characteristics never cross, driving globally and allowing true single-step evaluation.
5.1 A Minimal Working Example: The Two-Mode Crossing
To make the abstract claims of this section concrete, consider the simplest possible setting where characteristics cross: a 1D data distribution with two equally likely modes, , coupled to noise via the standard linear interpolation , . Individually, the two characteristic families are straight lines by construction. But because both modes share the same noise distribution, lines originating from and densely overlap near for close to 1, and the Bayes-optimal (i.e., population-optimal) denoiser — exactly what a well-trained network converges to — must average over both explanations there. For this symmetric two-point Gaussian mixture, the posterior mean has closed form:

Figure 1: The denoiser output across several noise levels . At it is nearly linear (heavy averaging, low confidence); by it has collapsed into a step function at , confirming that the Jacobian diverges as precisely at the crossing coordinate, as predicted in Section 4.
Figure 1 plots across , visually confirming the exploding-Jacobian argument of Section 4. Figure 2 integrates backward from to for several draws of . Trajectories starting far from the crossing () are nearly straight, matching the single-mode analytical solution of Section 3. But trajectories seeded close to the decision boundary () are visibly curved S-shapes: they linger near before being pulled decisively toward one mode only in the final stretch — exactly the “characteristics bending off course near an intersection” mechanism described qualitatively above.
Figure 3 turns this into the Section 6.1 diagnostic directly: it plots along each trajectory. For distant starts, this invariance-violation measure decays to numerical zero well before (the target has been resolved and stops moving — the PDE is satisfied). For near-crossing starts, it stays orders of magnitude larger for longer, peaking around before finally collapsing. Numerically, the near-crossing trajectories () exhibit a peak drift roughly larger than the far trajectories (): vs. .

Figure 2: Trajectories obtained by integrating backward from (noise) to (data), for several initial draws . Distant starts ( large) are nearly straight; starts near the crossing () show pronounced curvature, and the degenerate case never resolves at all.

Figure 3: The invariance-violation diagnostic (log scale) along each trajectory of Figure 2. Trajectories seeded near the crossing sustain large drift far longer than distant trajectories, directly localizing where the advection PDE is being violated.
This confirms the practical proposal of Section 6.1: the instantaneous quantity , computed directly from consecutive denoiser evaluations during sampling — with no access to ground truth needed — is a real-time, per-sample signal for exactly where a trajectory is fighting unresolved crossings, and hence exactly where a solver should slow down (or where Reflow-style distillation would most benefit that region of the data manifold). Note also the degenerate case in Figures 2-3: starting exactly on the decision boundary, the trajectory never resolves at all — stays frozen at the unstable fixed point , a toy analogue of the mode-averaging/blur failure mode seen in low-step generative samples.
This example is deliberately the simplest possible case (two modes, one dimension, closed-form posterior). Real data manifolds have continuously many “modes,” so in practice the diagnostic would be evaluated as a distribution over many samples rather than a handful of trajectories, but the underlying mechanism scales directly.
6 Discussion and Practical Implications
While the standard Eulerian perspective (e.g., Optimal Transport, Fokker-Planck) provides rigorous guarantees that the overall distribution of generated images matches the training data, it remains a macroscopic view. It abstracts away the discrete mechanics of the actual algorithms running on hardware. The Lagrangian (particle-centric) perspective presented in this paper offers several concrete, practical advantages for designing and debugging generative models:
6.1 A Tangible Metric for Inference Monitoring
The Eulerian view deals with vector fields and probability masses , which are abstract and cannot be directly measured during generation. Neural networks do not output probability masses; they output a tensor of pixel values (the denoiser prediction, ). Our derivation is built entirely around — the exact quantity the neural network computes. This implies that the core mathematical invariant can be directly monitored during inference. If we monitor the neural network’s output across solver steps and observe wild fluctuations, the advection PDE is being violated, immediately indicating that the trajectory is curved and smaller step sizes (or further distillation) are required. The toy example of Section 5.1 demonstrates this diagnostic concretely.
6.2 Reframing Distillation as Intersecting Characteristics
In standard literature, “Reflow” or distillation is often described abstractly as straightening the transport couplings between distributions. The Lagrangian view reframes this as intersecting paths. If a neural network is forced to evaluate a region where two particle paths cross, it must average the conflicting velocities. This averaging bends the flow, shifts the target, and immediately reactivates the Jacobian penalty. This provides a highly intuitive diagnostic lens: if a 1-step generator produces blurry results, it is mechanically because its characteristic curves are still crossing in high-dimensional space, requiring further Reflow to untangle.
References
M. S. Albergo and E. Vanden-Eijnden. Building Normalizing Flows with Stochastic Interpolants. In International Conference on Learning Representations (ICLR), 2023.
B. Efron. Tweedie's Formula and Selection Bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011.
Z. Geng, A. Pokle, W. Luo, J. Lin, and Z. Kolter. Consistency Models Made Easy. In International Conference on Learning Representations (ICLR), 2025.
J. Ho, A. Jain, and P. Abbeel. Denoising Diffusion Probabilistic Models. Advances in Neural Information Processing Systems (NeurIPS), 33:6840–6851, 2020.
Y. Lipman, R. T. Q. Chen, H. Ben-Hamu, M. Nickel, and M. Le. Flow Matching for Generative Modeling. In International Conference on Learning Representations (ICLR), 2023.
X. Liu, C. Gong, and Q. Liu. Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow. In International Conference on Learning Representations (ICLR), 2023.
H. Manor and T. Michaeli. On the Posterior Distribution in Denoising: Application to Uncertainty Quantification. In International Conference on Learning Representations (ICLR), 2024.
P. Milanfar and M. Delbracio. Denoising: a powerful building block for imaging, inverse problems and machine learning. Philosophical Transactions of the Royal Society A, 383(2299), 2024.
Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole. Score-Based Generative Modeling through Stochastic Differential Equations. In International Conference on Learning Representations (ICLR), 2021.