NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

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

Mingyang Yi, Aoxue Li, Yi Xin, Zhenguo Li

Abstract

Latent Diffusion Probabilistic Models (DPMs) like Stable Diffusion have revolutionized high-quality text-to-image generation. However, the internal mechanisms of these models remain poorly understood. This paper investigates the intermediate states of the denoising process, revealing that images are reconstructed in two distinct phases: an initial shape-forming stage followed by a detail-filling stage. This phenomenon is rooted in the robustness of low-frequency signals during the forward noise process. Furthermore, we demonstrate that the [EOS] token in the text prompt dominates the early generation stage, carrying the bulk of the semantic information. By leveraging these insights, we propose a method to accelerate generation by up to 25% by removing text guidance in the later stages of the process without compromising image quality.

Introduction

Text-to-Image (T2I) models are often treated as black boxes. While users can generate complex imagery from simple prompts, the temporal and semantic dynamics of the denoising process are not well-defined. This research seeks to answer two primary questions:

  1. The Temporal Mystery: When is the core content of an image decided during the 50-step denoising process?
  2. The Token Mystery: Which components of a text prompt—individual words or special tokens—exert the most influence at different generation stages?

Methodology

The study employed frequency analysis and cross-attention visualization to track the evolution of generated images. Using Fourier Transforms, the authors found that low-frequency signals (representing coarse shapes) are the last to be corrupted by noise and the first to be recovered during generation.

Cross-Attention and Token Analysis

Cross-attention maps were used to visualize how the model's focus shifts across tokens over time. The researchers also used MS-COCO and a custom PromptSet to evaluate generation quality, performing token substitution experiments—specifically swapping [EOS] tokens between prompts—to isolate their semantic impact.

Cross-attention maps and convergence plot showing how the model's focus on text tokens decays over time steps.

Key Insights

The "Shape-First" Paradigm

The generation process begins with the reconstruction of low-frequency signals. Because "shape" is the most robust feature against noise, it is the primary focus of the model during the initial denoising steps. Once the layout and "semantic skeleton" are set, the model relies more on its own internal knowledge of textures and lighting to finish the image.

The Power of the [EOS] Token

The CLIP text encoder is auto-regressive, meaning the final [EOS] token effectively summarizes the entire prompt. The authors discovered that this token is the primary driver of the early "shape-forming" stage. Swapping the [EOS] token often overrides the other words in the prompt, forcing the model to generate the global structure associated with the [EOS] source.

Front-Loaded Text Guidance

Text guidance is most critical during the first 20-30% of the denoising process. As shown in the convergence analysis, the relative influence of the text prompt decays significantly as the image nears completion, allowing for potential optimization.

Key Results

By stopping text guidance once the image structure was set, the authors achieved a 25%+ reduction in inference cost on V100 GPUs. Despite the speedup, metrics like FID and CLIPScore remained stable, indicating that the quality and text-alignment of the images were preserved.

Final generated image for the prompt: "The square coaster was next to the circular mug."

This property was found to be consistent across multiple architectures, including Stable Diffusion v1.5, v2.1, and Pixart-Alpha, suggesting it is a fundamental characteristic of diffusion-based T2I models.

Conclusion

This research provides a clearer understanding of the diffusion generation pipeline, highlighting the importance of the [EOS] token and the temporal decay of text influence. While these findings offer a path toward more efficient generation, future work is needed to investigate how these mechanisms behave with extremely long prompts or complex subject-driven tasks involving ControlNet or IP-Adapters.

Summary updated

BibTeX
@inproceedings{yi2024towards,
  author = {Mingyang Yi and Aoxue Li and Yi Xin and Zhenguo Li},
  title = {{Towards Understanding the Working Mechanism of Text-to-Image Diffusion Model}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=zTu0QEpvtZ},
}
Figure