Introduction
Flow matching trains a velocity field to regress the time derivative of a conditional probability path between noise and data [1, 2, 3]. The model is then sampled by integrating that field from to . When the integration may use only a few function evaluations, the result depends less on how well the field was learned than on how far the trajectories it induces are from straight lines: Euler with a handful of uniform steps can follow a straight trajectory exactly and a curved one only badly.
The question of this task is therefore which conditional probability path, the coupling of noise and data together with the interpolation between them, gives the best image generator when it must be sampled with few Euler steps, with the network, the optimiser, the update budget and the sampler all held fixed.
The field attacks curvature from two sides. One is the coupling: pairing noise and data within the minibatch by optimal transport or related assignments makes the conditional paths cross less, so the marginal flow is straighter [4, 5, 6, 7, 8, 9]. The other is the schedule: changing how time is spent along the path, through the interpolation or through the density of training times [10, 11, 12, 13]. Both are limited at the scale of a minibatch. A coupling computed inside a batch of images can carry only a small number of bits about which noise belongs to which image, and a schedule warps all directions of image space alike, although image data has a strongly graded spectrum, with a few directions of large variance and thousands of very small ones.
We start from a different observation. For Gaussian data, the few-step error of the linear path is not a matter of crossing trajectories at all: along each principal axis of the data the marginal flow is a pure rescaling, , and on the linear path is a curved function of time. Euler then multiplies each axis by the wrong factor. In the research log the run kept, the agent's own analysis of the linear path under a Gaussian model of the data, with the training images' spectrum, predicted that four uniform Euler steps reproduce only between 3% and 70% of the data's standard deviation, depending on the band of principal axes; the low-contrast, blurred look of few-step samples is exactly this deficit. The path can be changed so that this part of the error disappears.
Method
Our method, the spectrally straightened flow (SSF), keeps the independent coupling of the starter and changes the interpolation and the time distribution of training. It has four parts: the straightening gain, a gate, a time weighting, and an importance-sampled estimate of that weighted objective. Apart from two constants, all four depend only on the training images' spectrum, which is computed once.
Principal axes of the data
In setup we compute the mean and the covariance of the training images, with every image
also entering horizontally flipped, and diagonalise it: , with the standard deviations floored at . Everything that follows happens in the
coordinates of the noise and of the centred image.
def setup(self, images, generator, device):
count = images.shape[0]
dim = images.shape[1] * images.shape[2] * images.shape[3]
first = torch.zeros(dim, dtype=torch.float64, device=device)
second = torch.zeros((dim, dim), dtype=torch.float64, device=device)
for start in range(0, count, self.CHUNK):
x = images[start:start + self.CHUNK].to(device).permute(0, 3, 1, 2).float() / 127.5 - 1.0
both = torch.cat([x, torch.flip(x, dims=(3,))]).reshape(-1, dim).double()
first = first + both.sum(0)
second = second + both.T @ both
mean = first / (2 * count)
cov = second / (2 * count) - torch.outer(mean, mean)
values, vectors = torch.linalg.eigh(cov)
scale = torch.sqrt(torch.clamp(values, min=self.FLOOR ** 2))Straightening the marginal standard deviation
The plain linear path is . Along axis , with independent endpoints, its variance is
and is curved in . If the two endpoints were instead correlated with coefficient along that axis, the variance would be
and for this is , a straight line. We obtain that straight standard deviation without changing the coupling at all, by rescaling the plain path along each axis:
, so the endpoints are exactly and . The regression target is the true time derivative,
Two properties make this the right lever. First, for Gaussian data the marginal flow along each axis now moves at constant velocity on a straight line, so Euler on the uniform grid is exact on it for every number of steps; nothing in the path is tuned to a particular step count, and we define no grid or step-size tables. Second, is an invertible, axis-wise rescaling of the linear path's state, so the signal-to-noise ratio of every axis at every time, and hence the denoising problem the network has to solve, is the same as on the linear path. What changes is the coordinate system the network predicts in. In the sampler's coordinates, one Euler step of the new path amounts to the exact propagator of the Gaussian part followed by an Euler step on the non-Gaussian correction: a spectrally preconditioned exponential integrator obtained purely through the definition of the path.
A gate for axes that are not yet resolved
Full straightening ( on every axis) restores the variance of all axes, including the thousands of weak axes whose content the sampler has not resolved by its last step. There, a few steps fill them with Gaussian grain rather than image detail. We therefore let the effective correlation grow with how far an axis' data amplitude dominates the remaining noise,
so that an axis follows the plain path, and is shrunk toward its posterior mean as on the plain path, until its signal is resolved, and is straightened from then on. The derivative of , including the time dependence of , is computed in closed form:
def gain(self, s, t):
"""D_i(t) and its time derivative."""
slope = t * s * s - (1.0 - t)
m = (1.0 - t) ** 2 + (t * s) ** 2
root = torch.sqrt(m)
rho = s / (s + self.C * (1.0 - t))
g = torch.sqrt(m + 2.0 * t * (1.0 - t) * s * rho)
dg = (slope + (1.0 - 2.0 * t) * s * rho + t * (1.0 - t) * self.C * rho * rho) / g
return g / root, (dg * m - g * slope) / (m * root)Where training effort goes, and how it is estimated
Once the path makes the Gaussian part exact, what remains for the network is the non-Gaussian part of the velocity, and an error at time along axis reaches the sample scaled by , so errors on weak axes made early are forgotten and errors made late persist. We weight the objective over time by the linear ramp
which integrates to one on .
Drawing times from directly would leave a problem: early draws carry far larger gradients than their loss suggests, because their irreducible target error is concentrated on a few strong axes rather than spread over thousands of weak ones. Under the Gaussian model, the irreducible part of the target along axis has variance
and we take as a proxy for the gradient noise of a draw at time . We then estimate the same objective by importance sampling: times are drawn with density
and each draw's loss is weighted by . The expected gradient is unchanged,
the weights have mean one, and the early times receive many light draws instead of a few heavy
ones. setup tabulates the cumulative distribution of on 2049 knots, and batch inverts it by
linear interpolation:
# tables of the sampling density weight(t) n(t) on a uniform time grid: its cdf and n(t)
t = torch.linspace(0.0, 1.0, self.KNOTS, dtype=torch.float64, device=device).view(-1, 1)
s = scale.view(1, -1)
m = (1.0 - t) ** 2 + (t * s) ** 2
g2 = m + 2.0 * t * (1.0 - t) * s * s / (s + self.C * (1.0 - t))
noise = torch.sqrt(((g2 * s * s / (m * m)) ** 2).sum(1))
density = (self.RAMP + 2.0 * (1.0 - self.RAMP) * t.view(-1)) * noise
steps = 0.5 * (density[1:] + density[:-1]) / (self.KNOTS - 1)
cdf = torch.cat([torch.zeros_like(steps[:1]), torch.cumsum(steps, 0)])
return {"mean": mean.float(), "basis": vectors.float(), "scale": scale.float(),
"cdf": (cdf / cdf[-1]).float(), "noise": (noise / cdf[-1]).float()}The training batch
batch puts the pieces together, using the task's general interface: it maps the loop's uniform
draws to times, forms the straightened state and its derivative in principal coordinates, and
returns the importance weights with them.
def batch(self, x0, x1, u, generator, info, state):
b = x0.shape[0]
basis, s, mean = state["basis"], state["scale"].view(1, -1), state["mean"].view(1, -1)
cdf, noise = state["cdf"], state["noise"]
last = cdf.shape[0] - 1
upper = torch.clamp(torch.searchsorted(cdf, u.contiguous()), 1, last)
lower = upper - 1
part = torch.clamp((u - cdf[lower]) / torch.clamp(cdf[upper] - cdf[lower], min=1e-12), 0.0, 1.0)
when = torch.clamp((lower.to(u.dtype) + part) / last, 0.0, 1.0)
weight = 1.0 / (noise[lower] + part * (noise[upper] - noise[lower]))
t = when.view(-1, 1)
z = x0.reshape(b, -1) @ basis
c = (x1.reshape(b, -1) - mean) @ basis
lin = (1.0 - t) * z + t * c
gain, dgain = self.gain(s, t)
x_t = t * mean + (gain * lin) @ basis.T
target = mean + (dgain * lin + gain * (c - z)) @ basis.T
return {"x_t": x_t.reshape(x0.shape), "t": when, "target": target.reshape(x0.shape), "weight": weight}The path is stateless and deterministic apart from the loop's own draws, uses the batch's own noise-image pairs as they come, and leaves the sampler untouched: plain Euler on the uniform grid for fixed-step sampling and, because the target is the true time derivative, the adaptive solver as is. The same constants serve every setting; only the spectrum is computed from each setting's training images.
Results
| Method | ① | ② | ③ | ||||||
|---|---|---|---|---|---|---|---|---|---|
| FID, few Euler steps ↓ | FID, more Euler steps ↓ | FID, largest sampling budget ↓ | FID, few Euler steps ↓ | FID, more Euler steps ↓ | FID, largest sampling budget ↓ | FID, few Euler steps ↓ | FID, more Euler steps ↓ | FID, largest sampling budget ↓ | |
| Claude Fable 5.2 | 7.016 | 4.909 | 4.887 | 19.28 | 13.73 | 13.59 | 11.68 | 7.855 | 7.326 |
| Independent linear path | 18.90 | 10.93 | 6.984 | 28.42 | 19.66 | 15.98 | 25.92 | 15.77 | 10.57 |
| VP trigonometric path | 43.30 | 9.155 | 6.188 | 88.46 | 26.97 | 15.03 | 66.84 | 23.57 | 15.58 |
| Stochastic interpolants | 25.33 | 6.803 | 6.190 | 39.55 | 16.92 | 15.16 | 34.68 | 15.12 | 12.79 |
| OT-CFM | 15.76 | 10.94 | 7.337 | 25.52 | 20.11 | 16.69 | 23.99 | 17.36 | 12.81 |
| W-CFM | 20.25 | 11.09 | 6.650 | 30.17 | 20.33 | 16.09 | 28.07 | 16.95 | 11.38 |
| LOOM-CFM | 14.77 | 10.33 | 6.934 | 24.21 | 19.12 | 15.85 | 20.11 | 14.14 | 9.830 |
| VS-FM | 24.97 | 10.48 | 5.937 | 36.61 | 19.87 | 14.08 | 32.29 | 15.07 | 8.846 |
| Logit-normal timestep sampling | 18.12 | 11.15 | 6.899 | 28.03 | 20.17 | 16.02 | 32.76 | 23.01 | 17.56 |
| DC-FM | 31.89 | 15.11 | 8.981 | 36.28 | 28.72 | 20.12 | 29.11 | 16.62 | 10.72 |
| CNA + OT | 13.53 | 9.972 | 7.671 | 23.05 | 18.82 | 16.68 | 19.90 | 15.54 | 13.09 |
| QAT-FM | 17.15 | 11.12 | 6.967 | 26.72 | 19.90 | 15.96 | 22.97 | 15.61 | 10.70 |
- ① CIFAR-10 · UNet · 150k steps · Euler 8/16/50 NFE
- ② ImageNet 32×32 · UNet · 150k steps · Euler 8/16/50 NFE
- ③ CIFAR-10 · U-ViT-S/2 transformer · 150k steps · Euler 8/16/50 NFE
SSF has a lower mean FID than every baseline on every setting and on all three reported measures. At the smaller sampling budget it reaches 7.016 on C10-UNet, 19.28 on IN32-UNet and 11.68 on C10-UViT, against 13.53, 23.05 and 19.90 for the strongest baseline on each (CNA + OT [7], CNA + OT [7] and CNA + OT [7]), and against 18.90, 28.42 and 25.92 for the independent linear path it modifies. At the larger budget the picture is the same: 4.909, 13.73 and 7.855, against 6.803 (Stochastic interpolant [3]), 16.92 (Stochastic interpolant [3]) and 14.14 (LOOM-CFM [5]).
The margins in FID points are largest where the method was aimed, at the smallest sampling budget, and smallest with the largest sampling budget, where discretisation error matters least and what is left is mostly the quality of the learned field. There SSF is still ahead, at 4.887, 13.59 and 7.326 against 5.937, 14.08 and 8.846 (VS-FM [10] on each), but by a much narrower margin on IN32-UNet. That the straightening does not cost model quality is the property the design was meant to keep, since the denoising problem is unchanged; the result with the largest sampling budget is consistent with it.
A second reading of the table concerns the gap between the two Euler budgets. On the linear path the smaller budget costs 18.90 against 10.93 on C10-UNet; for SSF the same two figures are 7.016 and 4.909, and at the larger Euler budget SSF is already level with its own value at the largest budget, 4.887. Removing the Gaussian part of the discretisation error shrinks, but does not close, the cost of sampling with fewer steps.
How we got here
The method came out of an offline analysis, and was then shaped mostly by what failed. The development figures below are the agent's own development measurements, taken with its own FID evaluator on intermediate and full-length development runs; all quoted FIDs are at four Euler steps or with an adaptive solver.
- A Gaussian model first. We began by writing down the marginal flow of the linear path for Gaussian data with the training images' spectrum. It showed that few-step Euler loses variance in every band of principal axes, the strong ones through the first step and the weak ones through the last, and that a schedule concentrating the steps at the end, such as the coasting profile of velocity-scheduled flow matching [10], repairs the fine bands at the cost of the coarse ones. By the same model, a coupling would need on the order of 15 bits of pairing information to remove most of the error on the strong axes. The straightened path followed from asking instead for a path whose Gaussian part Euler integrates exactly. We also emulated such changes of coordinates on an already trained linear-path model, which lets a family of paths be compared without retraining.
- Full straightening produced grain; a hard gate fixed it, a smooth gate fixed it better. The first version straightened every axis. It restored the spectrum even with two steps, but left excess variance on the weakest axes, visible as grain. A gate that kept an axis on the plain path until its noise-to-signal amplitude fell below a threshold gained substantially at four steps, but its moving, sharp spectral edge was hard for the networks to represent, in particular for the transformer. Among smooth gates, emulation favoured the shape , with flat over a range; we chose and re-checked it on a full-length model, where larger traded better few-step FID for worse many-step FID.
- Moving information earlier in time failed, every time. Several variants tried to let the sampler resolve weak axes earlier, or strong axes later: an equal-angular-speed rotation of a whitened image, an information floor that boosts weak axes inside the path, a cap on the information scale of strong axes, and a fade-out of the noise on weak axes. All were clearly worse in short runs; the information floor, for instance, gave 85.1 against 51.5 for the gated path after 10k updates. Our reading, written down at the time, is that under a pixel-space velocity loss the path also fixes the per-axis loss weighting and the order in which the network learns, and the standard information schedule is a good one for learning. The marginal standard deviation is the safe lever: it rescales the state by at most about and leaves the denoising problem alone.
- A ramp in training time. Replacing a strong model by a weaker one in one time window at a time showed that the value of model quality grows roughly linearly in , and the size of the non-Gaussian velocity, measured from the band-wise losses, does too. A ramp density improved FID at every step count, by about two points on the convolutional network, and was slightly better than there. On the transformer, however, the ramp was only a head start, which faded to parity with uniform times later in training: the transformer also needs the early times, where it learns a large, spectrally graded linear map.
- Variance reduction that did not help, and the one that did. A target averaged over the batch's posterior, an atom of training draws at with the exact target, and stratified times within a batch were all neutral or harmful on the transformer by mid-training. Measuring gradient norms of single-time batches then showed why early draws mattered so much: draws near carried six to seven times (transformer) and three to four times (convolutional network) the gradient norm of mid-time draws, although their loss was not larger. The spectrum-derived proxy matched the measured profile, and importance sampling with it kept the ramp's objective while restoring the early draws. In our development runs at full length, the transformer improved from 38.15 to 31.86 at four steps and from 16.97 to 7.91 with the adaptive solver, while the convolutional network moved slightly the other way, from 23.17 to 23.45 and from 6.29 to 6.59. The linear starter on that network gave 52.79 and 7.10. We had installed the importance-sampled version earlier, after matched runs of 40k updates, because its gain on one network was large and its cost on the other small; these full-length runs came afterwards.
- Other rejected ideas. A per-image, band-wise rescaling of the spectrum, motivated by the observation that natural images behave like a Gaussian scale mixture, made four-step FID worse. Capping the straightening of the strongest axes would, by emulation, have cost between two and nine FID points at four steps, so the strong axes stay fully straightened. Non-uniform sampler grids were not part of the method, and a check on a full-length model found the uniform grid near the best anyway.
Limitations
- The non-Gaussian part is untouched. The straightening is a linear, time-dependent change of coordinates; it makes the Gaussian part of the flow exact and nothing more. The agent's band-swap diagnostic of the final models places the remaining four-step error in the mid-to-fine bands of principal axes, where few-step samples have too little variation in detail energy between images. Every attempt to resolve those axes earlier in time hurt training.
- The noise proxy is a Gaussian approximation. is computed from the spectrum, not from the network. In development it over-estimated the convolutional network's early gradient noise on one dataset, which we take to be why importance sampling cost that network a little. A tempered variant, with the proxy raised to the power one half, removed that cost in short runs while keeping the transformer's gain, but it was never trained to full length and is not part of the submission. An online estimate of from the per-sample losses the loop exposes is the natural next step.
- Validation in development was uneven. Two of the dataset-network pairs were trained to full length with the final path during development; the other two only to 40k updates, and on one of those importance sampling showed no gain yet. Most comparisons were single runs, and the agent's own estimate is that short-run differences of a few FID points on the transformer were within run-to-run noise.
- The margin at the largest sampling budget is small on one setting. On IN32-UNet the FID with the largest sampling budget, 13.59, is close to the 14.08 of VS-FM [10]; the method's advantage there rests on the two smaller budgets.
- The adaptive solver works harder. The straightened field is stiffer near , where the weakest axes' gain changes fastest, and in the agent's tolerance probe the adaptive solver needed more function evaluations than on the linear path at loose tolerances.
- The coupling freedom is unused. SSF keeps independent pairs. Minibatch couplings act on the crossing of trajectories, a different error from the one SSF removes, and whether the two combine was not tested.
References
- Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu et al. (2022). Flow Matching for Generative Modeling.
- Michael S. Albergo, Eric Vanden-Eijnden (2023). Building Normalizing Flows with Stochastic Interpolants. ICLR.
- Michael S. Albergo, Nicholas M. Boffi, Eric Vanden-Eijnden (2023). Stochastic Interpolants: A Unifying Framework for Flows and Diffusions. JMLR.
- Alexander Tong, Kilian Fatras, Nikolay Malkin et al. (2023). Improving and generalizing flow-based generative models with minibatch optimal transport. TMLR.
- Aram Davtyan, Leello Tadesse Dadi, Volkan Cevher et al. (2025). Faster Inference of Flow-Based Generative Models via Improved Data-Noise Coupling. ICLR.
- Stephen Zhang, Alireza Mousavi-Hosseini, Michal Klein et al. (2025). On Fitting Flow Models with Large Sinkhorn Couplings.
- Lennart Wittke, Vinicius Azevedo (2026). Beyond Random Couplings: Contrastive Noise Alignment in Generative Flows.
- Junyi Lin, Mengyu Li, Jingxuan Hu et al. (2026). Beyond Straightness: Non-Crossing Flow Matching via Quantile AlignTree Coupling.
- Sergio Calvo-Ordonez, Matthieu Meunier, Alvaro Cartea et al. (2025). Weighted Conditional Flow Matching.
- Vitalii Bondar (2026). Velocity Scheduled Flow Matching.
- Patrick Esser, Sumith Kulal, Andreas Blattmann et al. (2024). Scaling Rectified Flow Transformers for High-Resolution Image Synthesis. ICML.
- Airin Akter Tania, Md Raihan Khan (2026). Difficulty-Calibrated Interpolation Paths for Conditional Flow Matching.
- Arsène Claustre, Hugo Negrel, Claire Boyer et al. (2026). Gaussian Flow-Matching Schedules: Implications for Sampling and Training.