Data attribution—the process of tracing a model's prediction back to its specific training data—is crucial for debugging errors, identifying mislabeled examples, and explaining model behavior. However, existing methods have historically forced researchers to choose between computational tractability and accuracy.
TRAK (Tracing with the Randomly-projected After Kernel) is a novel data attribution method designed to bridge this gap. By linearizing deep networks and leveraging random projections, TRAK achieves the high performance of "gold standard" attribution methods while operating 100 to 1,000 times faster. This breakthrough makes it feasible to trace predictions back to training data even for large-scale models like CLIP and BERT.
The Attribution Bottleneck
In machine learning, answering the question, "Which specific training examples caused the model to make this particular prediction?" has been a frustrating trade-off:
- Tractable but Unreliable: Methods like influence functions are computationally cheap but often fail in the complex, non-convex landscapes of deep neural networks.
- Effective but Prohibitive: Methods like datamodels are highly accurate at making "counterfactual" predictions (predicting how a model would behave if a specific training subset were removed). However, they require training thousands of models from scratch, which is impossible for large datasets like ImageNet or massive Transformer architectures.
TRAK provides a middle ground: an attribution method that is both scalable to large models and highly effective at counterfactual prediction.
Methodology: Simplifying Deep Learning Attribution
TRAK works by reducing the complex problem of deep learning attribution to a simpler, well-understood case akin to logistic regression. The method follows five key steps:
- Linearization: The authors approximate the model’s output using a first-order Taylor expansion around the final trained weights. This effectively treats the neural network as a linear model acting on its own gradients—a concept closely related to the empirical Neural Tangent Kernel (eNTK).
- Dimensionality Reduction: Because deep models have millions of parameters, their gradients are too massive to store. TRAK uses random projections (based on the Johnson-Lindenstrauss lemma) to compress these gradients into a manageable dimension while preserving their essential structure and gradient flow.
- Newton Step Approximation: Borrowing from classical statistics, TRAK applies a one-step Newton approximation—a standard tool for influence estimation in logistic regression—to the linearized, compressed model.
- Ensembling: To account for the inherent randomness in training (such as different seeds or data shuffles), TRAK aggregates scores across a small ensemble of models (typically 5 to 100).
- Soft-Thresholding: Finally, the scores are post-processed to induce sparsity, reflecting the reality that most predictions only depend on a small fraction of the training data.
Experimental Validation and Key Results
The authors benchmarked TRAK across diverse modalities and scales, including computer vision (ResNet-9 on CIFAR-10, ResNet-18 on ImageNet), vision-language (CLIP on MS COCO), and NLP (BERT-base on QNLI, 300M-parameter mT5).
- 100–1000x Speedup: On benchmarks like ImageNet and QNLI, TRAK achieved a Linear Datamodeling Score (LDS) comparable to the "oracle" datamodels method while using a fraction of the compute. On ImageNet, TRAK matched the efficacy of methods requiring 30,000 models by using only a few dozen.
- State-of-the-Art Trade-offs: In every test, TRAK dominated the efficiency-versus-accuracy curve, outperforming traditional influence functions and gradient-based heuristics by a wide margin.
- Practical Utility: TRAK successfully identified "brittle" predictions—those easily flipped by removing a few training points—as effectively as methods that cost 500x more to run.
Insights and Limitations
A major insight from TRAK is the power of linearization: even though deep networks are highly non-linear, their behavior at the end of training can be surprisingly well-captured by a linear approximation. This allows TRAK to use efficient linear algebra instead of expensive re-training.
Furthermore, experiments on the mT5 model revealed a fascinating distinction between fact tracing (finding the exact source sentence of a fact) and behavior tracing (finding the data that caused the model to learn the behavior). While TRAK sometimes missed the exact source sentence, it consistently succeeded in finding the causal data, proving its specialization for behavior tracing.
Limitations and Future Work: * Differentiability: TRAK requires the model to be differentiable, meaning it cannot be directly applied to non-differentiable components or certain discrete architectures. * Linearity Assumption: The method relies on the model being well-approximated by its linearization. It might struggle with models that exhibit extreme non-linearity in their final stages. * Generative Models: Applying TRAK to massive generative models (like GPT-4 or Stable Diffusion) is a promising but challenging next step that will require further optimization of the random projection implementation.
Summary updated