TL;DR
The Versatile Influence Function (VIF) extends data attribution—the ability to trace a model's prediction back to specific training points—to complex "non-decomposable" loss functions like contrastive and ranking losses. By using a finite-difference approximation rooted in robust statistics, VIF provides attribution that is nearly as accurate as brute-force retraining but up to 1,000 times faster.
The Challenge of Non-Decomposable Losses
In machine learning, we often want to know: "Which training data points most influenced this specific prediction?" This process is known as data attribution, and the standard tool for it is the Influence Function (IF).
However, traditional IFs have a major limitation: they only work for "decomposable" loss functions. These are losses that can be written as a simple sum of individual losses for each data point (like standard cross-entropy).
Modern machine learning frequently relies on non-decomposable losses, where a unit loss term depends on multiple data points. Examples include:
- Contrastive Loss: A single loss term might compare an "anchor" point to a "positive" point and several "negative" points. Removing one point changes the entire structure of these triplets.
- Ranking Loss: The loss depends on the relative order of an entire list of items.
- Cox Regression: Used in survival analysis, where the "at-risk" set for one patient depends on the survival times of all other patients.
Until now, calculating influence for these models required either complex, case-specific mathematical derivations or "brute-force" leave-one-out (LOO) retraining (removing one point and retraining the whole model), which is computationally impossible for large datasets.
Introducing the Versatile Influence Function (VIF)
To bridge this gap, the authors introduce the Versatile Influence Function (VIF). Instead of trying to derive a perfect derivative for every new loss function, they revisit a general formulation of influence from robust statistics and apply a finite-difference approximation.
The core idea is to measure the infinitesimal change in the model's parameters when the training distribution is slightly perturbed. VIF calculates the difference between the gradient of the loss on the full dataset and the gradient of the loss on the dataset minus one point, then multiplies this by the inverse Hessian of the loss.
What makes VIF versatile? 1. Auto-differentiation: It leverages modern ML frameworks (like PyTorch or JAX) to calculate gradients and Hessians automatically, eliminating the need for manual math for every new loss function. 2. No Retraining: It only requires the model parameters from the original training run. 3. Broad Applicability: It works for any loss function that can be defined based on the presence or absence of training objects.
Key Results and Performance
The authors evaluated VIF across three distinct domains: survival analysis (Cox Regression), network analysis (Node Embedding), and information retrieval (Listwise Learning-to-Rank). The primary metric was the Pearson correlation between VIF's influence estimates and the "ground truth" obtained by brute-force LOO retraining.
- High Accuracy: In Cox regression and Learning-to-Rank, VIF achieved correlations between 0.82 and 0.99, meaning it almost perfectly mirrors the results of retraining the model from scratch.
- Massive Speedups: VIF is orders of magnitude faster than retraining. For the SUPPORT dataset, retraining took 225 minutes, while VIF took only 12.3 seconds—a 1097x improvement.
Beyond speed and accuracy, VIF offers powerful interpretability. In survival analysis, for example, VIF revealed that a model's risk prediction for a patient is most influenced by training samples that either share similar features but lived a long time, or have different features but died quickly.
Limitations and Future Work
- Convexity Assumption: Like most influence function methods, the theoretical derivation assumes the loss function is strictly convex. For non-convex models like deep neural networks, VIF relies on heuristic "tricks" (like using the Hessian at a local minimum) common to previous methods.
- Hessian Computation: While much faster than retraining, calculating and inverting the Hessian matrix is still expensive for models with millions of parameters. Scaling VIF to massive Large Language Models (LLMs) remains a challenge and will require approximations like Conjugate Gradient (CG) or LiSSA.
- Randomness: Some losses (like those using random walks in node embeddings) are non-deterministic, which can lower the correlation between VIF and any single retraining run.
Summary updated