Explaining Black Box Predictions and Unveiling Data Artifacts through Influence Functions

Xiaochuang Han, Byron C. Wallace, Yulia Tsvetkov

Introduction: The Black Box Problem

Deep learning models for Natural Language Processing (NLP) are notoriously opaque. While they achieve state-of-the-art performance, understanding why a model makes a specific prediction remains a significant challenge. Traditionally, researchers have relied on saliency maps—heatmaps that highlight which words in an input sentence (e.g., "not," "bad," "excellent") triggered a specific prediction. However, saliency maps only reveal which parts of the input were important, not the underlying logic or the specific training data that informed that importance.

Methodology: From Saliency to Influence

This research explores influence functions as a more robust alternative for model interpretation. While saliency maps focus on input tokens, influence functions identify the specific training examples that most impacted a model's decision.

Based on the framework by Koh and Liang (2017), influence functions mathematically approximate the effect of removing a specific training instance on the model's parameters without requiring costly retraining. This allows researchers to trace a test-time prediction back to its roots in the training corpus, providing a "leave-one-out" perspective on model behavior.

Figure 1: A comparison between token-level saliency maps and example-level influence functions for a sentiment analysis task.

Saliency vs. Influence: Agreement and Divergence

The study evaluates these methods across tasks of varying complexity, including sentiment analysis (SST-2) and Natural Language Inference (NLI).

In straightforward tasks like sentiment analysis, saliency maps and influence functions generally align. For instance, if the word "terrible" is highlighted as salient, the most influential training examples typically contain the word "terrible" or its synonyms. However, in complex reasoning tasks like NLI—where a model must determine if one sentence entails another—the two methods often diverge. This suggests that for reasoning, individual word importance does not fully capture the model's logic; the model may be looking at the right words but for the wrong reasons.

Unveiling Data Artifacts and "Cheating" Models

A key contribution of this work is the use of influence functions to detect models that rely on "data artifacts" (shortcuts or biases) rather than true reasoning. In NLI, models often exploit "lexical overlap"—the heuristic of assuming entailment simply because two sentences share many words.

By analyzing influential examples, the authors found that correct predictions in tricky cases were often driven by training examples that shared similar artifacts but different labels, rather than a deep syntactic understanding. To quantify this, the researchers introduced a quadratic regression measure to mathematically "catch" models over-relying on specific heuristics.

Key Results and Validation

To ensure the reliability of influence functions on large-scale models like BERT, the authors performed several "sanity checks":

  • Retraining Impact: Removing the top 10% most influential training examples led to a significant drop in prediction confidence (-6.00% for sentiment and -11.62% for NLI), far exceeding the impact of removing random examples.
  • Artifact Detection: Models trained on the diagnostic HANS dataset (designed to trap heuristic-reliant models) showed a significantly higher reliance on lexical overlap artifacts (+3.74 coefficient) compared to those trained on natural data (+0.74 coefficient).
  • Competing Heuristics: Influence functions can quantify the "tug-of-war" between conflicting shortcuts, such as high word overlap suggesting entailment versus a negation word suggesting non-entailment.

Conclusion

While computationally intensive—taking approximately 10 minutes to score 10,000 examples on an NVIDIA RTX 2080 Ti—influence functions provide a powerful tool for debugging NLP models. They move beyond "what" the model sees to "why" it predicts, offering a path toward cleaner training data and more logically sound AI systems.

Summary updated

BibTeX
@inproceedings{han2020explaining,
  author = {Xiaochuang Han and Byron C. Wallace and Yulia Tsvetkov},
  title = {{Explaining Black Box Predictions and Unveiling Data Artifacts through Influence Functions}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.492},
}
Figure