Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Scalable Diffusion Models with Transformers

  • Problem Diffusion models for images still use a convolutional U-Net backbone, and it is unclear whether a plain transformer can replace it without losing sample quality.
  • Method Trains latent diffusion models whose denoiser is a transformer over patchified VAE latents, varies the conditioning block, patch size and model size, and compares FID against Gflops.
  • Results DiT-XL/2 with classifier-free guidance at cfg=1.50 reached FID-50K 2.27 on ImageNet 256×256, against 3.60 for LDM-4-G at the same setting.

Figure 4: Input specifications for DiT. Given patch size p× p,
a spatial representation (the noised latent from the V AE) of shape
I× I× C is “patchified” into a…

Figure 4 . Input specifications for DiT. Given patch size p× p, a spatial representation (the noised latent from the V AE) of shape I× I× C is “patchified” into a sequence of length T = ( I/p)2 with hidden dimension d. A smaller patch size p results in a longer sequence length and thus more Gflops.

Original paper · CC BY 4.0 · William Peebles, Saining Xie · Scalable Diffusion Models with Transformers · Original paper figure · Extracted the figure area from page 4 of the original PDF.

Why the U-Net backbone is questioned

Transformers have spread through most of machine learning, yet image diffusion models still use a convolutional U-Net as their backbone. That U-Net came from PixelCNN++ and is built mostly from ResNet blocks, with spatial self-attention blocks added at lower resolutions. The authors argue that the U-Net inductive bias is not essential to diffusion performance, so a standard transformer could take its place.

The study asks two questions: whether a transformer can serve as the backbone of latent diffusion without losing sample quality, and how the forward-pass complexity, measured in Gflops, relates to FID. Parameter counts are treated as weak proxies for image model complexity because they ignore image resolution, so Gflops are used as the complexity measure.

Latent diffusion with a transformer denoiser

The forward process adds Gaussian noise to a data sample \(x_0\) as \(q(x_t|x_0)=\mathcal{N}(x_t;\sqrt{\bar{\alpha}_t}x_0,(1-\bar{\alpha}_t)I)\), where the \(\bar{\alpha}_t\) are fixed hyperparameters. The network \(\epsilon_\theta\) is trained with the simple mean-squared error \(L_{simple}(\theta)=\|\epsilon_\theta(x_t)-\epsilon_t\|_2^2\) between its predicted noise and the sampled Gaussian noise.

The diffusion model does not run on pixels: a frozen encoder \(E\) maps each image to a latent \(z=E(x)\), the diffusion model is trained on these latents, and the learned decoder \(D\) maps a sampled latent back to an image.

For 256×256 images the latent has shape 32×32×4, and patchify splits it into patches of size p×p, each linearly embedded into a token of dimension d. The number of tokens is T=(I/p)^2, so halving p quadruples T and at least quadruples the transformer Gflops, while parameter counts change little. Standard sine-cosine positional embeddings are added to these tokens before the blocks.

The blocks follow the Vision Transformer design that DiT adopts, and conditioning on the timestep and class label enters through one of four block variants. After the last block, a final layer norm and a linear decoder map each token to a p×p×2C output, which is rearranged into the predicted noise and a diagonal covariance with the spatial shape of the input.

Model size is set by the number of blocks N, the hidden size d and the attention heads, giving the S, B, L and XL configurations that span 0.3 to 118.6 Gflops.

How timestep and class enter the block

In-context conditioning appends the timestep and class embeddings as two extra tokens and removes them after the final block, which adds negligible Gflops. Cross-attention places the two embeddings in a separate length-two sequence and adds a multi-head cross-attention layer after self-attention, which adds roughly a 15% Gflops overhead.

Adaptive layer norm regresses the scale and shift parameters from the sum of the timestep and class embeddings rather than learning them directly. Of the three designs, adaptive layer norm adds the fewest Gflops, although it applies the same function to every token. adaLN-Zero also regresses a dimension-wise scale \(\alpha\) applied before each residual connection, and its MLP is initialized to output the zero vector, so the whole block starts as the identity function.

The idea comes from ResNet and U-Net practice of zero-initializing the last layer of each residual branch.

Among four DiT-XL/2 models trained for 400K iterations, adaLN-Zero gives lower FID than cross-attention and in-context conditioning at every stage of training. Because adaLN-Zero was the best of these variants, all later models use adaLN-Zero blocks.

Training and evaluation setup

All DiT models are class-conditional latent models trained on ImageNet at 256×256 and 512×512, using AdamW. The learning rate is constant at 1× 10−4, with no weight decay, a batch size of 256 and horizontal flips as the only augmentation. The authors did not need learning rate warmup or extra regularization, and they report no loss spikes.

Most training hyperparameters are taken from ADM, and learning rates, decay or warm-up schedules and Adam betas were not tuned.

An exponential moving average of the DiT weights is kept with a decay of 0.9999, and all reported results use the averaged model. The VAE comes from Stable Diffusion and has a downsample factor of 8, so a 256×256×3 image becomes a 32×32×4 latent.

FID-50K is computed with 250 DDPM sampling steps using ADM's TensorFlow evaluation suite, and classifier-free guidance is not used unless stated. Inception Score, sFID and Precision/Recall are reported as secondary metrics.

Scaling Gflops against FID

The authors trained 12 DiT models over the S, B, L and XL configurations and the patch sizes 8, 4 and 2, all evaluated at 400K training steps. Making the model larger and decreasing the patch size both gave considerably better FID across training. Within a fixed model size, the curves over training show FID improving at every stage as the patch size falls.

When model size is held fixed and the patch size is decreased, total parameters barely change and can even fall slightly, yet the Gflops rise. The authors read this as evidence that Gflops, not parameter count, drive the gains, since configurations with similar total Gflops reach similar FID, as with DiT-S/2 and DiT-B/4. Across the 12 models, the correlation between transformer Gflops and FID-50K is -0.93.

When FID is plotted against training compute, estimated as model Gflops times batch size times training steps times 3, small models trained longer become less compute-efficient than larger models trained for fewer steps. Models that differ only in patch size also separate in this plot, and XL/4 is outperformed by XL/2 after roughly 1010 Gflops.

Samples from all 12 models use the same starting noise and class label, and the visual detail improves as Gflops grow.

ImageNet comparison with prior models

At 256×256 with classifier-free guidance at cfg=1.50, DiT-XL/2 reaches an FID-50K of 2.27, compared with 3.60 for LDM-4-G at the same setting. In that table, 2.27 is below every listed entry, including StyleGAN-XL at 2.30 and ADM-G, ADM-U at 3.94. Without guidance, DiT-XL/2 reaches an FID-50K of 9.62 at 256×256 and 12.03 at 512×512. The DiT-XL/2 model uses 118.6 Gflops, against 103.6 Gflops for LDM-4 and 1120 Gflops for the pixel-space ADM.

Trained for only 2.35M steps, similar to ADM, DiT-XL/2 reaches an FID of 2.55 and still beats the prior diffusion models in the comparison. DiT-XL/2 also has higher recall than LDM-4 and LDM-8 at all tested classifier-free guidance scales.

The 512×512 model was trained for 3M iterations with patch size 2, which gives 1024 tokens from the 64×64×4 latent and 524.6 Gflops. With classifier-free guidance at cfg=1.50 it reaches an FID-50K of 3.04, below the 3.85 listed for ADM-G, ADM-U and the 3.85 the text attributes to ADM. StyleGAN-XL has an FID of 2.41 in the same 512×512 table, which is lower than 3.04, so the claim of the lowest FID among prior generative models does not hold on this table.

The 512×512 sample rows give the sFID, Inception Score, Precision and Recall alongside FID.

Sampling steps against model size

Diffusion models can use more compute after training by taking more sampling steps, so the authors computed FID-10K for each of the 12 DiT models with 16, 32, 64, 128, 256 and 1000 steps. L/2 with 1000 steps uses 80.7 Tflops per image, while XL/2 with 128 steps uses 15.2 Tflops, about 5× less. Even so, XL/2 gets the better FID-10K, 23.7 against 25.9 for L/2.

The authors conclude that scaling sampling compute cannot make up for a lack of model compute, and this rests on the figure's comparison of small and large models across step counts.

Limits of the evidence

The reported experiments cover only class-conditional ImageNet at 256×256 and 512×512, in the VAE latent space. Hyperparameters were not tuned for DiT and were largely inherited from ADM, so the reported settings are not searched optima.

The 12-model sweep stops at 400K steps, and the longest training runs are DiT-XL/2 at 7M steps for 256×256 and 3M iterations for 512×512. The authors leave larger models and token counts to future work.

FID is sensitive to small implementation details, so the comparisons use ADM's evaluation suite and 250 DDPM sampling steps. The -0.93 correlation is computed across 12 models that share one training recipe.

Paper info

Authors
William Peebles, Saining Xie
Venue
arXiv · Preprint
First published
2022-12-19
Added
2026-10-20
Updated
2023-3-2
Version
v2
arXiv
2212.09748
Category
cs.CV · cs.LG
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

We explore a new class of diffusion models based on the transformer architecture. We train latent diffusion models of images, replacing the commonly-used U-Net backbone with a transformer that operates on latent patches. We analyze the scalability of our Diffusion Transformers (DiTs) through the lens of forward pass complexity as measured by Gflops. We find that DiTs with higher Gflops -- through increased transformer depth/width or increased number of input tokens -- consistently have lower FID. In addition to possessing good scalability properties, our largest DiT-XL/2 models outperform all prior diffusion models on the class-conditional ImageNet 512x512 and 256x256 benchmarks, achieving a state-of-the-art FID of 2.27 on the latter.

Quote from the paper

William Peebles, Saining Xie (2022). Scalable Diffusion Models with Transformers. arXiv:2212.09748v2. https://arxiv.org/abs/2212.09748v2

BibTeX
@misc{peebles2022scalable,
  title = {{Scalable Diffusion Models with Transformers}},
  author = {William Peebles and Saining Xie},
  year = {2022},
  eprint = {2212.09748},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.09748v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up