Abstract
Diffusion models have led to significant advancements in generative modelling. Yet their widespread adoption poses challenges regarding data attribution and interpretability. In this paper, we aim to help address such challenges in diffusion models by developing an influence functions framework. Influence function-based data attribution methods approximate how a model's output would have changed if some training data were removed. In supervised learning, this is usually used for predicting how the loss on a particular example would change. For diffusion models, we focus on predicting the change in the probability of generating a particular example via several proxy measurements. We show how to formulate influence functions for such quantities and how previously proposed methods can be interpreted as particular design choices in our framework. To ensure scalability of the Hessian computations in influence functions, we systematically develop K-FAC approximations based on generalised Gauss-Newton matrices specifically tailored to diffusion models. We recast previously proposed methods as specific design choices in our framework and show that our recommended method outperforms previous data attribution approaches on common evaluations, such as the Linear Data-modelling Score (LDS) or retraining without top influences, without the need for method-specific hyperparameter tuning.
Introduction
As diffusion models like Stable Diffusion or Midjourney become central to the creative economy, a pressing question has emerged: which training images are responsible for a specific generated output? This question is critical for AI interpretability and addressing copyright concerns. In supervised learning, influence functions estimate how a model’s loss on a test point would change if a specific training point were removed. However, applying this to diffusion models is difficult due to the computational cost of calculating the Hessian matrix and the complexity of diffusion objectives across multiple timesteps.
Methods
The proposed framework adapts influence functions to diffusion models through several key technical contributions:
- K-FAC for Diffusion: Kronecker-Factored Approximate Curvature (K-FAC) is used to approximate the Hessian. The authors develop an "expand" variant specifically for U-Net architectures (convolutions and attention) common in diffusion models.
- Generalized Gauss-Newton (GGN) Matrices: The authors argue that the standard "Empirical Fisher" is a poor proxy for the Hessian in non-linear models. They derive a GGN matrix specifically for the diffusion objective, termed the "MC-Fisher" approach.
- Proxy Measurements: Since exact generation probability is hard to compute, the framework evaluates proxies: standard diffusion loss, the Evidence Lower Bound (ELBO), and the probability of the sampling trajectory.
- Int8 Quantization: To manage the massive gradients required, 8-bit quantization is employed, which outperformed SVD-based compression in these tasks.
Results and Analysis
The framework was evaluated on CIFAR-10 and a CIFAR-2 subset (cars and horses) using the Linear Data-modelling Score (LDS) and retraining experiments.
Quantitative Performance
K-FAC Influence consistently outperformed baselines like TRAK and D-TRAK. In "leave-out" tests, removing the "top influences" identified by this method resulted in a significantly higher increase in loss for the target image compared to random removal. The K-FAC approach is also notably less sensitive to the "damping" hyperparameter than previous methods.
Qualitative Relevance
As shown in Figure 1, the "top influences" identified are often perceptually similar to the generated sample, such as identifying specific types of trucks or planes, providing a sanity check for the method's interpretability.
Key Insights
- MC-Fisher Advantage: Linearizing the model by treating noise prediction as the output (rather than final loss) provides a more accurate influence estimate.
- Timestep Proxies: Surprisingly, losses at higher (noisier) timesteps are often better proxies for predicting changes in lower (cleaner) timestep losses than the losses themselves.
Conclusion
While the method excels at ranking influential images, numerical accuracy in predicting exact loss changes remains a challenge. Future work will focus on finding better proxies for marginal generation probability and scaling these techniques to larger foundational models like Stable Diffusion XL.
Summary updated