Predict terminal sample
Extrapolate from the current state to its predicted terminal sample using the pretrained flow.
Pretrained flow models are now widely used as generative priors in science and vision, where inference-time guidance enables test-time constraints without retraining. Existing methods use projection, posterior sampling, or iterative optimization of the generative trajectory. We propose LyapuFlow, an alternative based on Lyapunov feedback control. At each sampling step, LyapuFlow predicts the terminal sample towards which the current flow is evolving, and evaluates the constraint violation on this prediction. Then, we compute the minimum-norm control that satisfies a prescribed Lyapunov decrease condition. The resulting control remains inactive when the uncontrolled dynamics already reduce the constraint violation at the prescribed rate. Otherwise, it provides a corrective update within a feedback trust region that prevents the control from dominating the pretrained dynamics. We demonstrate LyapuFlow in both data and latent spaces, outperforming alternatives spanning different mechanisms for test-time constraint enforcement in scientific machine learning and image inverse problems.
Classical Lyapunov control uses feedback to make an energy-like function decrease along a dynamical system's trajectory. Here, control acts on an intermediate sample of a pretrained generative flow, while the physical or measurement constraint applies to the final sample. LyapuFlow defines the Lyapunov function V in terms of the predicted final sample's constraint violation, then uses it to guide the flow without overwhelming the learned dynamics.



When the pretrained flow already reduces the predicted violation at the prescribed rate, control stays inactive; otherwise, a minimum-norm correction within a trust region steers the sample in a direction that decreases V while preserving the learned dynamics. For latent flow-matching models composed of a latent-space velocity model and a decoder, the contribution of the latent-space velocity model to the final control can be adjusted across sampling steps. No retraining is required.
Extrapolate from the current state to its predicted terminal sample using the pretrained flow.
Evaluate the constraint violation at the predicted terminal sample using the Lyapunov function.
Apply minimum-norm feedback when needed (active control), bounded relative to the pretrained flow.
Results · Data space
We study scientific inverse problems by generating PDE solutions under hard physical constraints for 1D heat, Burgers, and reaction–diffusion (RD) equations, as well as 2D Navier–Stokes (NS) systems. These constraints span linear and nonlinear requirements, including initial conditions, local dynamics, and conservation laws. For a fair comparison under hard constraints, we apply the same number of final projection steps to every sampler after generation.
Higher sample fidelity while satisfying physical constraints. In these 1D Burgers examples, the top panel shows average solutions for a group with the same initial condition, and the bottom panel shows the pointwise absolute error relative to the ground truth. Constraints include the initial condition, nonlinear local dynamics enforced with a Godunov update over the first five time steps, and mass balance.
These 2D NS examples show generated solutions subject to constraints on the initial vorticity and total-vorticity conservation.
Task adaptability through decay-rate tuning. Unlike other samplers, which require task-specific tuning of the guidance step size, LyapuFlow can adapt relatively easily across tasks and models by adjusting its Lyapunov decay rate.
Results · Latent space
We study image inverse problems in the established image latent space of pretrained flow-matching models such as Stable Diffusion 3.5 Medium. A degraded image from the AFHQ, FFHQ, or DIV2K datasets defines a measurement constraint that guides generation toward a clean reconstruction. While including the velocity Jacobian can empirically better preserve high-frequency components, it also increases sensitivity and computational cost. We therefore use a gradient-switch step to regulate its use, keeping guidance decoder-Jacobian-only for early steps of the sampling trajectory or throughout the entire trajectory. As LyapuFlow uses one feedback update per sampling step without iterative inner or outer optimization, our primary baselines are FlowChef and FlowDPS, whose default configurations also avoid iteration-heavy guidance.
Reconstruction of instance-specific image details. In the following 4× super-resolution and motion-deblurring examples, LyapuFlow avoids hallucinated antennae on the butterfly and better preserves high-frequency components in the cat reconstruction.
Sampling budget test. These Gaussian deblurring examples compare FlowDPS and LyapuFlow at different numbers of function evaluations (NFEs). Although a larger budget reduces some FlowDPS artifacts, the freckles in the first row remain faint and the eyelid crease in the second row stays absent; LyapuFlow preserves both details at either budget.
@article{gwak2026lyapuflow,
title={LyapuFlow: Controlling Generative Flows with Lyapunov Feedback for Inverse Problems},
author={Gwak, Minseon and Hsu, Hans Hao-Hsun and Maddix, Danielle C. and Erichson, N. Benjamin},
journal={arXiv preprint arXiv:2610.04326},
year={2026}
}