Papers
Topics
Authors
Recent
Search
2000 character limit reached

Sharpen Your Flow: Sharpness-Aware Sampling for Flow Matching

Published 12 May 2026 in cs.LG and cs.AI | (2605.11547v1)

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.

Summary

  • The paper introduces SharpEuler, which allocates Euler steps based on the velocity field's sharpness to reduce numerical errors and mode mixing.
  • It employs offline calibration and a quantile transformation to dynamically adjust the timestep grid, optimizing sample coverage and fidelity.
  • Empirical results on synthetic and high-dimensional data demonstrate improved sample quality, reduced computational cost, and maintained structural integrity.

Sharpness-Aware Sampling for Flow Matching: A Formal Summary

Flow Matching and Sampling Constraints

Flow matching models produce generative samples by integrating a learned velocity field through an ODE that transports samples from a base noise distribution to the data manifold. Each integration step requires a neural network evaluation, and sampling speed is dominated by the total number of such evaluations. Traditional approaches employ fixed, uniform time grids with simple one-stage solvers like Forward Euler to keep computational cost deterministic and tractable. However, uniform time discretization does not exploit the dynamics of the learned velocity field, and often results in poor sample quality when the evaluation budget BB is small.

SharpEuler: Offline Sharpness Profiling and Adaptive Gridding

SharpEuler is a training-free, solver-aware timestep scheduler for flow matching models. Its core principle is to allocate more Euler steps to regions where the velocity field changes rapidly (i.e., is sharp), and fewer steps where the trajectory is smoother. The method comprises two stages:

  • Offline calibration: Representative trajectories are evaluated on a fine-grained grid. Finite differences of sequential velocity field values provide estimates of the local acceleration, serving as a proxy for sharpness.
  • Schedule induction: The averaged, smoothed sharpness profile is transformed into a monotone time grid via quantile transformation, supporting any desired evaluation budget without increasing cost.

Sampling domain and implementation remain unchanged (Forward Euler, fixed BB); only the timestep placement is altered. This separates adaptive schedule design from online inference, avoiding sample-dependent computation overhead.

Numerical, Variational, and Statistical Principles

The justification for SharpEuler is formalized in three principles:

  1. Numerical principle: Euler local truncation error and backward error analysis both identify trajectory acceleration x¨(t)\|\ddot x(t)\| as the leading source of discretization bias. Placing denser steps in high-acceleration regions reduces numerical error and mode mixing.
  2. Variational principle: Optimal allocation of steps to minimize accumulated error yields power-law densities over the sharpness profile. The square-root law ρ(t)I(t)\rho(t)\propto\sqrt{I(t)} (with I(t)I(t) as profile) minimizes Euler-risk. Different exponents γ\gamma induce tradeoffs between support coverage and sample concentration.
  3. Statistical principle: The empirical schedule, calibrated from MM sample trajectories, converges to the optimal population schedule as MM increases, with terminal distribution error controlled by O(log(N)/M)O(\sqrt{\log(N)/M}) plus an O(1/B)O(1/B) Euler bias.

Empirical Evaluation on Synthetic and High-Dimensional Data

SharpEuler is evaluated on controlled two-dimensional target distributions (Branched Manifold and Rotated Grid), as well as large-scale text-to-image synthesis using FLUX.1-dev (a 12B-parameter rectified flow transformer).

  • Synthetic data: SharpEuler achieves superior coverage and density compared to uniform and entropic time schedules, especially in the small BB0 regime. The choice of exponent BB1 yields best distributional match via Wasserstein distance; higher exponents concentrate samples but reduce coverage.

Figure 1

Figure 1

Figure 1: Generated samples on Branched Manifold (top) and Rotated Grid (bottom) at BB2, SharpEuler shows improved support coverage and fidelity over uniform schedules.

Figure 2

Figure 2: Calibrated sharpness profiles and resulting timestep grids; higher BB3 values concentrate steps in sharper regions across datasets.

  • Text-to-image generation: With fixed evaluation budgets and the same neural network, SharpEuler produces images that are more faithful to reference compositions, structures, and lighting, as measured by pixel RMSE, FID, and CLIP scores. Vision-judge experiments (GPT-5.5) show consistent semantic and compositional improvements for SharpEuler-scheduled images.

Figure 3

Figure 3: FLUX.1-dev generations at BB4; SharpEuler preserves compositional and structural fidelity to 50-step references better than uniform schedules.

Implications and Further Directions

SharpEuler demonstrates that adaptive step placement, derived from the underlying velocity field dynamics, is a critical factor in efficient sample generation for flow matching models. It provides a deterministic method to improve fidelity and mode coverage for any pretrained model and evaluation budget, without retraining or increasing computational overhead.

Practical implications include reduced inference cost for high-dimensional models (image, video, scientific domains), improved sample quality in low-budget settings, and potential integration with existing pipelines as a calibration step. Theoretical implications extend to the design of future solvers and schedule optimizers where step allocation is tied to numerical indicators beyond entropy or hand-tuned heuristics.

Future work could generalize sharpness-aware calibration to higher-order solvers, stochastic integration schemes, or further leverage trajectory irregularity measures to inform adaptive sampling in broader generative frameworks.

Conclusion

SharpEuler offers a systematic, training-free approach to timestep allocation in flow matching samplers, grounded in numerical error principles and supported by strong empirical results. By profiling trajectory sharpness and allocating integration steps accordingly, sample quality at fixed evaluation budgets is markedly improved, both in synthetic and high-dimensional generative tasks. This work reframes efficient generative sampling as a function not only of solver design, but also of offline trajectory characterization and schedule calibration, opening new avenues for adaptivity in generative modeling (2605.11547).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 8 likes about this paper.