Chapter 04Down the Rabbit Hole: What Actually Changed When Diffusion Dropped the U-Net
I kept hearing one sentence: "diffusion models switched from U-Nets to transformers because transformers scale better." SD 1.5 is a U-Net. SD3, Flux, Sora and every open video model from 2024 on are transformers. Clean story.
Then I tried to check it. The transformer did win, but a lot of what it gets credit for came from elsewhere, and the biggest recent quality jumps barely touched the network.
The cleaner that runs fifty times#
A generator starts from static and cleans it up over roughly 4 to 50 rounds. Each round, the same network sees the noisy picture, the noise level t and your prompt. That network is the backbone, and nearly all the FLOPs, parameters and quality differences live in it. A 12B backbone at 50 steps with classifier-free guidance is 100 forward passes of 12B parameters per image. Backbone efficiency is the product's cost.
The job is odd too. One set of weights serves every noise level. At high noise it must invent global layout (huge receptive field). At low noise it restores fur and lettering (precise local detail).
The funnel with pneumatic tubes#
The U-Net was the first good answer. Features flow down a funnel, halving resolution and doubling channels. At every level a skip connection shoots high-resolution features straight across to the way up, so fine detail never has to survive the bottleneck. Attention sits only on the cheap low-resolution floors.
x_t 4x64x64 ─▶ conv_in ─▶ 320x64x64
DOWN 64² Res,Res + Self+CrossAttn (77 CLIP tok) 320ch ──skip──┐
32² same, 640ch ──skip──┤
16² same, 1280ch ──skip──┤
8² Res only, 1280ch ──skip──┤
MID 8² Res + Attn + Res │
UP 8² ▶ 16² ▶ 32² ▶ 64² concat(skip) at every level ◀────┘
conv_out ─▶ predicted noise 4x64x64This is what let diffusion beat GANs. ADM's 2021 U-Net changes (BigGAN-style residual blocks, attention at more resolutions, timestep as scale-and-shift) took ImageNet-128 FID from 15.33 to about 12. Changing only how t gets in, from added embedding to scale-and-shift, moved FID from 15.08 to 13.06.
The problem wasn't quality. A U-Net has many coupled knobs (channel multipliers, blocks per level, which resolutions get attention), and in 2022 there was no simple rule for "make it 10x bigger". LLMs had one.
The flat room of equals#
DiT (Peebles and Xie, 2022) threw the funnel away. Cut the latent into p-by-p patches, make each a token, and run N identical transformer layers. Resolution never changes.
How the timestep gets in is the interesting part. adaLN-Zero: one small linear layer reads the timestep and class embedding and emits six vectors per block, a shift, scale and gate for attention and the same three for the MLP.
(b1, g1, a1, b2, g2, a2) = W * SiLU(c) + b # W = 0, b = 0 at init
x <- x + a1 * Attn( (1 + g1) * LN(x) + b1 )
x <- x + a2 * MLP ( (1 + g2) * LN(x) + b2 )The scale is 1 + g, so it's the identity at init, and the gate a starts at zero, so every block starts as a pass-through. The whole 28-layer network begins as "output = input projection" and gradients flow cleanly from step one.
Same model, 400K steps, only the conditioning changes:
| Variant | FID |
|---|---|
| timestep as an extra token | 35.24 |
| cross-attention | 26.14 |
| adaLN | 25.21 |
| adaLN-Zero | 19.47 |
Nearly a 2x gap from how one scalar enters. (U-ViT found the opposite ranking in its own setup, with long skips, so this isn't universal.)
SD3's MMDiT then put text tokens in the same room. Text and image keep their own projection weights but share one attention softmax. In a U-Net text is read-only (image queries over frozen CLIP keys); in MMDiT text tokens update every block. Flux runs 19 double-stream blocks, then merges into 38 single-stream blocks.
The bill is paid in tokens#
This explains the architecture debate in one line. For T tokens of width d with a 4x MLP, one layer costs roughly:
C(T, d) = 4*T*d^2 (Q, K, V, output projections)
+ 8*T*d^2 (MLP)
+ 2*T^2*d (QK^T and AV)
= 12*T*d^2 + 2*T^2*dLinear layers scale with tokens times width squared, attention with tokens squared times width. Their ratio is T / 6d.
I checked this against DiT's reported numbers with a small script. All twelve configs land within 0.2 to 5 percent; DiT-XL/2 comes out at 118.38 against the paper's 118.64. So the paper's "Gflops" behave like forward multiply-accumulates (my inference from the arithmetic, not something the paper says).
Holding DiT-XL's weights fixed and changing only patch size:
tokens: 16 ▏ compute: 7.2 GMACs ▏
16 tokens, 7.2 GMACs.
That's why DiT found that Gflops, not parameters, predict FID.

Figure 8 from Peebles and Xie, "Scalable Diffusion Models with Transformers" (ICCV 2023), arXiv:2212.09748, licensed CC BY 4.0. Cropped and recompressed.
S/2 and B/4 sit near the middle: different sizes, similar Gflops, similar FID. That one-knob law made labs switch. Depth, width and patch size collapse onto one axis that predicts quality with a correlation of -0.93.
The same arithmetic shows the wall. At Flux's width of 3072 the crossover is about 18K tokens.
| Workload | Tokens | Attention share |
|---|---|---|
| 1024x1024 image (Flux) | 4,096 image + 512 text | about 20% per layer |
| 720p video, 129 frames | roughly 119K | about 87% |
HunyuanVideo spends 800 of its 945 seconds on a 5-second 720p clip inside attention. Images are a linear-layer problem. Video is an attention problem.
What the one-liner hides#
DiT-XL/2 costs 118.6 Gflops. ADM, the U-Net it was compared to, costs 1120. But ADM runs on pixels and DiT on a VAE latent 8x smaller per side. A latent U-Net, LDM-4, costs 103.6. Much of the gap was latent versus pixel.
Later U-Nets kept up: EDM2 stayed a U-Net, made every layer magnitude-preserving, and took ImageNet-512 FID from 2.41 to 1.81 at equal complexity. In SD3's own comparison, U-ViT (a transformer with the U-Net's long skips put back) beat plain DiT.
Transformers also rebuilt the U-Net's tricks:
- U-ViT and Hunyuan-DiT have long skips.
- SANA has 3x3 convolutions in its MLP and no positional encoding.
- U-DiT and HDiT downsample tokens.
- Patchify is itself a strided convolution.
"DiTs have no locality bias" isn't true of any production model. The better sentence: transformers won because they gave a clean scaling knob and let labs reuse the LLM stack (FlashAttention, FSDP, fp8, RoPE, MoE), and the latent space did a lot of the lifting.
Where it breaks#
The most instructive failure is duplicated subjects: ask for an image well above training resolution and you get two foxes, or a face repeated across the canvas. Both families do it, for different reasons. In a U-Net the receptive field is too small at the new size, so regions each "think" they're the center. In a DiT, position embeddings get extrapolated past anything seen in training.
In both, a wrong timestep schedule makes it worse. At higher resolution neighbouring pixels are redundant, so the same noise level destroys less information, and the high-noise regime that sets global layout gets under-trained. SD3 shifts the schedule:
t_m = s * t_n / (1 + (s - 1) * t_n), s = sqrt(m / n)With s = 3, a timestep of 0.5 becomes 0.75. RAE uses the same form with the latent's dimension in place of pixel count, and that shift alone moved its FID from 23.1 to 4.81. When it's wrong the backbone takes the blame, but the schedule is the cause.
Training instability
Without RMSNorm on queries and keys, attention logits grow during high-resolution training, the softmax saturates to nearly one-hot, and bf16 training diverges. SD3 hit this in a 2B model, and its authors called the fix "not a universal recipe".
The gains moved outside the block#
On ImageNet-256, FID went from 2.27 (DiT-XL/2, 2022) to about 1.1 (REPA-E and RAE, 2025) with roughly the same transformer. Every lever was outside the block.
None is a new block. They're about what space you denoise in and what you ask the network to output.
The open question#
What should the latent space be? Three camps, conflicting evidence:
- Semantic (RAE, Scale-RAE): semantic latents win at scale.
- Smooth (EQ-VAE, "diffusability"): spectral smoothness matters, semantics is incidental.
- None (JiT): with the right target you may not need a latent, though pixel-space's best (1.46) trails latent methods (about 1.03 to 1.13).
It's hard to settle because every comparison changes encoder, decoder and denoiser at once. Nobody has run the controlled study. A related thread: do the U-Net's biases (locality, multiscale) still matter at 10B+ parameters with matched compute? SiD2 says big models don't need skips. PixelU beat JiT at a third of the compute by putting the U-shape back. My guess is it depends on data and compute regime, but nobody has tested past about 8B.
Next level down is probably classifier-free guidance and its variants, since guidance choices alone move these FID tables by 0.1 to 0.3, the size of most architecture claims.
Sources#
- Peebles and Xie, Scalable Diffusion Models with Transformers (DiT), ICCV 2023
- Dhariwal and Nichol, Diffusion Models Beat GANs (ADM), 2021
- Rombach et al., Latent Diffusion Models, 2022
- Esser et al., Scaling Rectified Flow Transformers (SD3 / MMDiT), 2024
- Bao et al., U-ViT
- Karras et al., EDM2, CVPR 2024
- Black Forest Labs, FLUX reference code
- Stable Diffusion v1 inference config
- REPA, ICLR 2025, and REPA-E
- Zheng et al., Diffusion Transformers with Representation Autoencoders (RAE), ICLR 2026
- Li and He, Back to Basics: Let Denoising Generative Models Denoise (JiT), CVPR 2026
- Hoogeboom et al., simple diffusion and SiD2
- ScaleCrafter and FiT, on off-resolution duplication
- Sliding Tile Attention (STA), for the HunyuanVideo attention numbers
- SANA