Paper commentary
Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding
- Problem Text-to-image diffusion models need a text representation that captures the compositional detail of free-form prompts, and Imagen tests whether a frozen, text-only large language encoder can supply it.
- Method Freezes a T5-XXL text encoder, trains a 64×64 diffusion model with classifier-free guidance, adds dynamic thresholding so that large guidance weights stay usable, and upsamples to 1024×1024 with two super-resolution models.
- Results Reached zero-shot FID-30K of 7.27 on MS-COCO 256×256 without training on COCO, and raters preferred Imagen over DALL-E 2, GLIDE, Latent Diffusion and VQ-GAN+CLIP on DrawBench.
Why the text encoder matters
A text-to-image model has to turn a free-form prompt into a representation that its image generator can act on. Most current systems learn that representation from paired image-text data, either from scratch or through a model such as CLIP. Large language models are pretrained on text-only corpora that are far larger than paired image-text data, and they are generally much larger than the text encoders used in image-text models.
Imagen asks whether such a language model can serve as the text side of a diffusion system, with its weights kept fixed.
The pipeline pairs a frozen T5-XXL encoder with a 64×64 base diffusion model and two text-conditional super-resolution diffusion models, which produce 256×256 and then 1024×1024 outputs. Figure 1 shows 1024×1024 samples chosen to be photorealistic, and artistic content is left to the appendix because photorealism is the harder target.
Frozen T5-XXL against CLIP encoders
In the scaling sweeps, enlarging the frozen text encoder raised both sample fidelity and image-text alignment more than enlarging the image diffusion U-Net did. The largest encoder in the sweep is T5-XXL with 4.6B parameters, and it gave the best results.
On MS-COCO, models with T5-XXL and CLIP text encoders score similarly in CLIP and FID. On DrawBench, human raters preferred T5-XXL over CLIP in all 11 categories, for both image-text alignment and image fidelity. The gap therefore appears only on the harder compositional prompts, which is why DrawBench was used to separate the two encoders.
Guidance weights and thresholding during sampling
Classifier-free guidance is trained into a single diffusion model by randomly zeroing the text embeddings with 10% probability, so the same network learns both conditional and unconditional denoising. At sampling time the two noise predictions are blended as \[ \tilde{\epsilon}_\theta(z_t, c) = w\,\epsilon_\theta(z_t, c) + (1-w)\,\epsilon_\theta(z_t) \], where w is the guidance weight.
Setting w to 1 switches guidance off, and values above 1 strengthen the influence of the text.
Larger guidance weights improve image-text alignment but make the images saturated and unnatural. The authors trace this to a train-test mismatch: the x-prediction at each step should stay within the training range of [-1, 1], but high guidance weights push it outside that range, and the next step then runs the model on its own out-of-range output.
Dynamic thresholding for large guidance weights
Static thresholding clips every element of the x-prediction to [-1, 1] at each sampling step, which prevents blank images. It still leaves oversaturated, less detailed images as the guidance weight grows.
Dynamic thresholding computes, at each step, a percentile of the absolute pixel values of the x-prediction and calls it s. If s is greater than 1, the x-prediction is clipped to [-s, s] and then divided by s, which moves saturated pixels inward rather than only clipping them. Because the clipping range adapts to each sample, this keeps the pixels from saturating at every step, which is what allows the very large guidance weights in the experiments.
Cascade and Efficient U-Net super-resolution
A 64×64 base sample is upsampled first to 256×256 and then to 1024×1024 by two text-conditional super-resolution models. Before each upsampling step the low-resolution conditioning image is corrupted with Gaussian noise at a level aug_level in [0, 1], and the super-resolution model is conditioned on that level. The level is sampled at random during training and swept over its values at inference to find the best sample quality.
The base model is a U-Net whose text conditioning uses a pooled text embedding, added to the timestep embedding, plus cross attention over the full text embedding sequence at several resolutions. Layer Normalization on the text embeddings in the attention and pooling layers was found to improve performance considerably.
The 64×64 to 256×256 model uses a modified U-Net named Efficient U-Net, which the authors designed for memory efficiency, inference time and convergence speed. That variant runs 2-3x faster in steps per second than the U-Net used in earlier super-resolution work. The 256×256 to 1024×1024 model is trained on 64×64 to 256×256 crops of the large image, so self-attention layers are removed while the text cross-attention layers are kept, since the authors found those critical.
Training configuration
The base 64×64 model has 2B parameters, and the super-resolution models have 600M and 400M parameters for the 64×64 to 256×256 and 256×256 to 1024×1024 stages. The base model is trained with Adafactor, which matched Adam in initial comparisons with a smaller memory footprint, while the super-resolution models use Adam because Adafactor hurt quality in initial ablations.
Training combines internal datasets of about 460M image-text pairs with the publicly available LAION dataset of about 400M image-text pairs.
How the models are scored
CLIP score measures image-text alignment, and guidance weight is varied to trace trade-off curves between CLIP and FID. The authors note that FID is not fully aligned with perceptual quality and that CLIP is ineffective at counting, which motivates the human evaluations.
For image quality, raters choose between a model sample and a reference image on which one is more photorealistic, and the preference rate is the share of choices that favour the model. For alignment, raters answer yes, somewhat or no to whether the caption describes the image, and these are scored 100, 50 and 0.
The COCO study uses 200 randomly chosen image-caption pairs, shown in batches of 50 images, with interleaved control trials. Only raters who answered at least 80% of the control questions correctly were kept, leaving 73 ratings per image for image quality and 51 per image for alignment.
DrawBench contains 200 prompts in 11 categories, covering colors, counts, spatial relations, text in the scene, unusual object interactions, long or misspelled prompts and rare words. Each comparison presents two sets of 8 samples, one from each model, and raters choose Prefer Model A, Indifferent or Prefer Model B for fidelity and for alignment.
COCO zero-shot FID and human ratings
Imagen reached a zero-shot FID-30K of 7.27, which is the lowest value in Table 1 and was obtained without training on COCO. The guidance weights used for this setting were 1.35 for the 64×64 model and 8.0 for the super-resolution model. Table 1 lists DALL-E 2 at 10.39 and GLIDE at 12.24, while the running text gives 10.4 and 12.4 for those two models, so the two sources disagree at the second decimal place.
The lowest COCO-trained entry in the table is Make-A-Scene at 7.55, which is above Imagen's 7.27.
On the full COCO validation set, the photorealism preference rate for Imagen is 39.5 ± 0.75% in Table 2 and 39.2% in the text. The authors read the rise as a sign that Imagen generates photorealistic people less well than other content.
Image-text alignment is 91.4 ± 0.44 for Imagen against 91.9 ± 0.42 for the original references on the full set. The filter removes prompts that contain words such as man, woman, person, child or player, so the second comparison covers a different prompt subset.
Pairwise preference on DrawBench
Imagen was compared with the public version of DALL-E 2, GLIDE, Latent Diffusion and CLIP-guided VQ-GAN on DrawBench. Each comparison reports the share of raters who prefer Imagen, the other model, or are indifferent, for image fidelity and for image-text alignment.
Aggregated across categories and raters, human raters preferred Imagen over all four models on both image-text alignment and image fidelity. The category-wise breakdown and qualitative comparisons are given in the appendix, so this section relies on the aggregated comparison only.
Ablation findings
Dynamic thresholding gave samples with better photorealism and image-text alignment than static thresholding or no thresholding, and the gap was largest when the guidance weights were large. The comparison plots CLIP score against FID across a range of guidance values, which reads the thresholding effect as a trade-off curve rather than a single score.
Training the super-resolution models with noise conditioning augmentation improved CLIP and FID scores, and it allowed stronger text conditioning at higher guidance weights. Conditioning on the full text embedding sequence with cross attention outperformed mean pooling and attention-based pooling in both fidelity and alignment. The authors report that Efficient U-Net uses less memory, converges faster and gives better sample quality with faster inference than the U-Net variant it replaces.
Limits on what the results show
The human evaluation shows that Imagen's photorealism rises when people are removed from the reference set, which the authors take as evidence of serious limits on generating images of people. The people-filtered comparison is the only evidence in the paper for this gap.
The authors' preliminary assessment found an overall bias toward lighter skin tones and a tendency for professions to align with Western gender stereotypes. Imagen may also drop modes of the data distribution, which the authors say could compound the social consequences of dataset bias.
Paper info
- Authors
- Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, Mohammad Norouzi
- Venue
- arXiv · Preprint
- First published
- 2022-5-23
- Added
- 2026-10-20
- Updated
- 2022-5-23
- Version
- v1
- arXiv
- 2205.11487
- Category
- cs.CV · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
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.
Quote from the paper
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, Mohammad Norouzi (2022). Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding. arXiv:2205.11487v1. https://arxiv.org/abs/2205.11487v1
BibTeX
@misc{saharia2022photorealistic,
title = {{Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding}},
author = {Chitwan Saharia and William Chan and Saurabh Saxena and Lala Li and Jay Whang and Emily Denton and Seyed Kamyar Seyed Ghasemipour and Burcu Karagol Ayan and S. Sara Mahdavi and Rapha Gontijo Lopes and Tim Salimans and Jonathan Ho and David J Fleet and Mohammad Norouzi},
year = {2022},
eprint = {2205.11487},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2205.11487v1}
}