Influence Functions

Description

Influence functions estimate which training examples most affected a model's prediction on a particular test example. For each training example, they estimate how much the model's loss on the test example would change if that example counted slightly more or slightly less, which approximates removing it and retraining without actually doing so. The estimate combines the gradient of the loss at the test and training points with the Hessian (the matrix of second derivatives, which describes the curvature of the training loss). The output ranks training examples as helpful or harmful for that prediction; because the theory assumes a smooth, convex loss, for deep networks the ranking is approximate, pointing to examples worth inspecting for mislabelled or unrepresentative cases rather than proving why the model erred. In a bias-diagnosis use, the rejections of a group already known from a separate check to be rejected more often are explained one by one, to find the training records that drive them.

Example Use Cases

Explainability

A hospital analytics team finds that its readmission model misclassifies many children. For a misclassified child, influence functions single out a handful of paediatric training records with far more influence than any others, showing that the training data holds very few children. The team collects more paediatric data before deciding whether the model can be used on that group.

An email-security team asks why its spam filter blocked a legitimate supplier invoice. It lists the training emails with the most influence on that decision, finds near-duplicate phishing messages with a similar layout, and decides whether to relabel, remove or down-weight them before retraining the filter.

Fairness

A bank's model-risk team has found, from a separate check of approval rates by group, that applicants from one protected group are rejected more often. It takes a sample of that group's rejected applications and lists, for each, the training loans with the greatest influence on the rejection. It reviews whether those records are historical rejections made under discontinued underwriting rules or by branches with a known bias, and decides whether to remove or re-weight them.

Limitations

  • Exact influence needs the inverse of the Hessian, which is out of reach for networks with millions of parameters. Implementations approximate it with Hessian-vector products or block-diagonal and low-rank forms, which still costs extra passes over the training data for every prediction explained and adds error. Plan to explain a sample of decisions, not all of them.
  • Needs the full training set, the loss function and parameters at or near a minimum of the training loss. A model delivered as an API or a finished file, or trained on data the assessor cannot see, cannot be examined. For models that are early-stopped or not trained to a minimum, the paper adds a damping term to the Hessian, one more setting that can change the ranking.
  • The derivation assumes a convex, twice-differentiable loss. On a non-convex CNN the paper still found a 0.86 correlation with actual retraining, but a larger study found estimates often erroneous for deeper networks and dependent on architecture, weight decay and the test point (Basu et al., 2020). Check the estimates against real retraining on a few examples before relying on them.
  • Losses with kinks, such as the hinge loss of a support vector machine, break the method. In the paper, influence computed on the unsmoothed hinge loss considerably overestimated the effect of removal, and a smooth approximation of the loss was needed. Check that the loss is smooth for the model in hand, or smooth it for the calculation.

Resources

Research Papers

Understanding Black-box Predictions via Influence Functions
Pang Wei Koh and Percy Liang•Jan 1, 2017

How can we explain the predictions of a black-box model? In this paper, we use influence functions — a classic technique from robust statistics — to trace a model's prediction through the learning algorithm and back to its training data, thereby identifying training points most responsible for a given prediction. To scale up influence functions to modern machine learning settings, we develop a simple, efficient implementation that requires only oracle access to gradients and Hessian-vector products. We show that even on non-convex and non-differentiable models where the theory breaks down, approximations to influence functions can still provide valuable information. On linear models and convolutional neural networks, we demonstrate that influence functions are useful for multiple purposes: understanding model behavior, debugging models, detecting dataset errors, and even creating visually-indistinguishable training-set attacks.

Software Packages

influence-release (kohpangwei/influence-release)
Aug 29, 2026
Kronfluence (pomonam/kronfluence)
Oct 1, 2026

Influence Functions with (Eigenvalue-corrected) Kronecker-Factored Approximate Curvature

Tutorials

Kronfluence CIFAR-10 example

Influence Functions with (Eigenvalue-corrected) Kronecker-Factored Approximate Curvature - pomonam/kronfluence

Documentations

The influence function — pyDVL documentation

None

Tags

Explainability Dimensions

Attribution Methods:
Instance-Based Methods:
Explanation Target:
Explanatory Scope:

Fairness Dimensions

Other Categories

Data Requirements:
Data Type:
Evidence Type:
Expertise Needed:
Technique Type: