Abstract
The goal of predictive data attribution is to estimate how adding or removing a given set of training datapoints will affect model predictions. In convex settings, this goal is straightforward (i.e., via the infinitesimal jackknife). In large-scale (non-convex) settings, however, existing methods are far less successful -- current methods' estimates often only weakly correlate with ground truth. In this work, we present a new data attribution method (MAGIC) that combines classical methods and recent advances in metadifferentiation to (nearly) optimally estimate the effect of adding or removing training data on model predictions.
Introduction
In machine learning, understanding the relationship between training data and model predictions is a fundamental challenge known as predictive data attribution. For simple, convex models, influence functions provide a robust mathematical framework for this estimation. However, deep learning models are non-convex and stochastic, making attribution difficult. Existing state-of-the-art methods, such as TRAK or EK-FAC, rely on coarse approximations that often result in weak correlations with actual model behavior. Furthermore, the inherent noise in standard training (e.g., varying seeds or data ordering) often obscures the true influence of the data itself.
Methodology: The MAGIC Approach
MAGIC (Metagradient-based Attribution via Ground-truth Influence Computation) addresses these challenges through two primary innovations:
- Single-Model Attribution: By fixing the random seed, data ordering, and initialization, MAGIC treats a specific training run as a deterministic, differentiable function of the training data weights. This isolates the effect of the data from stochastic noise.
- Exact Metadifferentiation: Rather than approximating the influence function, MAGIC calculates it exactly using metadifferentiation (specifically the REPLAY algorithm). This involves a specialized backward pass through the entire training trajectory to compute the gradient of the final model output with respect to the input data weights.
To ensure the training process is "metasmooth"—a requirement for linear attribution to hold—the authors suggest minor adjustments, such as a short warm-up phase, to prevent chaotic gradients during early training stages.
Experimental Results
The authors evaluated MAGIC across diverse domains, including ResNet-9 on CIFAR-10, GPT-2 fine-tuning on Wikitext, and instruction tuning of Gemma-2B. The primary metric for success is the Linear Datamodeling Score (LDS), which measures the Spearman correlation between predicted changes in loss and the actual changes observed after retraining.
MAGIC demonstrated near-perfect correlation, achieving an LDS of 0.98 on CIFAR-10 and 0.95 on Gemma-2B. In contrast, existing methods like TRAK and EK-FAC often achieved correlations below 0.40. Crucially, MAGIC's estimates are well-scaled, meaning they accurately predict the numerical magnitude of loss changes, not just the relative importance of points.
Discussion and Limitations
While MAGIC provides a significant leap in attribution accuracy, it is computationally intensive. Attributing a single test point requires a pass through the entire training history, costing approximately 3-5x the original training time. This cost scales linearly with the number of test points. Additionally, the accuracy of the linear Taylor expansion used by MAGIC begins to degrade when large portions of the dataset (e.g., >20%) are removed, as the model's behavior becomes non-linear over large distances. Future research will focus on improving the efficiency of metadifferentiation and scaling attribution to multiple test samples simultaneously.
Summary updated