Abstract
Text-to-image diffusion models have achieved remarkable success but remain largely "black boxes" regarding how specific input tokens influence spatial image generation. This paper introduces Diffusion Attentive Attribution Maps (DAAM), a novel interpretability method that utilizes the cross-attention mechanism within the U-Net denoising module. By aggregating and upscaling attention scores across time steps and layers, DAAM produces 2D maps that attribute pixel-level influence to individual words. Our analysis reveals insights into how syntax and semantic entanglement affect generation quality, and demonstrates that DAAM can perform effective unsupervised semantic segmentation.
Introduction
While Stable Diffusion produces high-fidelity imagery, understanding the relationship between input text and output pixels is challenging. Previous saliency-based methods are often computationally expensive or unstable in the iterative denoising context. DAAM addresses this by tapping into the model's internal attention, providing a clear map of how words like "monkey" or "walking" influence specific regions of the generated image. This transparency is vital for debugging compositional errors, such as "adjectival bleeding" or object confusion.
Methodology: Diffusion Attentive Attribution Maps (DAAM)
DAAM operates by extracting information from the cross-attention layers where image representations interact with text embeddings. The process involves three primary stages:
- Extraction: Capturing raw attention scores for word-pixel pairs across all heads.
- Spatiotemporal Aggregation: Summing and averaging these maps across different resolutions (layers) and denoising time steps.
- Upscaling: Using bicubic interpolation to restore low-resolution maps to the original image dimensions.
Experimental Results and Insights
The researchers evaluated DAAM using datasets like COCO-Gen and Unreal-Gen, alongside human evaluations. A key finding is the role of syntax: heads of dependencies (e.g., verbs) often subsume their dependents (e.g., subjects) in pixel space. For instance, the attribution for "walking" often encompasses the entire area of the subject performing the action.
Furthermore, DAAM identifies "feature entanglement." When semantically similar words (cohyponyms like "giraffe" and "zebra") are used, their attribution maps overlap significantly, leading to a measurable drop in generation quality. The method also highlights "adjectival bleeding," where descriptive terms like "rusty" incorrectly influence surrounding objects. Quantitatively, DAAM achieved 58.8–64.8 mIoU in noun segmentation, proving its spatial accuracy.
Discussion and Conclusion
DAAM provides a powerful lens into the inner workings of diffusion models, though it faces limitations with abstract concepts and reliance on external dependency parsers. Future work involves using DAAM signals during training to encourage disentanglement and improve compositional accuracy. By turning attention into attribution, DAAM moves us closer to transparent and controllable generative AI.
Summary updated