Sora's Diffusion Transformer
Sora's Diffusion Transformer (DiT) generates video by replacing convolutional U-Nets with a Transformer operating directly on spacetime patches in a compressed latent space. Adaptive layer normalization (adaLN) conditions each block on the diffusion timestep and text prompt embeddings so the model iteratively denoises random Gaussian noise into clean video latents before decoding to pixels.
Sora Diffusion Transformer (DiT): Step-by-Step
Objective: Generate video conditioned on a text prompt and diffusion timestep .
[1] Inputs
- Original video (training target)
- Text prompt:
"sora is sky" - Diffusion timestep: (noise level index)
[2] Spacetime Patching
- Divide the video (or compressed video latent) into spacetime patches (e.g., spatial patches across time).
- Spacetime patches unify videos of varying resolutions, durations, and aspect ratios into a flat sequence of visual tokens that a Transformer can process natively.
[3] Visual Encoder (Latent Compression)
- Encode raw pixels/patches into a lower-dimensional latent space (in practice via a pretrained causal 3D VAE; in the toy diagram, via learned linear weights, biases, and ReLU reducing dimensions).
- Working in compressed latent space drastically reduces sequence length and compute cost.
[4] Forward Noise Addition (Training)
- Corrupt the clean latent into a noisy latent according to the noise schedule at timestep :
- Noise schedule convention: corresponds to the clean latent, and larger corresponds to MORE noise (approaching pure isotropic Gaussian noise as ).
[5-7] Conditional Control via Adaptive Layer Norm (adaLN)
- Encode both the text prompt and the diffusion timestep into conditioning vectors.
- Project those conditioning embeddings into per-channel scale () and shift () parameters (and residual gate parameters in
adaLN-Zero). - Modulate the normalized latent token representations so every Transformer block knows both what to generate and how noisy the current input is.
[8-10] Transformer Block Processing
- Self-Attention: Compute pairwise attention scores across spacetime tokens to capture spatial and temporal dependencies.
- Weighted Value Aggregation: Multiply the softmax attention weights by the Value vectors () to aggregate context across patches.
- Feed-Forward Network (FFN): Transform each token independently to output the predicted noise (or velocity , depending on parameterization).
[11] Training Objective
- Compute the MSE loss between the predicted noise and the true noise added in step [4], then backpropagate to update the Diffusion Transformer weights (red borders in the diagram).
- The pretrained visual encoder and decoder weights (blue borders) are kept frozen during DiT training.
[12] Iterative Denoising (Generation)
- Starting from pure Gaussian noise at inference, run reverse sampling steps from down to .
- At each step , the DiT predicts the noise component in , and the diffusion sampler (e.g., DDPM/DDIM) uses schedule coefficients to compute a slightly less-noisy latent —repeating iteratively in latent space until is reached.
[13] Visual Decoder
- Only once at , pass the final denoised latent representation through the frozen visual decoder to reconstruct pixel patches.
[14] Reassemble Patches into Video
- Unpatchify the decoded spatial-temporal patches into the final output video frames.
Diagram

