Preconditioned Flow Matching

Shadab Ahamed, Eshed Gal, Md Shahriar Rahim Siddiqui, Simon Ghyselincks, Moshe Eliasof, Eldad Haber

TL;DR

Flow matching models often stall during training because highly stretched, anisotropic intermediate data distributions create an ill-conditioned optimization landscape. This paper introduces Preconditioned Flow Matching, a framework that uses a reversible transformation to "whiten" or isotropize the data before training. This simple geometric fix dramatically accelerates optimization and yields significantly higher sample quality across various image resolutions.

What Problem Does This Paper Address?

Continuous-time generative models, such as flow matching (FM) and diffusion models, have a frustrating quirk: their training loss often plateaus long before the generated samples actually look good. Models that appear fully converged can continue to show massive improvements in image fidelity if trained for many additional epochs.

The authors identify this as a geometric optimization bottleneck. As a flow matching model learns to transport a simple reference distribution (like a standard Gaussian) into a complex target data distribution, the intermediate distributions along the path become highly stretched and unequal across different directions (anisotropic). In mathematical terms, their covariance matrices become ill-conditioned.

Gradient descent easily fixes errors along high-variance directions but makes agonizingly slow progress along narrow, low-variance directions. Crucially, the standard flow matching loss function weights errors by these very variances, meaning a low overall training loss can easily hide massive velocity errors in the fine, low-variance details of the data.

Figure 1: Precondition-then-match. Top: Standard flow matching learns through anisotropic intermediate distributions, which stagnates optimization. Bottom: A reversible preconditioner P maps the target to a more Gaussian-like space, improving the condition- ing of the transport path. Samples are mapped back with P−1.

Methods

To resolve this bottleneck, the authors propose a Precondition-then-Match framework (Algorithm 1):

  1. Learn a Preconditioner: Before training the main generative model, an invertible or approximately invertible transformation ($\mathcal{P}$) is trained to map the target data into a more isotropic, well-conditioned representation space.
  2. Train the Main Flow: The primary flow matching model is trained entirely within this transformed, well-conditioned space. Because the landscape is more spherical and less stretched, gradient descent converges uniformly across all directions.
  3. Invert at Inference: To generate new data, the model samples from a standard Gaussian, solves the learned transport ODE in the preconditioned space, and then projects the final sample back to the original data space using the inverse preconditioner ($\mathcal{P}^{-1}$).

The authors explore multiple types of preconditioners, including classic ZCA whitening, Normalizing Flows (RealNVP), and lightweight, low-capacity flow matching models.

Datasets

The framework was evaluated across a variety of dimensions and complexities:

  • Synthetic/Controlled Benchmarks: 2D Gaussians, 2D Gaussian Mixture Models (GMMs), and the Swiss roll dataset to isolate and visualize path conditioning.
  • Image Datasets: Latent MNIST, CIFAR-10 ($32\times32$), ImageNet-1k ($64\times64$), LSUN Churches ($256\times256$), Oxford Flowers-102 ($256\times256$), and AFHQ Cats ($512\times512$).

Key Insights and Ideas

  • The Loss Illusion: A low flow matching loss is deceptive. Because the excess risk is weighted by the intermediate covariance, large velocity errors can hide in low-variance directions without visibly impacting the scalar loss value.
  • Time-Reweighting is a Band-Aid: Common techniques like scalar time-reweighting adjust the importance of different time steps, but they cannot fix directional stiffness (the ratio of maximum to minimum eigenvalues) at any single fixed time step. Preconditioning actually alters the path's underlying covariance structure.
  • The Weakest Link Rules Multimodality: In multimodal data (like GMMs), optimization speed is not governed by the average data geometry. Instead, the single worst-conditioned, most anisotropic component acts as the bottleneck for the entire training process. Multimodality sharpens the bottleneck rather than averaging it away.

Key Results

  • Flattening the Condition Number: In toy settings where exact whitening is possible, preconditioning reduces the path condition number to a perfect 1 across all time steps, completely eliminating early optimization stagnation.
  • Quantitative Performance Boosts: On latent MNIST, Normalizing Flow (NF) preconditioning cut the Fréchet Inception Distance (FID) from 5.97 down to 2.74. Across larger image datasets, preconditioning consistently improved FID, Precision, and Recall (e.g., dropping LSUN Churches FID from 19.53 to 14.47 and ImageNet-1k from 8.66 to 4.98).
  • Geometry Beats Raw Capacity: To prove the gains weren't just due to adding more parameters via the preconditioner, the authors tested "compute-matched" baselines where the standard model was enlarged to match the total parameter count. The enlarged standard models still performed worse, confirming that the benefits are fundamentally geometric.
Figure 2: 2D Gaussian transport with and without preconditioning. (a) Standard FM transports samples from an isotropic source to an elongated target, but might struggle along the narrow direction, resulting in a higher MMD. (b) Preconditioned FM transports samples to a whitened target and maps them back using the inverse preconditioner. (c) Preconditioning reduces MMD and avoids early optimization stagnation. (d) It also lowers the condition number of intermediate covariance Σt along the transport path, improving sample alignment and stability. Curves show the mean over 10 independent runs with different random seeds; shaded regions denote one standard deviation.

Limitations and Future Work

  • Two-Stage Training Overhead: Preconditioning introduces an extra training phase, which comes with its own set of architectural choices and hyperparameters.
  • Approximate Invertibility Errors: Flow-based preconditioners are only approximately invertible via numerical ODE integration, which can introduce small, solver-dependent errors during the generation process.
  • Future Directions: The authors suggest extending this work to time-dependent or locally adaptive preconditioners that can dynamically adjust to the changing local geometry of complex, nonlinear neural networks. They also note that testing on massive-scale conditional generation models remains an open avenue.

Summary updated

BibTeX
@inproceedings{ahamed2026preconditioned,
  author = {Shadab Ahamed and Eshed Gal and Md Shahriar Rahim Siddiqui and Simon Ghyselincks and Moshe Eliasof and Eldad Haber},
  title = {{Preconditioned Flow Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=H9J2nlJCjx},
}
Figure