Abstract
Identifying the training examples that most significantly impact a model's prediction is essential for interpretability and debugging. While standard data influence methods typically focus on the final layer of neural networks for computational efficiency, this work demonstrates that the last layer suffers from a significant "cancellation effect" that obscures true influence. We propose TracIn-WE, a method that leverages gradients from the word embedding layer. Our evaluation across multiple NLP benchmarks shows that TracIn-WE identifies influential examples up to 10x more accurately than last-layer methods and provides intuitive, word-level explanations for model behavior.
Introduction
Deep learning models are often criticized as "black boxes." Data influence methods aim to demystify these models by identifying the specific training instances that most impacted a given prediction. Traditionally, researchers have focused on the last layer of neural networks to calculate this influence, primarily to reduce computational overhead. However, recent findings suggest that the last layer represents "shared logic" across many examples, leading to a cancellation effect where the influences of many training examples counteract each other. This phenomenon makes it nearly impossible to distinguish truly important data from noise.
Methods: TracIn-WE
We introduce TracIn-WE (Word Embedding), which shifts the focus from the final layer to the very first layer of the network. While word embeddings themselves are static, their gradients—backpropagated from the output through the entire network—capture high-level semantic information about how a word is used in a specific context.
Specifically, TracIn-WE calculates the alignment between the gradients of word embeddings for a training example and a test example. To address the computational challenges of the large embedding layer, TracIn-WE leverages the inherent sparsity of language; influence calculations only need to consider the tokens present in the sentences being compared. This approach not only improves accuracy but also allows for word-level decomposition, making the "why" behind the influence much clearer by pinpointing specific impactful terms like "lazy" or "not."
Results and Discussion
Quantifying the Cancellation Effect
The authors quantified the cancellation effect across different layers of the model. As shown in Table 1, the first layer (TR-first) consistently exhibits the lowest cancellation ratio and the best performance on deletion metrics such as AUC-DEL. This confirms that early layers preserve more distinct influence signals than the highly compressed representations found in later layers.
Empirical Performance via Case Deletion
The primary metric for evaluating influence is "case deletion": if the most influential proponents are removed and the model is retrained, the prediction confidence should decrease. Conversely, removing opponents should increase confidence. TracIn-WE outperformed last-layer methods by 4x to 10x on these metrics. As seen in Figure 1, the TracIn-WE (TR-WE) curves show much more significant changes in prediction scores compared to the TR-last baselines, indicating a far superior ability to identify the data points that actually drive model behavior.
Conclusion
By focusing on the word embedding layer, TracIn-WE overcomes the cancellation effect inherent in later layers, providing a more accurate and interpretable tool for training data influence. This shift in perspective suggests that the initial layers of a network may hold more diagnostic value than previously thought. Future research will investigate the applicability of this "first is better" principle to generative tasks and other data modalities like computer vision.
Summary updated