Towards Understanding the Working Mechanism of Text-to-Image Diffusion Model

Recently, the strong latent Diffusion Probabilistic Model (DPM) has been applied to high-quality Text-to-Image (T2I) generation (e.g., Stable Diffusion), by injecting the encoded target text prompt into the gradually denoised diffusion image generator. Despite the success of DPM in practice, the mechanism behind it remains to be explored. To fill this blank, we begin by examining the intermediate statuses during the gradual denoising generation process in DPM. The empirical observations indicate, the shape of image is reconstructed after the first few denoising steps, and then the image is filled with details (e.g., texture). The phenomenon is because the low-frequency signal (shape relevant) of the noisy image is not corrupted until the final stage in the forward process (initial stage of generation) of adding noise in DPM. Inspired by the observations, we proceed to explore the influence of each token in the text prompt during the two stages. After a series of experiments of T2I generations conditioned on a set of text prompts. We conclude that in the earlier generation stage, the image is mostly decided by the special token [\texttt{EOS}] in the text prompt, and the information in the text prompt is already conveyed in this stage. After that, the diffusion model completes the details of generated images by information from themselves. Finally, we propose to apply this observation to accelerate the process of T2I generation by properly removing text guidance, which finally accelerates the sampling up to 25\%+.

Paper

Similar papers

Peer review

Reviewer zfAn6/10 · confidence 4/52024-07-06

Summary

This paper aims to understand two mechanisms of diffusion models. First, the denoising process is analyzed, and it is found that shapes in an image are constructed in the beginning of the denoising process, while textures and details are filled in later. This empirical observation is justified with a mathematical frequency analysis. Second, the role of text conditioning is analyzed and it is found that the [EOS] token, which captures global information of the prompt, is relied on more heavily by the diffusion model. It is also observed that the text prompt is utilized more in the earlier stages of the denoising process. This finding is utilized to speed up diffusion sampling by ~25% while maintaining the image quality and prompt alignment. This is done by only injecting conditional information in the beginning of the denoising process.

Strengths

* Although the finding that shape is constructed in the first few timesteps has been observed many times before, it is nice to have a more principled study with various experiments and mathematical justification. * The finding that the special [EOS] token is the most relied upon during generation rather than the prompt tokens is an interesting finding that can be used in later studies. For instance, improving prompt alignment, attribute binding, etc. * The observation that the text prompt is used more in the early denoising process lends itself to a practical application of speeding up inference. * Multiple architectures and samplers are used in this study, suggesting the generality of these findings.

Weaknesses

* As mentioned in the Strengths section above, the findings are not completely surprising (for instance, the shape reconstruction or reliance on text in the early denoising steps, then detail-filling in the later steps). However, this work takes a principled approach in studying these phenomena which have largely been used in diffusion application literature (e.g., [1, 2]) * Limited to no mention of broader impact or limitations. Furthermore, the Conclusion section is just a summary of the paper but does not discuss the implications of these findings. [1] @inproceedings{mengsdedit, title={SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations}, author={Meng, Chenlin and He, Yutong and Song, Yang and Song, Jiaming and Wu, Jiajun and Zhu, Jun-Yan and Ermon, Stefano}, booktitle={International Conference on Learning Representations} } [2] @inproceedings{hertzprompt, title={Prompt-to-Prompt Image Editing with Cross-Attention Control}, author={Hertz, Amir and Mokady, Ron and Tenenbaum, Jay and Aberman, Kfir and Pritch, Yael and Cohen-or, Daniel}, booktitle={International Conference on Learning Representations} }

Questions

* What are some of the limitations and implications of these findings? * I did not take this into account for my review, but there are many typos in the text and figures which can be corrected for the next version. * This (https://arxiv.org/pdf/2404.07724) is a concurrent work, so it is not expected for this paper to compare against it. Their finding is applying guidance in the middle denoising steps improves image quality and distribution coverage. I am curious to hear how the findings this paper being reviewed can be connected to the phenomena observed there. It might be something to keep in mind for the next version, although it will not be used in assessing this paper.

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

Although there are no societal implications, a discussion of limitations is lacking.

Reviewer xbNR7/10 · confidence 5/52024-07-11

Summary

This paper explores the mechanism in the text-to-image diffusion model, including the generation order of image components, the influence of various tokens, and the steps in which tokens work. These observations bring some insight into understanding the diffusion model. Besides, the authors also design a sampling strategy that accelerates the sampling of the denoising process by 25%+.

Strengths

1. The conclusion of the [EOS] token is interesting and has been rarely investigated in previous papers. 2. The analytical experiments in this article are sufficient and strongly support its conclusion. 3. The writing expression of this article is very clear.

Weaknesses

1. The other conclusions in this paper, e.g., shape first then details, have been discussed in previous works. 2. The sampling strategy is more like a sample trick than a method.

Questions

1. Is the proposed sampling strategy still feasible for generating tasks that require preserving specific details, e.g., subject-driven generation?

Rating

7

Confidence

5

Soundness

4

Presentation

3

Contribution

2

Limitations

Suggest the author to discuss the applicability and limitations of the proposed sampling scheme. For example, can it be applied to human face generation without losing human identity?

Reviewer P41E7/10 · confidence 5/52024-07-17

Summary

The paper investigates the denoising process in DPM, identifying that the overall shape of the image is formed early in the process while details are added later. It further examines the influence of different text prompt tokens, finding that the end-of-sequence token [EOS] plays a crucial role in shaping the initial stages of image generation. The authors propose a method to speed up the generation process by removing text guidance after the initial stages, achieving a significant reduction in computational cost.

Strengths

- Comprehensive analysis of the denoising process stages in DPM. - Detailed exploration of the influence of different tokens in the text prompt. - Practical application of findings to accelerate the T2I generation process. - Empirical and theoretical support for the proposed acceleration method.

Weaknesses

- The paper might lack clarity in explaining the theoretical aspects of frequency signal analysis. - Limited exploration of potential biases introduced by the dominance of the [EOS] token. - The study may benefit from a broader range of experiments to validate the generalizability of the findings.

Questions

- Can you provide a more detailed explanation of the theoretical aspects of frequency signal analysis used in your study? Specifically, how do the low and high-frequency components influence the denoising process? Including more accessible explanations or visual aids to illustrate the frequency signal analysis could help readers better understand this aspect of your work. - Your experiments are primarily based on a specific set of text prompts and Stable Diffusion model versions. How do you ensure that your findings generalize across different models and broader text prompt sets? - The paper uses various metrics like CLIPScore, BLIP-VQA, and MiniGPT4-CoT for evaluation. Can you provide a more detailed explanation of why these particular metrics were chosen and how they comprehensively assess the text-image alignment?

Rating

7

Confidence

5

Soundness

4

Presentation

3

Contribution

3

Limitations

- Authors should discuss the robustness of their findings and the need for further experiments across various models and more complex or diverse text prompts to validate their conclusions.

Reviewer KEXx6/10 · confidence 4/52024-07-21

Summary

This paper study how the EOS token plays a role in the generation process of diffusion model. In particular, this paper finds that diffusion models tend to first generate low frequency part of the image at the beginning of the generation process, then gradually add high frequency signal to it. Experiments show that the low frequency signal is conditional on the EOS token while the high frequency signal can be generated without text guidance. In combined with the aforementioned observation, this paper proposes to remove $\epsilon_\theta$ in classifier-free guidance once the low frequency signal has been generation to improve generation efficiency.

Strengths

- This paper offers a new perspective for understanding the role of textual condition in diffusion models. By exploring how the EOS influence the generation process of diffusion model, this paper argues that the conditional part $\epsilon_\theta$ in classifier-free guidance (CFG) might be unnecessary after certain denoising step $t_w$. - Most experiments are inspirational and interesting. By swapping the EOS token and the sentence body, it demonstrates that diffusion models rely on the EOS token to synthesize low frequency part of the image. - This paper explains the tendency of generating image from low-to-high frequency in diffusion models.

Weaknesses

- It is not clear that how the "computational cost" is defined in this paper. If the computational cost is GPU VRAM, then the claimed efficiency improvement might be invalid, as the required GPU VRAM for computing $\epsilon_\theta(x_t, C)$ or $\epsilon_\theta(x_t, \emptyset )$ is unchanged. - This paper mainly focus on the role of EOS token in T2I diffusion models while neglecting the SOS token. Despite the weight of SOS token is significantly higher than SEM and EOS token (see Figure 3). However, the authoer(s) claims that the SOS carries no information due to the autoregressive nature CLIP text encoder. Since this claim is not yet supported by other works, the author(s) should have conducted experiments to support this claim, as there is a chance that EOS and SOS tokens altogether influence the generation process.

Questions

- Please clarify how the computation cost is defined in this paper and how the efficiency gain is computed.

Rating

6

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

N/A

Authorsrebuttal2024-08-13

Looking forward to Feedback as Discussion Deadline Approaches

Thank you for your meticulous review, which played a pivotal role in enhancing the quality of our paper. We apologize for any inconvenience, but as the discussion deadline approaches **(Aug 13 11:59 pm AoE)**, we would like to provide an update on our progress. We have clarified that the computational effciency of the proposed sampling method originates from the less number of function evaluation, and the experiments to verify no information in [SOS] are conducted. If you require any further clarification or have additional questions, please do not hesitate to reach out. Again, we sincerely appreciate your time and effort in reviewing our paper. Thanks

Reviewer KEXx2024-08-13

Rebuttal

Thanks for the responses during the rebuttal period. The authors have addressed my major concerns. I am happy to increase my ranking of this manuscript as Weak Accept.

Authorsrebuttal2024-08-13

Thanks

Dear Reviewer We are happy that our reply address your concerns. We are sorry to bother you, but It seems that the score has not been changed yet. It will be nice to change the score when you are in convenience. Thanks

Reviewer zfAn2024-08-08

Thank you for your detailed response. I have also gone through the responses to the other reviews as well as the rebuttal PDF. As other reviewers have also pointed out, some of the findings have been discussed before in the literature (shape-then-detail). Although the findings and applications are fairly narrow in scope, I think they can have an impact on further interesting studies of diffusion models. Moreover, this work takes a principled approach. Thus, I maintain my score of weak accept. I appreciate the response on the limitations of the findings, so I suggest the updated paper to include those.

Reviewer xbNR2024-08-09

Thanks for your responses. After reading the rebuttal, I think this paper provides interesting new points about how text prompts work in diffusion models. Thus, I will raise my point.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC