Generative AI is experiencing a massive shift from UNet-based architectures to Diffusion Transformers (DiTs) like FLUX and PixArt-$\alpha$. While we have developed a decent understanding of how to "locate" knowledge in UNets, DiTs have largely remained a black box.
When researchers want to adapt these models—either to teach them a new subject (personalization) or make them forget a harmful concept (unlearning)—they typically fine-tune the entire model. This "sledgehammer" approach is computationally expensive and often leads to "catastrophic interference," where the model forgets how to generate unrelated concepts or loses overall image quality.
This paper introduces a model-agnostic method to pinpoint exactly which blocks in a DiT store specific types of knowledge, such as artistic styles or copyrighted characters. By performing "targeted surgery"—fine-tuning only these knowledge-bearing blocks—the authors achieve faster, more memory-efficient model personalization and unlearning while significantly reducing interference with the model's original capabilities.
Methodology: Finding the Knowledge
The core of their approach relies on a metric called Attention Contribution to map out the model's internal knowledge distribution.
- Tracing the Flow: Rather than just looking at raw attention weights, the authors calculate how much a specific text token (e.g., "The Batman") influences the final embeddings of the image tokens at each layer. This involves analyzing the product of attention weights and the value/output projection matrices.
- Ranking Blocks: By averaging these scores across multiple prompts and seeds, they create a "knowledge map" of the model, ranking blocks from most to least influential for a given concept.
- Validation via Intervention: To prove these blocks are actually "in charge," they perform a prompt intervention. They feed the model a specific prompt but swap the text information with a neutral placeholder (e.g., replacing "Batman" with "a character") at the identified "top-K" blocks. If the knowledge is truly localized there, the specific concept disappears from the output while the rest of the scene remains intact.
- Targeted Fine-Tuning: For applications like DreamBooth (personalization) or concept erasure, they restrict all weight updates strictly to these identified blocks.
The LOCK Benchmark
To support this research, the authors introduced a new, large-scale benchmark called LOCK (Localization of Knowledge). It covers six diverse categories: Artistic Styles, Copyrighted Characters, Celebrities, Safety/NSFW content, Landmarks, and Animals. Featuring over 1,100 unique artistic styles and thousands of paired prompts (specific vs. neutral), it is significantly larger than previous localization datasets. Evaluation relies on a suite of metrics including CLIP scores for semantic alignment, LLaVA for visual verification, and Contrastive Style Descriptors (CSD) for stylistic consistency.
Key Insights and Ideas
- Knowledge is Not Created Equal: Some concepts are highly "concentrated" in just a few blocks (like copyrighted characters in FLUX), while others are "diffuse" and spread across the entire model (like general animal categories).
- Architecture Dictates Organization: Different DiTs organize knowledge differently. For instance, SANA tends to concentrate knowledge in a very narrow set of blocks, whereas PixArt-$\alpha$ distributes it more widely.
- Complexity vs. Localization: There is a fascinating correlation between the nature of a style and its localization. Abstract, minimalist styles are localized in very few blocks, while highly detailed, textured styles require many more blocks to represent.
- Cross-Attention is the Anchor: Through ablation studies, the authors confirmed that the cross-attention modules are the primary "gatekeepers" for injecting textual knowledge into the image generation process.
Key Results and Applications
By applying this localization framework, the authors demonstrated significant improvements in two key areas:
- Efficiency Gains: Localized fine-tuning resulted in a 15–20% speedup in training time and a ~30% reduction in memory usage compared to full-model fine-tuning.
- Superior Personalization: In DreamBooth experiments, the localized approach actually outperformed full fine-tuning. It achieved better prompt alignment and preserved "surrounding identity" much better (e.g., learning a specific dog without ruining the model's ability to generate other breeds).
- Effective Unlearning: The method successfully erased targeted concepts (like NSFW content or specific artist styles) as effectively as full-model tuning, but with much less collateral damage to the model's general generative quality (measured by FID).
Limitations and Future Work
The authors acknowledge a few key hurdles. Currently, the method ranks blocks by importance, but it doesn't automatically determine the optimal number of blocks ($K$) to intervene upon; users still have to pick a threshold. Furthermore, because there is no "gold standard" map of where knowledge should be in a neural network, researchers must rely on proxy metrics like CLIP and LLaVA to validate findings.
Future work could involve automatically estimating the required number of blocks by analyzing internal signals like the entropy or "peakiness" of the attention contribution scores.
Summary updated