TL;DR
Data attribution for text-to-image models helps identify which training images most heavily influenced a generated output, but existing methods are far too computationally expensive for real-world deployment. This paper introduces a distillation approach that maps a highly accurate but slow "unlearning" attribution method into a fast feature embedding space. By turning attribution into a simple vector search, the authors achieve a massive 2,500× to 400,000× speedup, enabling real-time data attribution for large-scale models like Stable Diffusion.
What Problem Does This Paper Address?
When a text-to-image model generates an image, a crucial question arises: Which training images most heavily influenced this specific output? Answering this—known as data attribution—is essential for content creator compensation, copyright resolution, and explaining model behavior.
The gold standard for data attribution is counterfactual evaluation: if we remove an influential image from the training set and retrain the model from scratch, the model should lose its ability to generate that specific output. Because retraining a model millions of times is computationally impossible, researchers use approximations like influence functions or "Attribution by Unlearning" (AbU). AbU works by forcing the model to "forget" the generated image and observing which training images are inadvertently forgotten as a proxy.
However, these methods are incredibly slow, often requiring hours per query because they must evaluate the entire training set at runtime. This computational cost vastly exceeds the revenue generated by the image itself, making real-world deployment economically unfeasible.
Methods
The authors propose Fast Data Attribution (FDA), a framework that distills a slow, accurate teacher attribution method into a fast feature embedding space.
- The Teacher (AbU+): The authors upgrade the standard AbU method by replacing its diagonal Fisher information matrix approximation with Eigenvalue-corrected Kronecker Factorization (EK-FAC). This creates a much more accurate teacher method, termed AbU+.
- Two-Stage Data Curation: Running AbU+ across an entire massive dataset to gather training labels is too expensive. To bypass this, the authors use a two-stage approach: they first find the top $K$ nearest neighbors of a generated image using off-the-shelf features, and then only compute the expensive AbU+ scores within this subset.
- Learning-to-Rank (LTR): They train a lightweight Multi-Layer Perceptron (MLP) on top of frozen, pre-trained encoders (combining DINO visual features and CLIP text features). Instead of regressing raw scores, they optimize a pointwise learning-to-rank objective using a binary cross-entropy loss on normalized ranks.
- Fast Inference: At deployment time, the expensive attribution algorithm is entirely bypassed. The system simply extracts the embedding of the generated image and performs a rapid cosine-similarity search against the pre-computed embeddings of the training dataset.
Datasets
The method was evaluated on two primary testbeds:
- MSCOCO: A latent diffusion model was trained on the 100k image subset. Evaluation was conducted using a standard test set of 110 synthesized queries to allow for expensive counterfactual retraining verification.
- LAION-400M: To demonstrate real-world scalability, the authors applied their method to Stable Diffusion v1.4 trained on LAION. Generated images and captions for the queries were sourced from DiffusionDB.
Key Insights and Ideas
- Simple Loss Preserves Fast Search: While complex ordinal regression losses provide excellent rankings, they require multi-head network architectures that are incompatible with fast vector similarity search at inference time. The authors discovered that a simple cross-entropy loss on normalized ranks matches the accuracy of ordinal loss while preserving standard, lightning-fast cosine-similarity search. Conversely, direct MSE regression fails to converge entirely.
- Feature Synergy Shifts After Tuning: Before tuning, text-only embeddings (CLIP Text) naturally outperform image-only embeddings for attribution tasks. However, after tuning, the image embeddings (DINO) become significantly more powerful. Combining both visual and textual signals (DINO + CLIP Text) yields the highest overall rank-prediction accuracy.
- The "Elbow" Effect in Data Scaling: You do not need a massive dataset of attribution scores to train the ranker. The authors observed diminishing returns after a few thousand query examples, meaning a relatively small but diverse set of teacher-labeled queries is sufficient to capture the underlying ranking signal.
Key Results
- Orders of Magnitude Speedup: As shown in Figure 1, the proposed method delivers a 2,500× to 400,000× speedup compared to optimization-based methods like AbU and D-TRAK, reducing query times from hours to mere milliseconds or seconds.
- High Counterfactual Accuracy: On MSCOCO, when the top-ranked images identified by the distilled model were removed and the diffusion model was retrained from scratch, it caused significant loss deviation and image degradation—performing comparably to (and sometimes outperforming) the slow teacher method.
- First Scale to Stable Diffusion: This work represents the first successful data attribution application on a full-scale Stable Diffusion model trained on hundreds of millions of images (LAION-400M), demonstrating that scalable attribution is achievable in production environments.
Limitations and Future Work
- Loss of Absolute Influence Magnitude: The learning-to-rank approach only predicts the relative order of influential images. It does not output the raw attribution score, meaning information about the absolute degree of influence (or whether the influence is highly concentrated vs. diffuse) is lost.
- Teacher Dependency: Because this is a distillation approach, the model inherently inherits any systemic biases, limitations, or failure modes present in the teacher method (AbU+).
- Unverifiable Scale: Due to the extreme financial and computational cost of retraining Stable Diffusion from scratch, true counterfactual validation (leave-K-out retraining) could only be executed on the smaller MSCOCO dataset. Validation on LAION relies strictly on rank-prediction metrics.
Summary updated