skip to content

Search

← From Noise to Image

Part III — Speed and the Frontier (2022–2026)

Flow Matching and Transformer Backbones

Velocity-field regression, rectified flow, and DiT replacing the U-Net — the SD3/FLUX lineage.

2022–2024 14 min read 5 papers

It is September 2022. Latent diffusion has just shipped in public, class-conditional diffusion models have already been shown to beat GANs on ImageNet, and the field’s sampler research is deep into shaving steps off a Markov chain that was never designed to be short. In the space of four weeks, two papers — written independently, using different notation, arriving at almost the same equation — propose that the chain be discarded altogether: forget the noising process, forget the score, and just teach a network to point along a straight line from noise to data. Three months later a third paper removes the convolutional U-Net that had carried every image diffusion model since 2020 and replaces it with a plain transformer. By March 2024, a fourth paper fuses all of it — straight-line training and a transformer backbone — into the architecture behind Stable Diffusion 3.

Where We Were

By mid-2022, image diffusion had a working recipe and a growing pile of patches on top of it. Denoising diffusion probabilistic models, introduced in June 2020, defined a forward process that corrupts data with Gaussian noise over many steps and a network that learns to reverse it (Diffusion Foundations). The reverse-time SDE and probability-flow ODE view, established in late 2020, had shown that this reverse process could be run as a deterministic ODE solve rather than a stochastic chain, cutting sampling from a thousand steps to a few dozen (Scores, SDEs, and Faster Sampling). Classifier-free guidance, published in July 2022, gave practitioners a knob to trade diversity for fidelity to a text prompt (Guidance). And Stable Diffusion’s public release that August had proved a latent-space U-Net could run on a single consumer GPU.

None of this changed two facts about how these models were built. First, every one of them was still, underneath the ODE reframing, tied to a diffusion process specifically — a forward corruption defined by adding Gaussian noise according to a schedule, with the sampling ODE’s shape inherited from that schedule rather than chosen for convenience. That coupling had a training-time cost too: fitting a diffusion model meant committing to a noise schedule, a variance parameterization, and a loss weighting across timesteps, each of which had accumulated its own ablation literature since 2020 without a principled way to choose among the options other than trial and error. Second, the network doing the work was a convolutional U-Net, adapted from image segmentation architectures, with skip connections between a downsampling and upsampling path and, in the strongest ImageNet models, self-attention layers inserted at a handful of resolutions to give the convolutions some global context. That architecture produced excellent images, but nobody had shown that making a U-Net bigger produced the kind of clean, predictable quality gains that the language-modeling community had already documented for transformers under Kaplan-style scaling laws (Scaling Laws). Diffusion’s sample-quality gains through 2021 and 2022 had come from architecture tweaks, better noise schedules, and guidance — not from a demonstrated compute-scaling curve.

Every patch, none of it questioning the chain or the U-Net Two years of diffusion progress all built on the same noising process and the same convolutional backbone. Grey monospace text is what each result actually changed. 2020-06 DDPM defines the forward-reverse diffusion chain Gaussian noise schedule 2020-11 Score-SDE frames sampling as an ODE solve still a diffusion path 2021-05 ADM guided U-Net beats GANs on ImageNet no scaling curve shown still a convolutional U-Net 2022-07 Classifier-free guidance trades diversity for prompt fidelity still a diffusion schedule 2022-08 Stable Diffusion latent U-Net runs on one consumer GPU two open questions remain the diffusion chain, unquestioned the U-Net, unquestioned the state this chapter's two questions leave open
Two years of real progress, all built on the same noising process and the same convolutional backbone. Neither assumption had yet been tested. PNG ↓

Two separate questions were sitting unaddressed. Did the generative path from noise to data have to be a diffusion process at all, or was diffusion just one convenient way to build some deterministic path — and could a simpler, straighter path be chosen instead? And did the network computing that path have to be a U-Net, or would a transformer, given the same compute, do better?

The Breakthrough

Flow matching (Lipman et al., 2022) answered the first question by stepping outside diffusion entirely. Rather than deriving a generative ODE from a specific noising process and then estimating its score, the paper starts from the ODE itself: pick any smooth “probability path” — a family of distributions ptp_t that interpolates from a simple prior at t=0t=0 to the data distribution at t=1t=1 — and directly regress a neural network onto the velocity field that generates that path. The paper shows this regression can be done with a simple, simulation-free loss, and that the specific choice of an optimal-transport path (a straight-line interpolation between a noise sample and a data sample) trains faster and samples faster than paths inherited from diffusion, while a Gaussian-diffusion-style path is also expressible in the same framework, making flow matching a strict generalization rather than a competitor.

Rectified flow (Liu, Gong & Liu, 2022), submitted four weeks earlier by a separate group, arrived at essentially the same conditional objective from a different direction — transport theory rather than continuous normalizing flows — and added an operational idea flow matching’s original paper does not: a network trained to follow straight-line paths between paired noise and data samples can be used to generate new pairs by simulating its own ODE, and refitting a fresh network to those self-generated pairs produces straighter paths still. The paper calls this iterative refitting reflow. Straighter paths need fewer steps to integrate accurately, so a few rounds of reflow, followed by distillation onto a single Euler step, turn a model that needed dozens of steps into one that needs one. Both papers also share a practical consequence that is easy to miss in the equations: because the target velocity no longer depends on a noise schedule, the loss no longer needs the per-timestep variance and weighting terms diffusion training carries, so a flow-matching implementation has noticeably fewer moving parts to get wrong than a comparable DDPM-style training pipeline.

Scalable diffusion models with transformers (Peebles & Xie, 2022) — DiT — answered the second question, and did so independently of both flow-matching papers, arriving eleven weeks after flow matching. The recipe is architecturally blunt: take a latent-diffusion model’s noised latent, cut it into fixed-size patches the way a Vision Transformer cuts an image into patches, drop the sequence of patch tokens through a stack of standard transformer blocks conditioned on the timestep and class label, then reassemble the output tokens back into a latent. There is no U-Net, no downsampling path, no skip connection — the spatial resolution of the token grid is fixed by the patch size and never changes inside the network. Trained on the DDPM objective exactly as before, only the backbone changes. The result is a direct, if unglamorous, empirical claim: DiT-XL/2 reaches a state-of-the-art FID of 2.27 on class-conditional ImageNet at 256×256, and — the finding the paper is actually built around — models with more Gflops, whether from more transformer depth and width or from smaller patches producing more tokens, consistently produce lower FID. Diffusion modeling had acquired the scaling curve the U-Net era never quite delivered.

No downsampling path, no skip connections, just tokens and attention The token grid's resolution is fixed by the patch size and never changes inside the network. Grey monospace text names the DiT paper's own configuration. Noised latent from the diffusion schedule latent-diffusion input Patchify into tokens Vision Transformer style smaller patch, more tokens Transformer blocks timestep and class conditioned DiT-XL/2, FID 2.27 Unpatchify tokens back into a grid fixed spatial resolution Predicted noise or velocity DDPM objective input reshaping, no learned weights the only part more Gflops improves output
No downsampling path and no skip connections; the token grid's resolution is fixed by the patch size for the whole forward pass. PNG ↓

Scaling rectified flow transformers for high-resolution image synthesis (Esser et al., 2024) — the Stable Diffusion 3 paper — is where these two independent lines meet. SD3 trains with a rectified-flow-style objective, improved with noise-sampling schedules biased toward the perceptually important middle of the trajectory, and runs it on a transformer backbone descended from DiT’s patchify-and-attend design, called MM-DiT. MM-DiT’s specific contribution is to give image and text tokens separate weight matrices for their own modality while still attending jointly: the two token sequences are concatenated before self-attention, so a single attention operation (the transformer’s self-attention mechanism, owned by Chapter 5 of Language Models) mixes information across both, while each modality keeps its own linear projections into that shared attention, letting image and text representations exchange information without forcing one modality’s features through weights tuned for the other. Esser et al. trained a family of these models from 450M to 8B parameters and reported the validation loss decreasing smoothly with both size and training compute, with no sign of saturation at the largest scale studied — the DiT scaling result, reproduced at production scale on a text-to-image system. Five months later, Black Forest Labs — founded by several of the SD3 paper’s own authors — released FLUX.1, a family of openly available rectified-flow transformer models scaled to 12B parameters, adding rotary position embeddings and parallel attention layers for hardware efficiency (Black Forest Labs, 2024). FLUX.1 shipped in three tiers with different licenses rather than one model — [pro] served only through Black Forest Labs’ own API, [dev] open-weighted for non-commercial use, and [schnell] a guidance-distilled, Apache-licensed variant built for few-step, low-latency generation — which meant the same architectural lineage reached hobbyists, startups building products, and Black Forest Labs’ own paid API simultaneously, on different commercial terms.

The Mathematics

Flow matching’s starting point is a marginal vector field ut(x)u_t(x) that generates the probability path ptp_t — the field a network would need to learn to reproduce that path exactly. Directly regressing onto it is intractable, because ut(x)u_t(x) has to be marginalized over the entire data distribution. The paper’s central result is that this problem can be sidestepped:

LCFM(θ)=Et∼U[0,1],  x1∼q(x1),  x0∼p0∥vθ(xt,t)−(x1−x0)∥2,xt=(1−t) x0+t x1\mathcal{L}_{\mathrm{CFM}}(\theta) = \mathbb{E}_{t \sim U[0,1],\; x_1 \sim q(x_1),\; x_0 \sim p_0}\left\| v_\theta(x_t, t) - (x_1 - x_0) \right\|^2, \qquad x_t = (1-t)\,x_0 + t\,x_1
SymbolMeaning
ttposition along the path, from 00 (noise) to 11 (data)
x0x_0a sample drawn from the prior distribution p0p_0
x1x_1a sample drawn from the data distribution qq
xtx_tthe linear interpolation between x0x_0 and x1x_1 at time tt
vθv_\thetathe network’s predicted velocity at (xt,t)(x_t, t)
ut(x)u_t(x)the true marginal velocity field the network approximates

Rectified flow writes the same linear-interpolation objective with its own notation and treats it as an ODE to be solved at sample time:

Zt=t Z1+(1−t) Z0,dZtdt=v(Zt,t)Z_t = t\,Z_1 + (1-t)\,Z_0, \qquad \frac{dZ_t}{dt} = v(Z_t, t)
SymbolMeaning
ttposition along the path, from 00 (noise) to 11 (data)
Z0Z_0a sample drawn from the source, noise distribution
Z1Z_1a sample drawn from the target, data distribution
ZtZ_tthe linear interpolation between Z0Z_0 and Z1Z_1, and the ODE’s state at time tt
vvthe learned velocity field driving the ODE

A single round of this training does not make the learned field’s integrated trajectories perfectly straight, because the network averages over many crossing pairs. Rectified flow’s fix is to refit on self-generated data:

v(k+1)=arg⁡min⁡v∫01E[∥(Z^1(k)−Z0)−v ⁣(Zt(k),t)∥2]dt,Z^1(k)=Z0+∫01v(k)(Zt(k),t) dtv^{(k+1)} = \arg\min_{v} \int_0^1 \mathbb{E}\left[\left\| \left(\hat Z_1^{(k)} - Z_0\right) - v\!\left(Z_t^{(k)}, t\right) \right\|^2\right] dt, \qquad \hat Z_1^{(k)} = Z_0 + \int_0^1 v^{(k)}(Z_t^{(k)}, t)\, dt
SymbolMeaning
kkthe reflow round index
v(k)v^{(k)}the velocity field learned in round kk
Z0Z_0a noise sample drawn from the source distribution
Z^1(k)\hat Z_1^{(k)}the endpoint reached by integrating v(k)v^{(k)}‘s ODE from Z0Z_0 to t=1t=1
Zt(k)Z_t^{(k)}the linear interpolation between Z0Z_0 and Z^1(k)\hat Z_1^{(k)} at time tt
v(k+1)v^{(k+1)}the next round’s velocity field, fit to reproduce that straight line

The reflow-to-distillation route to single-step sampling sits alongside the consistency-model and adversarial-distillation techniques covered in Few-Step Generation; flow matching’s contribution is a training objective that makes the underlying trajectory straight before any distillation step is applied, rather than distilling a curved one.

What It Enabled

The backbone and objective shift did not replace diffusion’s conceptual apparatus so much as generalize it, and the two changes — the training objective and the network architecture — turned out to be independent and compatible, which is why SD3 and FLUX.1 could combine both at once.

EraBackboneTraining objectiveTypical sampling stepsFlagship models
2020–2022Convolutional U-NetDenoising score matching (DDPM loss) on a fixed diffusion schedule20–1,000ADM, Stable Diffusion 1.x
2022–2024Transformer (DiT / MM-DiT)Conditional flow matching / rectified flow regression on a straight-line path1–50DiT, SD3, FLUX.1
Model or resultConfigurationReported resultSource
DiT-XL/2Transformer backbone, class-conditional ImageNet 256×256FID 2.27, state of the art at publicationPeebles & Xie, 2022
Rectified flow, 1-RFFully solved with an adaptive RK45 solverFID 2.58 on CIFAR-10Liu, Gong & Liu, 2022
Rectified flow, 2-RF + distillationSingle Euler step (1 network call)FID 4.85 on CIFAR-10Liu, Gong & Liu, 2022
SD3 / MM-DiT family450M to 8B parametersValidation loss decreases smoothly with scale, no saturation observedEsser et al., 2024
FLUX.1Rectified-flow transformer, RoPE, parallel attention12B parameters, three tiers: pro (API-only), dev and schnell (open weights)Black Forest Labs, 2024
Two independent questions, answered separately, then fused A straight-line training objective and a transformer backbone were compatible from the start; SD3 is where they meet. Grey monospace text is the month and the finding each result added. Flow matching 2022-10, any straight path Lipman, Chen, Ben-Hamu, Nickel, Le Rectified flow 2022-09, reflow to straighten Liu, Gong, Liu DiT transformer Peebles and Xie, 2022-12 Straight-line objective the shared regression target no noise schedule to tune SD3, MM-DiT 2024-03, both fused 450M to 8B, no saturation Sora spacetime patches patchify-and-attend on video video-generation chapter FLUX.1 2024-08, open 12B, three tiers the training objective, question one the network backbone, question two both answers combined at production scale
The training objective and the network backbone were solved independently and turned out to be compatible, which is why SD3 could combine both at once. PNG ↓

The transformer backbone travels beyond still images: Sora’s spacetime-patch tokenization applies the same patchify-and-attend pattern to video, an application covered in Sora and Spacetime Patches. Within image generation, the flow-matching-plus-transformer combination is the substrate that later frontier systems build on, discussed in The Current Frontier.

The step-count drop compounds with the architecture change rather than substituting for it. A DDPM-era U-Net serving fifty sequential denoising calls and a distilled rectified-flow transformer serving one call are not just different models — they sit on different points of a cost curve that a product team has to price against, because every step is a full forward pass through the network regardless of how large that network is. Reducing steps from fifty to one is roughly a fifty-fold reduction in the compute spent per image, before accounting for any difference in per-step cost between a U-Net and a transformer of comparable quality. That arithmetic is what turned flow matching from an architecture-research result into a deployment decision.

Key Papers

PaperAuthorsYearLinkWhy it matters
Flow Matching for Generative ModelingLipman, Chen, Ben-Hamu, Nickel & Le2022arXiv:2210.02747Generalizes diffusion’s ODE to any probability path, trained with a simulation-free regression loss
Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified FlowLiu, Gong & Liu2022arXiv:2209.03003Independently derives the same linear-path objective and adds reflow, the iterative straightening procedure behind one-step sampling
Scalable Diffusion Models with TransformersPeebles & Xie2022arXiv:2212.09748Replaces the U-Net with a plain transformer and shows compute scales predictably with FID
Scaling Rectified Flow Transformers for High-Resolution Image SynthesisEsser et al.2024arXiv:2403.03206Combines rectified flow and a DiT-descended MM-DiT backbone at production scale, up to 8B parameters
Announcing Black Forest Labs and FLUX.1Black Forest Labs2024bfl.aiOpen-weight 12B rectified-flow transformer that put the SD3 lineage into wide public use

Papers referenced