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

GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models

Guided diffusion models produce photorealistic images from text prompts

  • Problem Text-to-image models still fail to produce photorealistic images that capture every part of a prompt. Unconditional diffusion models already reach high fidelity, but no one had brought that quality to text-conditional generation.
  • Method GLIDE is a 3.5 billion parameter text-conditional diffusion model. Unlike CLIP guidance, it uses classifier-free guidance, which steers samples without a separate classifier.
  • Results Human raters preferred GLIDE samples over DALL-E with CLIP reranking 87% of the time for photorealism and 69% for caption similarity at temperature 0.85.

Why text-conditioned images still fall short

Text-conditional image models can place unrelated objects together in semantically plausible ways, but they cannot yet produce photorealistic images that capture every aspect of a prompt. Unconditional diffusion models, by contrast, can reach fidelity high enough that people sometimes cannot separate their samples from real images. Classifier guidance brought that quality to class-conditional generation by steering samples with the gradients of a separately trained classifier.

Classifier-free guidance reaches a similar effect without a separate classifier, by mixing predictions made with and without the label. The study applies guided diffusion to text-conditional synthesis and compares two ways of steering the sampler towards a caption: CLIP guidance and classifier-free guidance.

The authors find, through human and automated evaluations, that classifier-free guidance gives higher-quality images.

Diffusion sampling and the training objective

When the noise added per step is small, the reverse step is close to a diagonal Gaussian, and when the total noise is large, \(x_T\) is close to \(\mathcal{N}(0,I)\). These two properties justify learning a reverse model \(p_\theta(x_{t-1}|x_t)\), which generates a sample by starting from Gaussian noise and removing noise step by step.

Training uses a surrogate objective rather than the variational lower bound, because it gives better results. The surrogate noises a sample to \(x_t\), trains \(\epsilon_\theta\) to predict the added noise, and minimizes the mean-squared error \(L_{simple}\). The mean \(\mu_\theta(x_t)\) is derived from \(\epsilon_\theta(x_t,t)\) while the variance is held constant in the original formulation, and the authors adopt a later method that learns the variance \(\Sigma_\theta\) so that fewer sampling steps give high-quality samples.

Guidance: classifier, classifier-free and CLIP

In classifier guidance, the class-conditional mean is shifted by a scaled gradient of the log-probability that a classifier assigns to the target class, \(\hat\mu_\theta(x_t|y)=\mu_\theta(x_t|y)+s\cdot\Sigma_\theta(x_t|y)\nabla_{x_t}\log p_\phi(y|x_t)\). The guidance scale \(s\) trades diversity for sample quality, since larger values improve quality but reduce diversity.

Classifier-free guidance replaces the label with a null label at a fixed probability during training, so one model provides both conditional and unconditional predictions. At sampling time the output is extrapolated from the unconditional prediction towards the conditional one, giving \(\hat\epsilon_\theta(x_t|c)=\epsilon_\theta(x_t|\varnothing)+s\cdot(\epsilon_\theta(x_t|c)-\epsilon_\theta(x_t|\varnothing))\), with \(s\geq 1\).

This form is motivated by an implicit classifier whose gradient corresponds to the difference between conditional and unconditional true scores. Two consequences follow: one model guides itself, and no separate text classifier must be trained, which matters because text is hard to predict with a classifier.

CLIP guidance replaces the classifier with a CLIP model, perturbing the reverse-process mean by the gradient of the dot product between the image encoding and the caption encoding, \(\hat\mu_\theta(x_t|c)=\mu_\theta(x_t|c)+s\cdot\Sigma_\theta(x_t|c)\nabla_{x_t}(f(x_t)\cdot g(c))\). The CLIP model must be trained on noised images so that the gradient is meaningful at every step, and the authors call these noised CLIP models.

The authors hypothesize that a public CLIP model, which never saw noised images, degrades sample quality because the intermediate images are out of distribution for it.

Text-conditional model and training

Text is encoded into K tokens by a Transformer, and the final token embedding replaces the class embedding of the ADM backbone. The full token sequence is projected to the width of each attention layer and concatenated to that layer's attention context, so the image layers attend to the text at every level.

The base model keeps the ImageNet 64 by 64 architecture with width scaled to 512 channels, giving roughly 2.3 billion visual parameters, and its text encoder has 24 residual blocks of width 2048, roughly 1.2 billion parameters. A 1.5 billion parameter upsampler takes images from 64 by 64 to 256 by 256, uses a text encoder of width 1024, and raises the base channel count to 384.

The base model was trained for 2.5M iterations at batch size 2048 and the upsampler for 1.6M iterations at batch size 512. Training used 16-bit precision with loss scaling, and the total compute is roughly equal to that used for DALL-E.

For classifier-free guidance, the base model is fine-tuned after the initial run, with 20% of text token sequences replaced by the empty sequence. This keeps the text-conditional ability while also allowing unconditional generation.

Inpainting is trained explicitly rather than only applied at sampling time, because sampling-time replacement of known pixels produced edge artifacts in early experiments. During fine-tuning, random regions are erased, and the remaining pixels are fed in with a mask channel; the input gains four channels, a second RGB set and a mask channel.

The new input weights are initialized to zero before fine-tuning, and the upsampler always receives the full low-resolution image with only the unmasked part of the high-resolution image.

Classifier-free guidance against CLIP guidance

On zero-shot MS-COCO generation at 64 by 64, classifier-free guidance is nearly Pareto optimal for the precision-recall and FID-IS trade-offs. CLIP guidance instead raises the CLIP score much more than classifier-free guidance does, which the authors attribute to adversarial examples for the scoring CLIP model rather than better prompt matching.

To check this, human evaluators compared 256 by 256 images on caption match or photorealism, and a tie gave half a win to each model. In Table 1, unguided sampling scored -88.6 on photorealism and -106.2 on caption, CLIP guidance at scale 2.0 scored -73.2 and 29.3, and classifier-free guidance at scale 3.0 scored 82.7 and 110.9. The Elo scores come from 1,000 comparisons for photorealism and 1,000 for caption similarity, with sweeps over scales using 500 comparisons.

Comparison with DALL-E

Removing images similar to the training set reduced the reference batch by 21% and raised FID from 12.24 to 12.89, which the authors partly attribute to the change in FID bias for a smaller reference batch. Table 2 lists other text-conditional models, including XMC-GAN at 9.33 and LAFITE at 8.12, and the authors describe the result as competitive, because the model was never trained on MS-COCO.

In the human comparison with DALL-E, GLIDE wins 91% of photorealism and 83% of caption-similarity comparisons without reranking at temperature 1.0, and 84% and 80% at temperature 0.85. When DALL-E uses CLIP reranking, the win rates are 89% and 71% at temperature 1.0, and 87% and 69% at temperature 0.85. Passing GLIDE samples through the DALL-E discrete VAE, which blurs them, lowers the win rates to 72% and 63% at temperature 1.0, and 66% and 61% at temperature 0.85.

Text-driven inpainting and editing

Inpainting fills erased regions from a text prompt, matching the style and lighting of the surrounding image, including shadows and reflections. The model can also edit paintings and turn sketches into realistic edits through SDEdit, shown with a sketch and a caption. A scene can be built iteratively: a zero-shot living room is refined by inpainting a painting, a coffee table and a vase of flowers, and then moving the wall up to the couch.

Compared with Blended Diffusion, the fine-tuned model sometimes ignores the prompt and produces an image driven mainly by the context. Masking out the whole context makes the model follow the caption more consistently, but the inserted objects sometimes fit the scene less smoothly.

Data filtering and remaining biases

Training images were filtered for people, violent objects and hate symbols before training the released model, which is a 300 million parameter model. The people filter is an SVM over pre-trained CLIP ViT-B/16 features of three crops, tuned to less than a 1% false negative rate, and it produced no false negatives on a separate batch of 1024 samples.

The violent-object classifier was trained with CLIP-guided search and active learning, and the hate-symbol classifier was trained on two hate symbols common in America.

In red teaming with adversarial prompts, no instance of a recognizable human was found in the filtered model, which the authors take as a sign of a low false-negative rate. Classifier-free guidance amplifies these biases, and the inpainting capability, whose misuse potential the authors flag, is retained.

Pairing the filtered model with an unfiltered public CLIP model allowed some recognizable facial expressions or hateful imagery.

Limitations

The model fails on some prompts that describe highly unusual objects or scenarios, such as a cat with eight legs or a car with triangular wheels. For complex prompts the model can have difficulty producing realistic images, which is why editing was added on top of zero-shot generation.

The hate-symbol classifier has a strong American and Western bias, so it may not filter hateful symbols outside the two it was trained on.

Paper info

Authors
Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, Mark Chen
Venue
arXiv · Preprint
First published
2021-12-20
Added
2026-11-12
Updated
2022-3-8
Version
v3
arXiv
2112.10741
Category
cs.CV · cs.GR · 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

Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, Mark Chen (2021). GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models. arXiv:2112.10741v3. https://arxiv.org/abs/2112.10741v3

BibTeX
@misc{nichol2021glide,
  title = {{GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models}},
  author = {Alex Nichol and Prafulla Dhariwal and Aditya Ramesh and Pranav Shyam and Pamela Mishkin and Bob McGrew and Ilya Sutskever and Mark Chen},
  year = {2021},
  eprint = {2112.10741},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.10741v3}
}

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