Abstract
Biases and artifacts in training data often lead text classifiers to adopt shallow pattern matching strategies rather than true linguistic understanding, resulting in poor generalizability. We present HILDIF (Human-In-the-Loop Debugging using Influence Functions), a novel explanatory debugging pipeline that enables humans to improve deep text classifiers. By leveraging influence functions to identify problematic training examples and applying targeted data augmentation, HILDIF allows models to "unlearn" harmful heuristics. Our experiments on the Natural Language Inference (NLI) task demonstrate that HILDIF effectively alleviates artifact problems in fine-tuned BERT models, significantly increasing performance on adversarial benchmarks like HANS without degrading performance on standard datasets.
Introduction
Deep learning models for Natural Language Processing (NLP) are notoriously adept at "gaming" benchmarks. In tasks such as Natural Language Inference (NLI)—where a model must determine if a hypothesis is entailed by, neutral to, or contradicts a premise—models frequently rely on shallow heuristics. For instance, a model might learn that high lexical overlap between a premise and a hypothesis almost always indicates entailment. While this strategy yields high scores on standard datasets like MNLI, it fails on adversarial sets like HANS (Heuristic Analysis for NLI Systems), which are specifically designed to penalize such shortcuts.
Because these models are often treated as "black boxes," identifying and correcting these specific behaviors is challenging. Retraining on massive new datasets is computationally expensive and may not address the underlying bias. HILDIF addresses this by involving human experts in a targeted, data-centric debugging loop.
The HILDIF Pipeline
The HILDIF framework consists of four integrated stages designed to move from error identification to model correction:
- Explanation via Influence: Rather than using feature attribution (which highlights important words), HILDIF utilizes influence functions—specifically the efficient FASTIF algorithm. This identifies the specific training examples that most strongly influenced an incorrect prediction on a validation "anchor point."
- User Feedback: A human expert reviews these influential training examples. The user scores them based on whether they share the same problematic heuristic as the anchor point, effectively filtering the "noise" from the training data.
- Data Augmentation: For the influential samples confirmed as problematic, the system generates synthetic training data using back-translation and synonym replacement. This process preserves the semantics of the sentences while breaking the surface-level patterns (e.g., lexical overlap) the model was over-relying on.
- Fine-tuning: The model undergoes a final round of fine-tuning on this small, high-quality set of augmented data to correct its reliance on the identified heuristics.
Experimental Results
We evaluated HILDIF using a BERT-base model trained on the MNLI dataset and tested on the adversarial HANS dataset. HANS focuses on three specific heuristics: lexical overlap, subsequence, and constituent structure.
Performance Gains
The impact of HILDIF was most pronounced in the "Constituent" heuristic category. In cases of non-entailment where the model previously failed, the baseline accuracy was a mere 5.7%. After HILDIF debugging—using only 20 influential points and handpicked anchors—accuracy rose to 41.6%.
Generalizability and Robustness
Crucially, this improvement did not come at the cost of general performance. The model maintained its high accuracy on the original MNLI test set, suggesting that HILDIF helps the model learn more robust features rather than simply trading one bias for another. While there was a slight dip in accuracy for "entailment" cases as the model became more skeptical of shallow patterns, the overall balanced accuracy on adversarial sets improved significantly.
Key Insights
- Data-Centric Debugging: Highlighting influential data points is often more actionable for developers than feature attribution. Seeing the specific examples the model is mimicking allows for more precise intervention.
- Efficiency of Human Intuition: The study found that handpicking anchor points (selecting validation cases known to contain heuristics) led to much larger performance gains than random sampling. This demonstrates that targeted human intervention can be highly efficient, requiring very few examples to achieve significant results.
- The Power of Augmentation: Fine-tuning on augmented versions of influential samples outperformed fine-tuning on the raw samples themselves. This suggests that the model requires variations of a pattern to truly generalize a fix and move beyond surface-level artifacts.
Limitations and Future Directions
While HILDIF shows promise, the current study relied on a single expert user. Future work should explore how non-experts interact with the pipeline and whether group consensus can reduce individual bias. Additionally, the authors suggest that replacing simple augmentation methods with more sophisticated generative models (such as GPT-based generators) could create more diverse and linguistically complex synthetic examples. Finally, exploring iterative debugging—applying HILDIF over multiple cycles—could further harden models against complex, multi-layered biases.
Summary updated