Introduction
As diffusion models like Stable Diffusion and Midjourney become integral to the creative economy, the ability to trace generated outputs back to their training data has become a legal and ethical necessity. Data attribution aims to identify which specific training images most influenced a model's particular output. This is crucial for addressing copyright concerns, understanding model behavior, and removing "poisoned" or undesirable data.
Traditional methods, such as retraining the model multiple times while omitting specific data points (Leave-One-Out), are computationally prohibitive for large-scale diffusion models. Influence functions offer a mathematically grounded alternative by using the Hessian matrix of the loss landscape to estimate the impact of training points. However, applying these to diffusion models introduces significant challenges in scalability and complexity. This paper introduces a scalable framework that leverages Kronecker-Factored Approximate Curvature (K-FAC) and a model-based Generalized Gauss-Newton (GGN) approximation to achieve accurate data attribution in diffusion models.
Methodology
The proposed framework addresses the computational bottlenecks of influence functions through several technical innovations:
Hessian Approximation with K-FAC and EK-FAC
The primary challenge in influence functions is the inversion of the Hessian matrix, which is too large for modern neural networks. The authors utilize Kronecker-Factored Approximate Curvature (K-FAC) to approximate the Hessian as a product of smaller matrices. They specifically employ the EK-FAC (Expand K-FAC) variant, which better handles the weight-sharing architectures typical in the convolutional and attention layers of diffusion models.
Model-based GGN
While previous methods often relied on the "Empirical Fisher" ($GGN^{loss}$), the authors demonstrate that a model-based Generalized Gauss-Newton ($GGN^{model}$) approach is more theoretically sound for the squared-error loss used in diffusion training. This refinement leads to more stable and accurate influence estimates.
Efficient Storage and Proxies
To manage the memory requirements of storing gradients for large datasets, the authors found that 8-bit quantization (int8) is highly effective, outperforming SVD-based compression in this context. Additionally, because calculating the exact probability of a generated image is difficult, the framework evaluates several proxies, including the Evidence Lower Bound (ELBO) and simple diffusion loss.
Experimental Setup
The framework was evaluated across three diverse benchmarks:
- CIFAR-10: A standard dataset of 50,000 small images.
- CIFAR-2: A subset containing "cars" and "horses" to test class-specific attribution.
- ArtBench-10: A dataset of 60,000 artworks across 10 styles, providing a high-resolution (256x256) creative context for testing stylistic attribution.
Results and Discussion
The effectiveness of the method was quantified using the Linear Data-modelling Score (LDS), which measures the correlation between predicted influence and actual changes observed after retraining.
Quantitative Performance
The K-FAC-based influence functions consistently outperformed existing methods like TRAK and D-TRAK across all tested datasets. In data removal experiments, removing the "top influences" identified by this method resulted in a significantly higher increase in loss compared to other methods, confirming that the framework successfully identifies the most critical training points.
Qualitative Analysis
Qualitative results demonstrate that the identified "top influences" share clear stylistic and structural similarities with the generated samples. As shown in Figure 1, the method distinguishes between images that positively contribute to a sample's features and those that are neutral or even negatively correlated.
Key Observations
- The Timestep Paradox: Interestingly, model behavior at high-noise timesteps (where the image is mostly noise) often serves as a better proxy for predicting influence at low-noise timesteps than the low-noise timesteps themselves.
- Robustness to Damping: Unlike previous methods that are highly sensitive to the "damping" hyperparameter, the K-FAC approach remains stable across a wide range of values, reducing the need for extensive tuning.
- Stability in Large Models: In very large models, the probability of generating a specific image becomes remarkably stable regardless of the specific training subset used. This suggests that for massive models, "perceptual" attribution (finding similar source images) may be more practical than "numerical" attribution (predicting exact probability shifts).
Conclusion
This research provides a robust and scalable framework for data attribution in diffusion models. By refining the mathematical approximations used in influence functions, the authors have created a tool that is both more accurate and easier to deploy than previous state-of-the-art methods. While challenges remain in predicting exact numerical changes and reducing computational costs further, this work represents a significant step toward transparency and accountability in generative AI.
The implementation is available at https://github.com/BrunoKM/diffusion-influence.
Summary updated