Abstract Classical influence functions face significant challenges when applied to deep neural networks, primarily due to non-invertible Hessians and high-dimensional parameter spaces. We propose the local Bayesian influence function (BIF), an extension of classical influence functions that replaces Hessian inversion with loss landscape statistics that can be estimated via stochastic-gradient MCMC sampling. This Hessian-free approach captures higher-order interactions among parameters and scales efficiently to neural networks with billions of parameters. We demonstrate state-of-the-art results on predicting retraining experiments.
Introduction: The Challenge of Training Data Attribution
If a Large Language Model (LLM) gives a biased answer or a vision model misclassifies an image, researchers and practitioners need to know: Which specific training examples caused this behavior? This challenge is the focus of Training Data Attribution (TDA).
The "gold standard" for TDA has historically been Influence Functions (IF). However, classical IFs present two major deal-breakers for modern deep learning:
- The Scaling Problem: They require inverting the Hessian matrix (a matrix of second-order derivatives). For a model with billions of parameters, this matrix is computationally intractable to store, let alone invert.
- The Singularity Problem: Deep neural networks often feature "degenerate" loss landscapes where the Hessian is not invertible. This singularity breaks the standard mathematical formulation for influence functions.
Existing workarounds, such as EK-FAC, rely on complex approximations that introduce structural biases and demand a massive, expensive "fitting" phase before attribution can even begin.
Methodology: Local Bayesian Influence Functions (BIF)
To overcome these limitations, this paper proposes shifting from a point-estimate view to a distributional view. Instead of analyzing a single set of "best" weights, the authors examine a "localized Bayesian posterior"—a small neighborhood of likely weights surrounding the final trained model.
Key Innovations: * The Covariance Identity: Drawing inspiration from statistical physics, the authors demonstrate that "influence" can be formulated as the negative covariance between the loss of a training point and the loss of a query point across this local distribution. * Hessian-Free Estimation: To sample from this distribution, the method employs Stochastic Gradient Langevin Dynamics (SGLD). This Markov Chain Monte Carlo (MCMC) sampling technique requires only first-order gradients, completely bypassing the need to compute or invert the Hessian matrix. * Architecture Agnostic: Unlike previous approximations tailored to specific layers (like Linear or Conv2D), BIF is applicable to any differentiable architecture, including the complex attention mechanisms found in Transformers.
Experimental Setup
The researchers validated BIF across diverse domains and scales:
- Vision: CIFAR-10 was used for quantitative retraining tests, and ImageNet for qualitative visualization using Inception-v1.
- Language: The Pile and Wikitext datasets were utilized for finetuning experiments.
- Models: The approach was tested on the Pythia model suite, scaling from 14 million up to 2.8 billion parameters to demonstrate true scalability.
Key Insights and Results
The BIF approach yields several critical advantages and insights into model behavior.
Higher-Order Geometry and Efficiency Classical IF is essentially a linear approximation based on a first-order Taylor expansion. Because BIF samples the local landscape, it successfully captures higher-order interactions between parameters that linear methods miss. Furthermore, methods like EK-FAC require a massive up-front computational investment to fit the Hessian approximation. BIF has zero up-front cost, making it highly efficient for targeted attribution tasks where only a few specific queries are of interest. For the largest models tested (2.8B parameters), BIF was two orders of magnitude faster than EK-FAC in evaluation time and maintained a manageable memory footprint.
Semantic Mapping in LLMs In LLMs, per-token BIF analysis revealed fascinating semantic connections.
For instance, the method showed that the presence of the digit "3" in a training set strongly influenced the model's generation of the word "three" in a query. It also successfully identified cross-lingual influences, such as the English word "She" influencing the generation of the French word "elle".
Limitations and Future Work
The authors transparently note several trade-offs:
- Sampler Sensitivity: BIF's accuracy relies heavily on the quality of the SGLD sampling. Poorly tuned hyperparameters (like step size or temperature) can degrade results.
- Cost per Query: While lacking an up-front cost, BIF requires several forward passes for every query. For tasks requiring millions of attributions, amortized methods might eventually become more efficient.
- Language Model Complexity: In certain LLM finetuning experiments, BIF slightly underperformed EK-FAC, likely due to the extreme difficulty of sampling effectively in the high-dimensional, complex loss landscapes of language models.
Future work will explore more advanced MCMC samplers and aim to develop a principled approach for selecting the localization strength ($\gamma$), which currently functions as a hyperparameter.
Summary updated