Sharpen Your Flow: Sharpness-Aware Sampling for Flow Matching

Aditi Gupta, Soon Hoe Lim ∗, Annan Yu, N. Benjamin Erichson ∗ · 2026

Read Sharpen Your Flow: Sharpness-Aware Sampling for Flow Matching by Aditi Gupta, Soon Hoe Lim ∗, Annan Yu, N. Benjamin Erichson ∗ (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-11547.txt.

Introduction

Gupta, Lim, Yu and Erichson propose SharpEuler, a sharpness-aware sampler for flow matching. Flow matching models generate samples by integrating a velocity field, each step costing one network evaluation. Fast generation means spending a small budget well: not just how, but where to spend steps. SharpEuler profiles a pretrained model offline, estimating where velocity changes most, then converts that profile into a timestep grid for any budget. At test time sampling stays Euler integration with the same count as a uniform schedule, yet improves quality at fixed budgets.

Catalog record

CREATORAditi Gupta, Soon Hoe Lim ∗, Annan Yu, N. Benjamin Erichson ∗
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE103882
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.11547

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Sharpen Your Flow: Sharpness-Aware Sampling for Flow Matching Aditi Gupta, Soon Hoe Lim ∗, Annan Yu, N. Benjamin Erichson ∗ Abstract Flow matching models generate samples by numerically integrating a learned velocity field, with each integration step requiring a neural network evaluation. Fast generation therefore requires using a small fixed evaluation budget effectively: the key question is not only how to integrate the flow, but where the sampler should spend its steps. We propose SharpEuler, a training-free sampler that profiles a pretrained model offline by estimating where the learned velocity field changes most rapidly along calibration trajectories. This finite-difference estimate defines a solver-aware sharpness profile, which is smoothed and converted by a quantile transform into a timestep grid for any desired inference budget. At test time, sampling remains ordinary Euler integration with the same number of model evaluations as a uniform schedule. We justify SharpEuler using three principles: a numerical principle identifying trajectory acceleration as the leading source of Euler discretization error, a variational principle deriving sharpness-based power-law timestep densities, and a statistical guarantee showing that the finite-sample calibrated sampler is stable at the terminal distribution level. Our experiments show that SharpEuler improves sample quality at fixed budgets, reducing inter-mode leakage and increasing mode coverage. 1]Lawrence Berkeley National Laboratory 2]International Computer Science Institute 3]Department of Mathematics, KTH Royal Institute of Technology 4]Nordita, KTH Royal Institute of Technology and Stockholm University 5]Center for Applied Mathematics, Cornell University \contribution [*]Equal Mentoring \code https://github.com/aditiii12/SharpEuler \correspondence N. Benjamin Erichson @ 1 Introduction Flow-based generative models have become a powerful tool for modeling high-dimensional distributions 23 ; 25 ; 1 . Their applications range from text-to-image 9 and text-to-video generation 16 to scientific domains such as time series modeling 14 ; 21 , fluid flow forecasting 22 , molecule generation 28 , materials design 35 , and protein structure generation 8 . As an instance of dynamical measure transport, sampling with a flow matching model requires integrating a learned velocity field that transports samples from a simple noise distribution to the data distribution. This makes sampling a numerical integration problem. In classical numerical analysis, accuracy is often improved using higher-order or adaptive solvers 13 ; 10 ; 5 . For neural generative models, however, each function evaluation is a forward pass through a large network 24 , and these evaluations dominate sampling cost in modern image and video models 9 . Thus the relevant quantity is not only asymptotic solver accuracy, but sample quality per neural network evaluation. For this reason, many practical samplers use simple one-stage methods with a fixed budget. Forward Euler is attractive because a sampler with budget B uses exactly B model evaluations. If we do not add solver stages or use an online adaptive method with sample-dependent cost, the remaining question is then: Where should a flow matching sampler spend its finite Euler budget? Uniform and shifted schedules are simple and often effective, but they are not derived from the learned dynamics being integrated. Recent work has shown that timestep allocation can strongly impact sample quality, especially in the few-evaluation regime 40 ; 42 ; 41 ; 31 . Other schedulers use information-theoretic criteria, such as entropy-based time reparameterizations that motivates the Entropic Time Scheduler (ETS) of 36 . Our perspective is complementary: for a fixed Euler solver, the schedule should be based on where the learned vector field is changing rapidly. See also App. A for a detailed discussion of related work. We propose SharpEuler, a training-free, solver-aware schedule calibration method for pretrained flow matching models. The method estimates where the learned trajectory is sharp (velocity field changes rapidly) rather than choosing this region by hand. In an offline calibration stage, we run fine-grained Euler trajectories on a set of representative prompts or samples, record consecutive velocity evaluations, and estimate how rapidly the vector field changes along the trajectory. Averaging and smoothing the finite-difference estimated accelerations gives a time-dependent sharpness profile. At inference time, we convert this profile into a monotone grid and run the same Euler sampler on that grid. The method does not change the model, require retraining, add solver stages, or increase the number of model evaluations. It only changes where the evaluations are placed. In this sense, SharpEuler moves adaptivity out of the inner sampling loop and into a cheap offline calibration stage; the deployed sampler remains a fixed-cost Euler sampler with exactly B evaluations. SharpEuler is motivated by the local truncation error (LTE) of Euler integration along a flow trajectory. Euler’s local truncation error is controlled by trajectory acceleration: regions where the learned velocity changes rapidly require smaller steps, while nearly linear regions can be traversed more coarsely. The same signal appears in backward error analysis 12 as the leading modified-equation bias. Thus, rather than placing steps uniformly or by hand, SharpEuler estimates where the trajectory acceleration is large and places more evaluations in those regions. This perspective also explains why the method is most useful at small sampling budgets. With many evaluations, even a uniform grid can resolve most changes in the trajectory. However, with only a few evaluations, a poorly placed Euler step can cross a sharp region without evaluating the intervening dynamics, which can mix modes or leave parts of the data distribution underrepresented. We observe this behavior both on synthetic distributions, where mode coverage and leakage can be measured directly, and in high-dimensional text-to-image sampling, where calibrated timesteps improve semantic fidelity. Contributions. Our main contributions are as follows. • We propose SharpEuler, a training-free, solver-aware method for constructing timestep schedules for pretrained flow matching models. It uses offline calibration trajectories to estimate a sharpness profile and converts this profile into a fixed Euler grid for any inference budget. • We provide three principles to justify SharpEuler. The numerical principle shows, via local truncation error and backward error analysis, that acceleration controls both the leading Euler error and the leading modified-equation bias. The variational principle shows that natural timestep allocation objectives yield power-law densities (Proposition 4.2 ), with the square-root case singled out by minimizing the leading Euler error proxy. The statistical principle gives a stability guarantee (Theorem C.9 ), showing that the calibrated schedule approaches the best population schedule in the admissible class as the number of calibration trajectories grows, up to smoothing bias. • We demonstrate that SharpEuler improves low-budget sampling without increasing the number of model evaluations. On synthetic multimodal data, it reduces inter-mode leakage, improves mode coverage and sample quality, especially at very small Euler budgets. We then demonstrate its advantage on high-dimensional text-to-image generation tasks. 2 Background and Problem Setup Flow matching models define a continuous transformation from a simple noise distribution to the data distribution through an ODE driven by a learned velocity field 24 : \frac{dx(t)}{dt}=u_{\theta}(x(t),t),\qquad x(0)\sim p_{0},\qquad x(t)\in\mathbb{R}^{d},\qquad t\in[0,1]. (1) We start from a base distribution p_{0}=\mathcal{N}(0,I) at t=0 and the ODE is integrated to t=1 to obtain new samples. Let T(x_{0}):=x(1;x_{0}) and \mu_{1}:=T_{\#}p_{0} denote the learned flow map and its output distribution. Equivalently, we can use the reverse-time coordinate s=1-t so that s=1 corresponds to noise and s=0 corresponds to data. If the learned velocity field is denoted by v_{\theta}(x,s) , then the forward-time velocity in Eq. ( 1 ) is u_{\theta}(x,t)=-v_{\theta}(x,1-t)

Read the complete text