Research map / Image generation / Text-to-image diffusion
On Mechanistic Knowledge Localization in Text-to-Image Generative Models
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes LocoGen to localize visual-attribute knowledge (style, objects, facts) to small sets of cross-attention layers in text-to-image UNets via altered-input interventions, and LocoEdit for closed-form key/value edits there.
Problem
Causal tracing localizes knowledge in early Stable Diffusion text encoders but fails for newer text-to-image models (SD-XL, DeepFloyd), hindering closed-form model editing.
Approach
Replace the text embedding in a small contiguous subset of UNet cross-attention layers with a target-prompt embedding and measure the direct effect on output (CLIP-score change) to find controlling layers; then apply closed-form key/value updates at those layers.
Key results
- LocoGen identifies small controlling sets of cross-attention layers (e.g., layer 8 with m=2 for style in SD-v1-5; layer 45 with m=3 for style and facts in SD-XL), where causal tracing fails for SD-XL and DeepFloyd.
- Human study over 132 image pairs with five evaluators reports a 92.58% rate of ratings above 1 indicating the layers affect the targeted attribute.
- Dropping 50-100 neurons out of 1280 in controlling layers removes artistic styles, suggesting neuron-level localization.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use LocoGen-identified cross-attention layers for attribute editing | LocoGen · Human study, all image pairs | verification rate (rating above 1): 92.58% | Helped |
| Edit only LocoGen-identified localized layers instead of all UNet layers (ablation) | LocoEdit · Object and fact edits | edit correctness | Helped |
| Apply closed-form editing at LocoGen locations using only the last-subject token embedding | DeepFloyd · Style, object, and fact edits | edit effectiveness | Hurt |
| Modify more identified neurons during inference (ablation) | Stable Diffusion v1.5 neuron-level editing · Style removal | style removal | Helped |
| Modify more identified neurons during inference (ablation) | Stable Diffusion v1.5 neuron-level editing · Generated image quality | image quality | Hurt |
| Use LocoEdit for style editing rather than the compared editing baselines | Stable Diffusion v1.5 · Style editing | CLIP-Score change | No clear effect |
| Use LocoEdit rather than the compared editing baselines | Stable Diffusion v1.5 · Fact editing | CLIP-Score increase | Helped |
| Use LocoEdit rather than the compared editing baselines | Stable Diffusion v1.5 · Object editing | CLIP-Score drop | Hurt |
| Use LocoEdit in place of DiffQuickFix | Stable Diffusion v2.1 · Fact editing | edit effectiveness | Helped |
| Vary the selected number of adjacent controlling layers (ablation) | Stable Diffusion v1.5 LocoGen · Style localization | CLIP-Score | No clear effect |
Surprising findings
- For DeepFloyd, control locations depend on the specific prompt rather than the visual attribute, and closed-form edits are ineffective because T5 encoders use bidirectional attention.
- Causal tracing in SD-XL finds only about 5% of layers causal, and no unique causal state exists in the text encoder for SD-XL or DeepFloyd.
Limitations
- DeepFloyd shows prompt-dependent localization and fails under closed-form editing due to T5 bidirectional encoding.
- Editing efficacy varies across models and attributes; LocoEdit is only at par with baselines for style and slightly worse for objects.
- Evaluation relies on CLIP-Score and a small human study with limited prompts.
Experimental setup
Datasets: prompt sets for objects, style, and facts from prior benchmarks (e.g., trademarked objects, artist styles, factual promp
Metrics: CLIP-Score human rating (1-5) of attribute removal/update
Baselines: DiffQuickFix Concept-Ablation Concept-Deletion causal tracing update all UNet layers
Builds on: causal tracing Concept-Ablation DiffQuickFix classifier-free guidance DDIM
Closest papers by meaning
- Localizing and Editing Knowledge In Text-to-Image Generative Models (ICLR 2024 · similarity 0.93)
- Precise Parameter Localization for Textual Generation in Diffusion Models (ICLR 2025 · similarity 0.89)
- Localizing Knowledge in Diffusion Transformers (NeurIPS 2025 · similarity 0.89)
- Unveiling Concept Attribution in Diffusion Models (NeurIPS 2025 · similarity 0.88)
- Mechanisms of Object Localization in Vision-Language Models (CVPR 2026 · similarity 0.88)
- Continuous, Subject-Specific Attribute Control in T2I Models by Identifying Semantic Directions (CVPR 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
