Precise Parameter Localization for Textual Generation in Diffusion Models
Abstract
Novel diffusion models can synthesize photo-realistic images with integrated high-quality text. Surprisingly, we demonstrate through attention activation patching that only less than 1% of diffusion models' parameters, all contained in attention layers, influence the generation of textual content within the images. Building on this observation, we improve textual generation efficiency and performance by targeting cross and joint attention layers of diffusion models. We introduce several applications that benefit from localizing the layers responsible for textual content generation. We first show that a LoRA-based fine-tuning solely of the localized layers enhances, even more, the general text-generation capabilities of large diffusion models while preserving the quality and diversity of the diffusion models' generations. Then, we demonstrate how we can use the localized layers to edit textual content in generated images. Finally, we extend this idea to the practical use case of preventing the generation of toxic text in a cost-free manner. In contrast to prior work, our localization approach is broadly applicable across various diffusion model architectures, including U-Net (e.g., LDM and SDXL) and transformer-based (e.g., DeepFloyd IF and Stable Diffusion 3), utilizing diverse text encoders (e.g., from CLIP to the large language models like T5). Project page available at https://t2i-text-loc.github.io/.
Community
Precise Parameter Localization for Textual Generation in Diffusion Models
๐ก What do we do?
We show that textual content generated on images with Diffusion Models is controlled by less than 1% of their parameters. We localize the attention layers across diverse diffusion architectures such as SDXL (U-Nets), Deepfloyd IF (Pixel Diffusion), and SD3 (Diffusion Transformers) by activation patching technique.
๐ What are the benefits?
๐ We use the found layers to train diffusion models more efficiently, increasing text quality and maintaining generation diversity.
๐จ We introduce a novel method for editing text on images.
๐ We employ our method to remove toxic words from images without touching other image attributes.
๐ Interested? See more!
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- VMix: Improving Text-to-Image Diffusion Model with Cross-Attention Mixing Control (2024)
- CubeDiff: Repurposing Diffusion-Based Image Models for Panorama Generation (2025)
- Skrr: Skip and Re-use Text Encoder Layers for Memory Efficient Text-to-Image Generation (2025)
- Decoder-Only LLMs are Better Controllers for Diffusion Models (2025)
- ImageRAG: Dynamic Image Retrieval for Reference-Guided Image Generation (2025)
- CascadeV: An Implementation of Wurstchen Architecture for Video Generation (2025)
- Ultrasound image generation using latent diffusion models (2025)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment:
@librarian-bot
recommend
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper