# Oral 31807

- Kind: Oral
- Talk page and recording: https://iclr.cc/virtual/2025/oral/31807

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

So hi, my name is Bruno and today I want to talk to you about inverse functions for scale with data attribution in diffusion models or in other words how to answer questions like which train data points were responsible for a given generative sample or model output in the division modeling context. So quickly what are influence functions and what kind of questions do they answer? Why should you care about them?
Well, influence functions can help answer questions like how would my model behave right to retrain it with some train examples removed from the train data set.
And this is particularly useful, or you can conceptualize it to be particularly useful in the diffusion context, because it could help answer questions pertaining to copyright, such as how much did a given copyrighted work affect the generation of a particular sample, right? So if my model generates a sample, I could ask, well, if I removed this copyrighted training data point from my training set.
would my model still generate this sample? How much less likely would it be to do so? Or another kind of question that you could ask is what training examples were responsible for some kind of undesirable generated output from my model? So in this case, if I get a sample that I don't like, for example, violence or depicting nudity, and I'm trying to find which examples in the training set were responsible for that.
You can use influence functions to try and identify those examples. And in general, influence functions is a tool that lets you precisely answer this question. It lets you predict the change in a given measurement such as the log marginal probability of generating a given image, for example.
When you remove a particular data point from your training set without actually retraining the model, which is crucial, like that would make the whole thing completely intractable. So influence functions let you...
create plots like these where here I'm showing for every generated sample the training samples that would most change the a proxy for the log marginal log probability of generating the the image rank from most to least and I hope that by the end of this talk you'll have a pretty good idea of what the tools that let you do this scaleably and tractably for diffusion models look like and how they work
So first I'm going to give some quick background on fusion models and influence functions, starting with influence functions. In the most abstract or maybe general setting, you can imagine a model such as a neural network trained on some training loss function that's composed of, per example, training losses, such as this one. And we might want to answer how would the...
Models optimized on this loss function change if I train the model without some, for example, loss terms. To do this, we can try and approximate the change in the optimal model parameters when the training examples are removed. So if we kind of squint and consider model training and deep learning as taking an argument of the training loss function.
We might want to ask what happens when we change the argument in this argument.
And of course this is quite a difficult and nasty problem to try and solve without actual retraining so we can consider what would happen if we take a smooth relaxation of this problem like try and add some smooth structure to the problem to make things easier for coming up with approximations. So we're going to do this by adding an epsilon in front of the pair example loss terms that we're removing from the training loss and ask what happens when we slightly downweight the effect of
effect of some training loss terms in the training loss. Again, setting epsilon to one over the number of training data points recovers the original problem, but we're going to try and ask or see what happens for small epsilon. In particular, under some suitable assumptions and assumptions that in most deep learning theory are slightly unrealistic, this
response function as defined over here is actually continuous and differentiable at epsilon equals to zero which means that we can try and approximate the change in the response function with a first order Taylor expansion and it's exactly what inverse functions do you just only look at the zero for during the first order term in Taylor expansion and use that to predict the change in the optimal model parameters
So you can kind of imagine that when your loss function changes as you keep down weighing the loss terms corresponding to the examples you're trying to remove, the optimum might take some path that's a function of epsilon, and we're just going to approximate it with a linear, with a line that matches the tangent at the current optimal model parameters.
Of course, we're not just interested in the change in the model parameters, we're usually interested in the change in some measurement of the model. So this measurement could be something like the validation loss on a given test sample or in the context of diffusion models, maybe the log probability density of a given image. So we're just going to define influence functions as a first order Taylor expansion.
um of the measurement um of the model for the optimal model parameters for a given epsilon um and this takes a pretty like simple form we just have the measurement of the original optimal model parameters plus um an inner product um between the training loss gradient for the training grades for the training losses that we're removing and the gradient of the measurement function preconditioned by the training loss Hessian
And when you specialize it to the context of diffusion models, again, everything kind of falls into place. For the training loss, you just take the usual score matching loss, at least for the DPMs, for example. And the most natural measurement function is arguably the marginal log probability of a given generated image.
Of course taking radiance of the marginal probability density is kind of challenging so you can conceive of a bunch of proxies to use instead such as the evidence lower bound as used in the DDP end paper or just a training loss which is a re-weighted version of the elbow and we investigate all of those proxies in the paper.
Now it sounds like the whole framework actually just applies to diffusion models quite naturally and easily. So what's the real challenge here? Well, the biggest problem is in how to scale the approximate all the computations involving the Hessian and the Hessian inverse.
And something that's worked very well in many other domains is approximating the Hessian with a chronically factored approximate curvature or K-FAC, which is itself an approximation to a generalized Gaussian Newton matrix or GGN. If you're not familiar with these, that's okay. I think the guiding principle.
um that you might want to keep in mind is when are these uh methods exact um and they're usually exact for a sensibly linearized part of the of the model and um our aim of course there are many choices as we'll see for how to construct these approximations but the guiding principle that
kind of keeps us afloat while trying to figure this out for diffusion models is let's try and make everything exact for a sensibly linearized model. So
What is the GGN? Again, abstracting even a little bit more to try and fit this into the diffusion modeling context, we can consider a very general training loss where we have an expectation of, for example, loss terms. And this expectation can be the empirical sum over data points or it can also involve something like sampling the diffusion time step in the training loss or sampling the noise that's being added to the image.
You can define a GGN for this expectation in this particular way, where the key property is that your, for example, training loss, LZ, decomposes into the two functions, H and F. And we're kind of free to choose H and F. There are multiple options. The first one could be to...
Just said F to be the mapping from parameters to the model output and said H to be the loss function. So something like an L2 loss or like an MSE loss or a cross entropy loss in the context of classification or for the score matching loss. It could be just the final MSE loss or the MSE loss to the noised up samples. And the GGN with the split is exact for linear neural networks, which feels quite natural.
Another option would be to decompose the loss in this kind of weird and awkward way, but it results in something that's called the empirical Fisher. And it's arguably a more strange assumption. It's only exact when the exponential of the negated loss is linear, which is probably rarely the case.
Um, but critically, this is something that actually a lot of prior works trying to do train data attribution in the fusion models have used. They've used this second split. So you can imagine there are many ways to try and fit.
The diffusion modeling loss into the GGN split, you can move the expectations around and consider them to be part of the per example training loss or part of the outer expectations, etc, etc. And again, this guiding principle of exactness for a linear neural network kind of guides us to make direct choices both for the GGN and also for K-FAC.
And concretely, we show that when you make all the right choices, you do get significant improvements in training data attribution performance. So the way people have made these methods is by actually retraining the model with some training examples removed and looking at the correlation to the model output then. And by trying to actually approximate the Hessian well, we see that we get significantly better correlation.
And this results in a method that significantly outperforms everything that has come before.
And so yeah, those are the takeaways for the talk. Picking the right GGN seems to really matter when your goal is to approximate the Hessian. Also, if you're ever using these methods, really use the eigenvalue corrected K-Fike because it's closer to the Hessian and it performs significantly better. And thank you for listening to me.
If there's no other question, you had to skip over the results quite a bit. Could you share the main takeaway in terms of how well this works compared to other compared to others? Yeah, that's a great question. I think what we found is that there are actually quite a few caveats to evaluating these methods. What we observed in one of the numerical observations and challenges that we've noticed is that
Actually for diffusion models, especially for unconditional diffusion models, you can remove very large portions of the training data set and the marginal probability density on the direct samples barely changes. So there is some critical threshold in terms of data set size after which the...
The probability distribution implied by the model just doesn't seem to change. But, yeah, we observe that the samples that are being attributed seem significantly more meaningful than from the other methods. Thank you. Thank you so much. Let's thank Paul again.
