Diffusion Transformer Block

A transformer-style block that updates noisy image or latent patch tokens during diffusion denoising, steered by timestep and optional conditioning signals.

A Diffusion Transformer block is one transformer-style layer inside a Diffusion Transformer denoiser. It reads noisy image or latent patch tokens, mixes them with self-attention, refines them with a feed-forward path, and uses timestep and optional conditioning signals to steer each update toward a cleaner sample.

At a glance

Released

December 2022

Authors

William Peebles, Saining Xie

Optimizes

  • Global Patch Interaction
  • Timestep Conditioned Denoising
  • Latent Patch Modeling

What It Is

A Diffusion Transformer block is a single transformer-style layer used inside a Diffusion Transformer denoiser. The block treats noisy image patches or latent patches as token-like states. Each block reads those patch states, lets them interact through self-attention, refines them through a feed-forward path, and returns updated states that the surrounding denoiser can use on the next diffusion step.

Why It Exists

Convolutional denoisers mix information through local neighborhoods, which can make long-range patch relationships expensive to model. A Diffusion Transformer block uses self-attention so any patch can directly influence any other patch in the same layer. That global mixing helps a denoiser coordinate structure, layout, and fine detail across the whole image or latent field without stacking very deep local receptive fields.

How It Works

Noisy patch or latent tokens enter the block together with a timestep signal that says how noisy the sample still is. The timestep is embedded and used to modulate normalization or scaling inside the block so the same weights can behave differently at early versus late denoising steps. Optional class or text conditioning can enter through a separate embedding that is added or fused into the same modulation path. Self-attention then mixes information across all patch tokens, and a feed-forward network refines each token state. Residual connections carry the previous token values forward, and the block outputs updated patch states for the denoising head or the next repeated block in the stack.
Diffusion Transformer block compute flow
Patch token computation path
Timestep and conditioning steering
Residual connection
Conditioning input
Conditioning role note

Math Or Compute Schema

A generic transformer block updates token states from the previous layer output alone. A Diffusion Transformer block keeps that attention and feed-forward shape but injects timestep and optional conditioning into the modulation path before each sublayer runs.
Generic transformer block update
x′=x+FFN(Attn(Norm(x)))x' = x + \mathrm{FFN}(\mathrm{Attn}(\mathrm{Norm}(x)))
xx
Input token states for the block.
x′x'
Output token states after attention, feed-forward, and residuals.
Norm\mathrm{Norm}
Normalization applied before each sublayer.
Attn\mathrm{Attn}
Self-attention sublayer over tokens.
FFN\mathrm{FFN}
Feed-forward sublayer applied per token.
Diffusion Transformer block update with modulation
x←x+Attn(Mod(Norm(x),ct,c));x←x+FFN(Mod(Norm(x),ct,c))x \leftarrow x + \mathrm{Attn}\big(\mathrm{Mod}(\mathrm{Norm}(x), c_t, c)\big);\quad x \leftarrow x + \mathrm{FFN}\big(\mathrm{Mod}(\mathrm{Norm}(x), c_t, c)\big)
xx
Noisy patch or latent token states at the current diffusion step.
ctc_t
Timestep embedding for the current noise level.
cc
Optional class, text, or other conditioning embedding.
Norm\mathrm{Norm}
Normalization applied before each sublayer.
Mod\mathrm{Mod}
Modulation path that combines normalization with timestep and conditioning.
Attn\mathrm{Attn}
Self-attention sublayer over patch tokens.
FFN\mathrm{FFN}
Feed-forward sublayer applied after attention in the full block.

Compared To Nearby Modules

A generic transformer block updates token states for language, vision, or other tasks without a diffusion timestep. A Diffusion Transformer block is the denoising-specific variant: it runs on noisy patch tokens and uses timestep and optional conditioning to steer each update. A complete diffusion model stacks many such blocks, adds patch embedding, timestep embedding, and a denoising output head, and repeats the stack across iterative denoising steps. The diffusion training objective is separate: it defines how the full model learns from noisy targets, while this page focuses on what one block does inside that denoiser during inference or training forward passes.
Comparison dimensionGeneric transformer blockDiffusion Transformer blockComplete diffusion denoiser
What enters the blockOrdinary token or patch embeddings from the previous layerNoisy image or latent patch tokens at the current diffusion stepPatch embedding, timestep embedding, and optional conditioning for the whole stack
Timestep and conditioning roleNo diffusion timestep; task context comes from embeddings or cross-attention elsewhereTimestep embedding modulates normalization or scaling; optional class or text conditioning steers the same pathGlobal diffusion state and conditioning shared across all blocks and denoising iterations
What the block output supportsUpdated hidden states for the next layer or task headUpdated patch states for the denoising head or the next repeated blockNoise or velocity prediction used by the sampler to produce a cleaner sample over many steps

Example Architectures

Diffusion Transformer image models stack many identical or near-identical blocks over latent or pixel patches. Class-conditional variants add a label embedding to the modulation path, and later text-to-image systems reuse the same block pattern with text conditioning instead of class labels.

Limitations And Tradeoffs

Self-attention over many patches scales quadratically with patch count, so very high-resolution fields can become expensive in memory and compute. Quality also depends on how patches or latent grids represent the image: coarse patches can miss fine detail, while very fine patches multiply token count. The block itself does not choose the denoising schedule, noise parameterization, or sampler; those surrounding choices still strongly affect output quality and stability.

Why It Still Matters

Diffusion Transformer blocks matter because they show how standard transformer computation is repurposed for iterative denoising. Once the block pattern is clear, readers can compare latent versus pixel denoisers, class versus text conditioning, and later efficiency variants without relearning the whole diffusion stack from scratch.

Tags

References

  1. Peebles, William, and Saining Xie. "Scalable Diffusion Models with Transformers." arXiv, 2022, https://arxiv.org/abs/2212.09748.
  2. Ho, Jonathan, Ajay Jain, and Pieter Abbeel. "Denoising Diffusion Probabilistic Models." arXiv, 2020, https://arxiv.org/abs/2006.11239.