Efficient Scaling of Diffusion Transformers for Text-to-Image Generation

Hao Li, Shamit Lal, Zhiheng Li, Yusheng Xie, Ying Wang, Yang Zou, Orchid Majumder, Aditya Golatkar, Chengwei Su, R. Manmatha, Zhuowen Tu, Stefano Ermon, Stefano Soatto, Ashwin Swaminathan · Submission to ICLR 2025 · Rejected

TL;DR

This paper conducts a large-scale, controlled empirical study scaling Diffusion Transformers (DiTs) from 0.3B up to 8B parameters on datasets of up to 600 million images. The authors demonstrate that U-ViT—a pure self-attention architecture with long skip connections—scales significantly better than cross-attention DiT variants (such as PixArt-$\alpha$ and LargeDiT) and surpasses SDXL’s UNet at 2.3B parameters. Furthermore, U-ViT's all-token design allows seamless adaptation to conditional tasks (like inpainting and edge control) simply by concatenating condition tokens, removing the need for specialized adapter modules.

What Problem Does This Paper Address?

While Transformers have largely supplanted convolutional UNets as the backbone of generative models, a fair and rigorous architectural comparison in text-to-image (T2I) synthesis has been missing. Existing DiT designs vary widely in how they inject text conditions (e.g., cross-attention vs. in-context concatenation) and often rely on pre-trained ImageNet initializations.

It has remained unclear:

  1. Which DiT design scales most efficiently from scratch on web-scale datasets.
  2. How DiT variants compare directly against standard UNet backbones (like SDXL) under strictly controlled training setups.
  3. How scaling dataset volume and caption richness impacts sample quality and prompt alignment.

Methods

The authors evaluate three leading transformer architectures under identical training setups (same SDXL VAE, OpenCLIP-H text encoder, $256 \times 256$ resolution, and batch size 2048):

  • PixArt-$\alpha$: Uses standard cross-attention to attend to static text embeddings at every layer.
  • LargeDiT: Adapts LLaMA-style transformer blocks with bidirectional attention and cross-attention text conditioning.
  • U-ViT: A pure self-attention ViT equipped with long skip connections between shallow and deep layers. Text embeddings and latent image patches are concatenated at the input layer and updated jointly across depth.

Beyond model architectures, the authors explore:

  • Conditioning via Token Concatenation: Instead of channel concatenation or external control networks (like ControlNet), additional conditions (such as inpainting masks or Canny edge maps) are tokenized, assigned positional embeddings, and appended as sequence tokens into the self-attention stream.
  • Data & Caption Scaling: Evaluating models trained on original web captions vs. dense synthetic captions generated by LLaVA-v1.6-Mistral-7B.

Datasets

  • LensArt: A curated proprietary dataset of 250M text-image pairs filtered from an initial pool of 1B web pairs (filtered for NSFW, low aesthetic score, and duplicates).
  • SSTK: An additional curated dataset of 350M image-text pairs, scaled together with LensArt to reach 600M pairs.
  • Evaluation Benchmarks:
  • TIFA: Evaluates text-image faithfulness via VQA across 4,081 prompts.
  • ImageReward: Evaluates human preference over 10K MSCOCO prompts.
  • MSCOCO-10K FID: Assesses distribution similarity against ground truth images.
  • BrushBench & TIFA-COCO: Evaluates inpainting and Canny edge-conditioned generation.

Key Insights and Ideas

  • U-ViT behaves like an implicit text encoder fine-tuner: Cross-attention models hold text tokens static across all layers. In contrast, U-ViT updates text and visual tokens together in every block. The authors show that while cross-attention models require explicit text-encoder fine-tuning to perform well, U-ViT’s joint self-attention achieves this benefit intrinsically.
  • Skip connections are critical for in-context conditioning: Earlier DiT literature reported poor results for in-context (concatenated) conditioning. The authors reveal that skip connections are the missing ingredient that makes pure self-attention conditioning outperform cross-attention.
  • Conditioning is just token expansion: Tasks like inpainting and Canny guidance work better by feeding condition tokens directly into self-attention rather than concatenating them along the channel dimension or adding separate adapter networks.
  • Information density trumps caption length: Increasing caption token count only helps if it introduces grounded descriptive concepts. Detailed captions and diverse datasets increase coverage across TIFA attributes (e.g., color, spatial relationships, actions), which directly correlates with faster convergence and higher alignment scores.

Key Results

  • 2.3B U-ViT Outperforms SDXL UNet: The scaled 2.3B U-ViT achieves higher TIFA faithfulness and ImageReward scores than both SD2 and SDXL UNet after 500K steps.
  • Inference Speed: Despite higher theoretical compute (GMACs), 2.3B U-ViT exhibits 75% lower latency at $256 \times 256$ (1.31s vs. 5.30s) and 66% lower latency at $512 \times 512$ (1.85s vs. 5.52s) compared to SDXL UNet on an H100 GPU.
  • Cross-Attention DiTs Plateau: LargeDiT (scaled up to 7.6B) and PixArt-$\alpha$ (up to 3.0B) failed to match SDXL UNet within the same compute budget when trained from scratch.
  • State-of-the-Art Inpainting & Control:
  • Token-concatenated U-ViT achieves 89.8 TIFA-COCO and 12.82 ImageReward ($\times 10$) for inpainting, outperforming BrushNet (88.5 / 12.64).
  • On Canny conditioning, U-ViT outperforms SD3-Medium-ControlNet across FID (5.78 vs. 5.95) and TIFA-COCO (91.9 vs. 91.1).

Limitations and Future Work

  • Diminishing Returns Beyond 2.3B: Scaling U-ViT further to 3.1B ($d=56$) and 3.7B ($h=2560$) yielded negligible metric gains under the evaluated training schedule, indicating that optimal scaling rules for pure self-attention DiTs remain an open question.
  • High-Resolution Sensitivity: Generating $1024 \times 1024$ images required sensitive adjustments to diffusion noise schedules to avoid concept forgetting and color drift.
  • PEFT Methods Omitted: The downstream conditioning experiments fully trained the backbone; exploring parameter-efficient tuning (e.g., LoRA) for condition tokens was left for future exploration.

Summary updated

BibTeX
@misc{li2024efficient,
  author = {Hao Li and Shamit Lal and Zhiheng Li and Yusheng Xie and Ying Wang and Yang Zou and Orchid Majumder and Aditya Golatkar and Chengwei Su and R. Manmatha and Zhuowen Tu and Stefano Ermon and Stefano Soatto and Ashwin Swaminathan},
  title = {{Efficient Scaling of Diffusion Transformers for Text-to-Image Generation}},
  year = {2024},
  eprint = {2412.12391},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.12391},
}
Figure