Introduction
Deep learning models for Natural Language Processing (NLP) are often criticized as "black boxes," making their decision-making processes difficult to interpret. While researchers frequently use saliency maps—heatmaps highlighting specific words that drive a prediction—these tools have significant limitations. They struggle with complex reasoning tasks like Natural Language Inference (NLI) and fail to explain why a model values certain features, often masking the model's reliance on statistical shortcuts or data artifacts.
This paper proposes a shift from "explanation-by-input-features" to "explanation-by-example" using influence functions. This method identifies the specific training examples that most heavily impacted a model's prediction, providing a more holistic view of model behavior and a means to detect when a model is "cheating."
Methodology: From Features to Examples
Influence functions, adapted from robust statistics, mathematically approximate how a model’s parameters and predictions would change if a specific training example were removed. Essentially, the method asks: "If the model hadn't seen this specific training sentence, how much less confident would it be in its current prediction?"
To validate this approach, the authors performed "leave-one-out" retraining to ensure the mathematical approximation correlates with actual model behavior. Furthermore, they introduced a quantitative measure using quadratic regression to detect artifacts. By plotting the influence of training examples against specific features (like word overlap), they can determine if the most influential examples are those containing suspected data shortcuts.
Key Insights and Artifact Detection
The study evaluated BERT models on sentiment analysis (SST-2) and inference tasks (MNLI, HANS). Several critical insights emerged:
- Saliency vs. Influence Divergence: In simple sentiment tasks, saliency maps and influence functions often align. However, in complex NLI tasks, they diverge significantly. This suggests that for reasoning, individual keywords provide an incomplete picture of model logic.
- Detecting "Cheating" Models: Influence functions successfully revealed that when BERT is tested on the diagnostic HANS dataset, its predictions are driven by training examples with high lexical overlap. This confirms the model often relies on heuristics rather than true logic.
- The Bi-Polarizing Effect: Interestingly, both the most supportive (positive influence) and most opposing (negative influence) training examples often share the same artifacts. This indicates the model is highly sensitive to these shortcuts across its entire training distribution.
Results and Quantitative Analysis
The effectiveness of influence functions was demonstrated through several metrics:
- Reliability: Removing the top 10% most influential training examples caused an 11.62% drop in prediction confidence for NLI, compared to a negligible +0.13% change when removing examples at random. This proves the method identifies the "load-bearing" data points.
- Consistency: In sentiment analysis, there was high overlap (70-80%) in influence distribution before and after removing salient tokens. In NLI, this overlap was much lower, indicating NLI predictions are more holistic.
- Artifact Tracking: The average quadratic coefficient for lexical overlap was significantly higher for HANS examples (+3.28 × 10⁻³) than for natural MNLI examples (+0.65 × 10⁻³), providing a concrete metric for shortcut reliance.
Limitations and Future Work
Despite their utility, influence functions are computationally expensive; calculating the influence of 10,000 examples for a single input took approximately 10 minutes on an NVIDIA RTX 2080 Ti. This cost currently limits scalability. Additionally, while the method identifies influential examples, human interpretation is still required to "connect the dots" and identify the underlying artifacts. Future research may focus on automating pattern discovery and determining if these example-based explanations truly increase user trust in AI systems.
Summary updated