Introduction
As text-to-image diffusion models become increasingly sophisticated, understanding the relationship between training data and generated outputs has become a critical challenge. When a model produces a specific image—such as a "bus on a freeway"—which training samples were most influential in shaping that result? This is the core question of data attribution.
The gold standard for defining influence is counterfactual: an image is considered influential if its removal from the training set would significantly alter or prevent the generation of the target output. However, retraining large-scale diffusion models thousands of times to test every possible data subset is computationally prohibitive. Existing methods, such as influence functions or visual similarity searches, often fail to capture the complex semantic relationships within generative models. This paper introduces a novel, tractable approach: Attribution by Unlearning.
Methodology: Attribution by Unlearning
The researchers propose a "role reversal" strategy. Instead of iteratively removing training images to see what happens, the method focuses on the synthesized output itself.
The Unlearning Process
The core idea is to force the model to "forget" the specific synthesized image. By observing which training samples become harder for the model to recognize after this forgetting process, the most influential data points can be identified.
Controlled Forgetting via EWC
To ensure the unlearning process is surgical rather than destructive, the authors employ Elastic Weight Consolidation (EWC). By using the Fisher Information Matrix as a regularizer, the model is constrained to change only the weights that are least critical to its general knowledge. This prevents catastrophic forgetting and ensures that the weight shifts are directly related to the specific synthesized image being unlearned.
Targeting Cross-Attention
The authors identified that the most effective attribution occurs when updates are restricted to the cross-attention layers—specifically the Key and Value projection matrices. This aligns with the architectural intuition that cross-attention is where the model binds textual prompts to visual features.
Measuring Influence
Once the model has unlearned the synthesized image, the researchers measure the training loss for every image in the original dataset. Training images that exhibit the largest increase in loss are deemed the most influential. The logic is that if the weights modified to forget the output were also vital for a specific training image, that image likely contributed significantly to the model's ability to generate that output.
Experimental Setup and Datasets
The method was evaluated using two primary benchmarks:
- MSCOCO: Utilizing a dataset of approximately 118,000 images, the authors performed "gold-standard" evaluations by retraining models from scratch to verify the predicted influence.
- Customized Model Benchmark: This included 20 models (10 object-centric and 10 artist-style) trained on specific exemplars (similar to DreamBooth). This provided a ground-truth scenario where the influential images were known a priori.
Key Results
The effectiveness of the method was validated using a "leave-K-out" approach, where the top 500, 1,000, or 4,000 influential images were removed before retraining.
- Quantitative Impact: Attribution by Unlearning resulted in a significantly higher increase in training loss ($\Delta L$) and a greater deviation in generated output ($\Delta G$) compared to established baselines like TRAK or DINO.
- Qualitative Accuracy: Unlike simpler methods that often rely on color or object similarity, this approach identified training images that matched the specific pose and composition of the generated output.
- Generalization: The method performed exceptionally well across both object-centric and artistic-style models, demonstrating its versatility across different types of influence.
Discussion and Limitations
Beyond global image attribution, the method can be adapted for spatially-localized attribution. By applying the unlearning process only to pixels within a specific bounding box, researchers can identify which training data influenced a particular object within a complex scene.
However, several challenges remain:
- Computational Scalability: While unlearning the query image is efficient, calculating reconstruction loss across massive datasets (e.g., LAION-5B) remains a significant bottleneck.
- Group Influence: The current framework treats images as individual contributors and does not yet account for "collusion" or collective influence among groups of images.
- Granular Attribution: Future work may explore attributing specific stylistic elements, such as lighting or brushstrokes, rather than entire objects or compositions.
Conclusion
Attribution by Unlearning provides a robust and theoretically grounded framework for understanding the provenance of generated content in diffusion models. By leveraging surgical forgetting and regularization, it offers a path toward greater transparency and accountability in generative AI.
Summary updated