Diffusion Lens: Interpreting Text Encoders in Text-to-Image Pipelines (2403.05846v2)
Abstract: Text-to-image diffusion models (T2I) use a latent representation of a text prompt to guide the image generation process. However, the process by which the encoder produces the text representation is unknown. We propose the Diffusion Lens, a method for analyzing the text encoder of T2I models by generating images from its intermediate representations. Using the Diffusion Lens, we perform an extensive analysis of two recent T2I models. Exploring compound prompts, we find that complex scenes describing multiple objects are composed progressively and more slowly compared to simple scenes; Exploring knowledge retrieval, we find that representation of uncommon concepts requires further computation compared to common concepts, and that knowledge retrieval is gradual across layers. Overall, our findings provide valuable insights into the text encoder component in T2I pipelines.
- ReFACT: Updating text-to-image models by editing the text encoder. arXiv preprint arXiv:2306.00738.
- Network dissection: Quantifying interpretability of deep visual representations. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6541–6549.
- Yonatan Belinkov. 2022. Probing classifiers: Promises, shortcomings, and advances. Computational Linguistics, 48(1):207–219.
- Yonatan Belinkov and James Glass. 2019. Analysis methods in neural language processing: A survey. Transactions of the Association for Computational Linguistics, 7:49–72.
- Eliciting latent predictions from transformers with the tuned lens. arXiv preprint arXiv:2303.08112.
- Attend-and-excite: Attention-based semantic guidance for text-to-image diffusion models. ACM Transactions on Graphics, 42(4):1–10.
- The hidden language of diffusion models. arXiv preprint arXiv:2306.00966.
- Analyzing redundancy in pretrained transformer models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, pages 4908–4926, Online. Association for Computational Linguistics.
- Jump to conclusions: Short-cutting transformers with linear transformations. arXiv preprint arXiv:2303.09435.
- Amnesic probing: Behavioral explanation with amnesic counterfactuals. Transactions of the Association for Computational Linguistics, 9:160–175.
- Probing for semantic evidence of composition by means of simple classification tasks. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pages 134–139, Berlin, Germany. Association for Computational Linguistics.
- Interpreting CLIP’s image representation via text-based decomposition. arXiv preprint arXiv:2310.05916.
- Transformer feed-forward layers build predictions by promoting concepts in the vocabulary space. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 30–45, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
- Multimodal neurons in artificial neural networks. Distill, 6(3):e30.
- James Hampton. 2013. Conceptual combination 1. In Knowledge Concepts and Categories, pages 133–159. Psychology Press.
- Prompt-to-prompt image editing with cross-attention control. In The Eleventh International Conference on Learning Representations, 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net.
- Visualisation and ’diagnostic classifiers’ reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61:907–926.
- Openclip. If you use this software, please cite it as below.
- Shahar Katz and Yonatan Belinkov. 2023. Visit: Visualizing and interpreting the semantic information flow of transformers. Findings of The 2023 Conference on Empirical Methods in Natural Language Processing.
- BLIP-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597.
- Microsoft coco: Common objects in context.
- Ling ling Wu and Lawrence W. Barsalou. 2009. Perceptual simulation in conceptual combination: Evidence from property generation. Acta Psychologica, 132(2):173–189. Spatial working memory and imagery: From eye movements to grounded cognition.
- Post-hoc interpretability for neural NLP: A survey. ACM Computing Surveys, 55(8):1–42.
- Henry B Mann and Donald R Whitney. 1947. On a test of whether one of two random variables is stochastically larger than the other. The annals of mathematical statistics, pages 50–60.
- Locating and editing factual associations in GPT. In NeurIPS.
- nostalgebraist. 2020. Interpreting GPT: The logit lens. lesswrong, 2020.
- OpenAI. 2023. GPT-4 technical report.
- Editing implicit assumptions in text-to-image diffusion models. arXiv preprint arXiv:2303.08084.
- Future lens: Anticipating subsequent tokens from a single hidden state. In Proceedings of the 27th Conference on Computational Natural Language Learning, pages 548–560, Singapore. Association for Computational Linguistics.
- Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc.
- Stanza: A python natural language processing toolkit for many human languages. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 101–108.
- Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748–8763. PMLR.
- Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485–5551.
- Hierarchical text-conditional image generation with CLIP latents. arXiv preprint arXiv:2204.06125, 1(2):3.
- A primer in BERTology: What we know about how BERT works. Transactions of the Association for Computational Linguistics, 8:842–866.
- High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10684–10695.
- Photorealistic text-to-image diffusion models with deep language understanding. Advances in Neural Information Processing Systems, 35:36479–36494.
- Generating images of rare concepts using pre-trained diffusion models.
- Laion-5b: An open large-scale dataset for training next generation image-text models. Advances in Neural Information Processing Systems, 35:25278–25294.
- International encyclopedia of the social & behavioral sciences, volume 11. Elsevier Amsterdam.
- StabilityAI. 2023. Deepfloyd if.
- What the DAAM: Interpreting stable diffusion using cross attention. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5644–5659, Toronto, Canada. Association for Computational Linguistics.
- Attention is all you need. Advances in neural information processing systems, 30.
- Investigating gender bias in language models using causal mediation analysis. In Advances in Neural Information Processing Systems.
- Diffusers: State-of-the-art diffusion models. https://github.com/huggingface/diffusers.
- Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations, pages 38–45.
- When are lemons purple? the concept association bias of CLIP. arXiv preprint arXiv:2212.12043.
- Matthew D. Zeiler and Rob Fergus. 2014. Visualizing and understanding convolutional networks. In 13th European Conference on Computer Vision, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part I 13, pages 818–833, Cham. Springer International Publishing.
- Fred Zhang and Neel Nanda. 2023. Towards best practices of activation patching in language models: Metrics and methods. arXiv preprint arXiv:2309.16042.
- Learning deep features for scene recognition using places database. Advances in neural information processing systems, 27.
- Michael Toker (7 papers)
- Hadas Orgad (12 papers)
- Mor Ventura (5 papers)
- Dana Arad (5 papers)
- Yonatan Belinkov (111 papers)