Every diffusion model so far has leaned on a U-Net: a convolutional encoder-decoder built specifically for images, with skip connections carrying detail across resolutions. But the model doesn't predict noise because convolutions are special — it predicts noise because that's the training target. What if the backbone were just... a transformer?
Four patches, flattened into a sequence -- exactly like four words. Every row is a query patch attending over every key patch, the same scaled dot-product softmax a text transformer runs, just fed patch content instead of word embeddings.
A Diffusion Transformer (DiT) starts exactly like a Vision Transformer: cut the (noisy) image into patches, flatten the grid into a sequence, and run ordinary self-attention over it. The heatmap above is the same scaled dot-product softmax from the attention chapters — nothing about it knows these tokens came from pixels instead of words.
The one new ingredient is how the model learns which noise level it's looking at. Instead of a per-resolution encoder path, DiT folds the timestep into every patch with a simplified adaptive layer norm (adaLN) — a scale and shift applied identically to every patch, before attention runs:
- — the diffusion timestep this forward pass is conditioned on; is the total number of timesteps.
- — the timestep normalized to : the only input the conditioning below depends on.
- — the per-timestep scale and shift, shared identically across every patch at a given .
- — a patch's raw content value; is that value after adaLN conditioning, the value attention actually sees.
- t=0 is an ordinary, unconditioned ViT block
At , , so and : , exactly the plain patch embedding a normal Vision Transformer would use.
- Rising t stretches and shifts every patch the same way
As grows, and move linearly away from the identity, scaling every patch's content by the same factor and shifting it by the same amount — the timestep never singles out one patch over another.
- Conditioned content flows into ordinary self-attention
Attention then runs on the conditioned values exactly as it would on any transformer's token embeddings — same queries, keys, values, same scaled dot product, same softmax.
Drag the timestep from to . Because the conditioning applies the same scale and shift to every patch, it doesn't reorder which patch p0 attends to most — it just stretches the gap between p0's own (largest) content and everyone else's, so p0's self-attention weight on itself climbs as rises.
Four patches with raw content for , , , :
- Condition each patch at t=2
, so , . Conditioned values:
- Score p0's query against every key
Each patch's full embedding is :
Scoring query against each (dot product, then divide by ):
- , scaled:
- , scaled:
- , scaled:
- , scaled:
Softmax (subtracting the max, , for stability):
- self:
- :
- :
- :
Sum . Normalizing gives weights — p0 attends overwhelmingly to itself, then to , the next closest content value.
- Attention output mixes values by those weights
's attention output is — pulled almost entirely from its own conditioned content, with a small nudge from .
- Self-attention sharpens further as t keeps rising
At : , , , so (versus at ) — the gap between p0's content and the others widens further. Scaled scores against each patch:
- (self):
- :
- :
- :
Running the same softmax gives a self-weight , past — while at it was still , below that threshold. The conditioning needs to stretch the gap a bit further before self-attention all but ignores every other patch.
Drag t up until p0 pays more than 0.95 of its attention to itself.
p0's self-attention weight = 0.880
Nothing about self-attention needed to change to move from words to (noisy) image patches — only the tokenizer changed, from a vocabulary lookup to a fixed patch grid, and the model gained one small timestep-conditioning mechanism to tell every patch which noise level it's denoising. This is the architecture behind Stable Diffusion 3 and Sora: swap the U-Net for a transformer, and the same scaling laws that made text transformers bigger and better start applying to image generation too.