Bayesian Influence Functions for Hessian-Free Data Attribution

Philipp Alexander Kreer, Wilson Wu, Maxwell Adam, Zach Furman, Jesse Hoogland · DOI

Introduction

Understanding why a machine learning model makes a specific prediction is a cornerstone of AI safety and interpretability. Training Data Attribution (TDA) aims to identify the specific training examples that most significantly influence a model's output. While Influence Functions (IF) have long been the theoretical gold standard for TDA, their practical application to modern deep learning has been severely limited by computational constraints. This paper introduces the Local Bayesian Influence Function (BIF), a "Hessian-free" alternative that scales to models with billions of parameters by leveraging stochastic sampling.

The Hessian Bottleneck in Data Attribution

Classical Influence Functions rely on the inverse of the Hessian matrix—the second-order derivatives of the loss function—to estimate how a small change in a training point's weight affects the model's parameters. For modern Deep Neural Networks (DNNs), this approach faces two major hurdles:

  1. Invertibility: The Hessian is often singular or poorly conditioned, requiring arbitrary dampening terms that can mask important higher-order interactions.
  2. Scalability: For models like Large Language Models (LLMs) with billions of parameters, the Hessian matrix is too massive to compute, store, or invert. Even sophisticated approximations like EK-FAC introduce structural biases and struggle with complex architectures like attention layers.

The Local Bayesian Approach

The proposed Local Bayesian Influence Function (BIF) bypasses the Hessian entirely. Instead of analyzing the local curvature at a single point (the final trained weights), BIF considers a distribution of weights in the neighborhood of the solution.

Comparison of classical Influence Functions (IF) and the proposed Bayesian Influence Functions (BIF). BIF replaces the intractable Hessian inversion with a scalable covariance estimation using SGLD.

The core innovation lies in a mathematical identity that relates the inverse Hessian to the covariance of losses over a local posterior distribution:

  • From Inversion to Covariance: BIF estimates influence as the negative covariance between the sample loss and the query loss: $BIF \approx -Cov(\text{sample loss}, \text{query loss})$.
  • Stochastic Sampling: To estimate this covariance without computing the Hessian, the authors use Stochastic Gradient Langevin Dynamics (SGLD). By running a small number of additional forward and backward passes around the final model checkpoint, BIF captures the necessary statistics efficiently.
  • Architecture Agnostic: Because it relies on sampling rather than specific matrix decompositions, BIF works on any differentiable model, including those with normalization and attention layers that trip up other methods.

Scalability and Performance

The authors evaluated BIF across diverse domains, including ImageNet (Inception-v1) and the Pythia model suite (up to 2.8B parameters).

A key advantage of BIF is its initialization speed. Because it avoids the expensive "fit phase" required by Hessian-based approximations, BIF can be up to two orders of magnitude faster to initialize for massive models. In terms of predictive accuracy, BIF matches or exceeds state-of-the-art baselines like EK-FAC when measured by the Linear Datamodelling Score (LDS), which quantifies how well an attribution method predicts the impact of data removal.

Qualitative Insights: Per-Token Attribution

One of the most compelling features of BIF is its ability to perform fine-grained, per-token attribution in LLMs. This level of granularity allows researchers to trace specific semantic influences within the training data.

Qualitative examples of per-token attribution using BIF on Large Language Models. The method captures semantic relationships like translation and numerical correspondence.

As shown in the qualitative results, BIF successfully maps complex relationships:

  • Translation: Identifying that the English word "She" in a query is influenced by the French word "elle" in the training data.
  • Numerical Logic: Linking the digit "3" to the word "three" across different contexts.
  • Semantic Mapping: Capturing synonyms and thematic connections that second-order quadratic approximations might miss.

Conclusion and Future Work

Bayesian Influence Functions represent a significant step forward in making data attribution practical for the LLM era. By replacing rigid Hessian inversions with flexible stochastic sampling, BIF offers a scalable, architecture-agnostic, and high-fidelity tool for model interpretability.

While BIF is highly efficient for initialization, its per-query cost (requiring multiple posterior draws) remains a trade-off. Future research into more advanced MCMC samplers and "dynamic data attribution" promises to further enhance the utility of this Bayesian framework.

Summary updated

BibTeX
@inproceedings{kreer2026bayesian,
  author = {Philipp Alexander Kreer and Wilson Wu and Maxwell Adam and Zach Furman and Jesse Hoogland},
  title = {{Bayesian Influence Functions for Hessian-Free Data Attribution}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=YEBpZVm70i},
}
Figure