Abstract
We introduce a method called TracIn that computes the influence of a training example on a prediction made by the model. The idea is to trace how the loss on the test point changes during the training process whenever the training example of interest was utilized. We provide a scalable implementation of TracIn via: (a) a first-order gradient approximation to the exact computation, (b) saved checkpoints of standard training procedures, and (c) cherry-picking layers of a deep neural network. In contrast with previously proposed methods, TracIn is simple to implement; all it needs is the ability to work with gradients, checkpoints, and loss functions. The method is general. It applies to any machine learning model trained using stochastic gradient descent or a variant of it, agnostic of architecture, domain and task. We expect the method to be widely useful within processes that study and improve training data.
Introduction
Deep learning models are often criticized as "black boxes." While we can see the final prediction, it is difficult to know why the model arrived at that conclusion. Specifically, researchers want to know which training data points were most responsible for a given prediction.
Existing methods for calculating "influence" have significant drawbacks. Influence Functions require calculating and inverting a Hessian matrix, which is computationally prohibitive for large models. Representer Points are often restricted to specific layers or loss functions and only explain the prediction score, not the loss. TracIn addresses these issues by providing a method that is simple to implement, general across SGD-trained models, and scalable to deep networks like ResNet-50.
Methodology
The core idea behind TracIn is inspired by the fundamental theorem of calculus. To determine how much a training point $z$ influenced the prediction on test point $z'$, we examine every step of Gradient Descent where $z$ was used and calculate the resulting reduction in loss on $z'$.
To make this practical, the authors employ several strategies:
- First-Order Approximation: Influence is approximated as the dot product of the gradients of the loss for the training point and the test point.
- TracInCP (Checkpoints): Instead of tracking every step, the method utilizes saved checkpoints from standard training, summing gradients calculated at these snapshots.
- Dimensionality Reduction: For massive models, random projections (sketching) compress high-dimensional gradient vectors, accelerating the dot product calculation.
Key Insights and Ideas
TracIn categorizes training points into proponents (examples that reduced the loss on the test point) and opponents (examples that increased the loss). A key discovery is that mislabeled examples often exhibit high self-influence. Because the model must "work harder" to fit a mislabeled point, that point appears as its own strongest proponent, making TracIn an effective tool for dataset cleaning.
Furthermore, TracIn offers temporal sensitivity. Different checkpoints capture different types of influence: early training captures general patterns, while later stages may capture outliers or memorization.
Experimental Results
The authors evaluated TracIn across image classification (MNIST, CIFAR-10, ImageNet), text classification (DBPedia), and regression (California Housing Prices). The method excels at mislabeled data detection. On CIFAR-10, TracIn identified over 80% of mislabeled data within the top 20% of its ranked list, outperforming Influence Functions and Representer Points. This leads to faster accuracy recovery when cleaning noisy datasets.
Qualitative analysis on ImageNet confirmed that proponents for a "cat" image were other similar cats, while opponents were often visually similar but differently labeled items. Quantitatively, the first-order approximation showed a 0.978 Pearson correlation with the actual change in loss.
Conclusion
While TracIn is a powerful tool, its effectiveness depends on the availability of quality checkpoints. It also remains a "human-in-the-loop" process, as flagged "opponents" may be either mislabeled or simply difficult legitimate examples. Future work may explore using TracIn for active learning to identify examples that would most significantly reduce overall model loss.
Summary updated