Fast Data Attribution for Text-to-Image Models

Sheng-Yu Wang, Aaron Hertzmann, Alexei A Efros, Richard Zhang, Jun-Yan Zhu

Introduction

As text-to-image generative models like Stable Diffusion become ubiquitous, understanding the provenance of their outputs is increasingly critical. Data attribution—the task of identifying which training samples most significantly influenced a specific generated image—serves as a foundation for artist compensation, model debugging, and copyright clarification.

The theoretical "gold standard" for attribution is counterfactual: determining how an output would change if a specific training image were removed. However, retraining large-scale models for every query is computationally prohibitive. Existing approximations, such as Influence Functions or Attribution by Unlearning (AbU), often require hours of GPU time per query, rendering them impractical for real-time applications.

Methodology: Distilling Influence

To overcome these latency barriers, we propose a distillation-based approach. Rather than performing intensive computations at query time, we train a lightweight "student" model to mimic the outputs of a high-quality but computationally expensive "teacher" model.

The proposed distillation framework, where a slow 'teacher' (Attribution by Unlearning) provides ranking signals to train a fast 'student' model.

The Teacher-Student Framework

  1. The Teacher (AbU+): We utilize an enhanced version of "Attribution by Unlearning." By incorporating Eigenvalue-corrected Kronecker-factorized Approximate Curvature (EKFAC), we better approximate the model's internal geometry, leading to more accurate influence scores.
  2. Learning to Rank (LTR): A key insight is that predicting exact numerical influence scores is often unstable. Instead, we frame attribution as a ranking problem. The student model is trained using a pointwise binary cross-entropy loss to replicate the relative ordering of influential images determined by the teacher.
  3. The Student Model: The student is a compact Multi-Layer Perceptron (MLP) built upon frozen, off-the-shelf features, specifically DINO visual embeddings and CLIP text embeddings.
  4. Efficient Curation: Training is made feasible through a two-stage process: a fast retriever identifies the top 10,000 candidate images for a given query, and the slow teacher ranks only this subset to provide training signals.

Key Insights

Our research highlights several critical aspects of data attribution in large-scale generative models:

  • Ranking vs. Regression: Treating attribution as a ranking task significantly improves stability and retrieval performance compared to direct score regression.
  • Visual vs. Textual Influence: Contrary to intuition, the most visually similar training image is not always the most influential. In large models, textual features often play a dominant role; a prompt for a "blue fox" may be influenced by disparate images of "foxes" and "blue objects" that do not resemble the final composite.
  • Generalization: We found that a student model trained on only a few thousand high-quality attribution examples can generalize effectively across massive datasets like LAION-400M.

Performance and Scalability

The proposed method achieves unprecedented efficiency gains. As shown in the figure below, our approach provides a throughput orders of magnitude higher than previous state-of-the-art methods.

Comparison of attribution quality vs. throughput, showing the massive speedup achieved by the proposed method compared to existing baselines.

Quantitatively, our method is approximately 2,500x faster than D-TRAK and ~400,000x faster than the original AbU. In "leave-K-out" validation tests on MSCOCO, the student model successfully identified images whose removal significantly degraded the model's ability to recreate specific targets, matching or exceeding the accuracy of the slow teacher. This work represents the first successful demonstration of accurate data attribution on a full-scale Stable Diffusion model.

Limitations and Future Directions

While this distillation approach offers a massive leap in speed, it inherits the systematic biases of the teacher model (AbU+). Additionally, while the model excels at ranking, it does not currently provide a precise magnitude of influence. Future research will explore the applicability of this framework to newer architectures, such as Flow Matching models and one-step generators.

Summary updated

BibTeX
@inproceedings{wang2025fast,
  author = {Sheng-Yu Wang and Aaron Hertzmann and Alexei A Efros and Richard Zhang and Jun-Yan Zhu},
  title = {{Fast Data Attribution for Text-to-Image Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=3ln8F2nOuA},
}
Figure