FIND: Human-in-the-Loop Debugging Deep Text Classifiers

Piyawat Lertvittayakumjorn, Lucia Specia, Francesca Toni

Abstract

Deep learning models often rely on "shortcuts"—spurious correlations or biases in training data that fail to generalize to real-world scenarios. We introduce FIND (Feature Investigation aNd Disabling), a framework that brings humans into the loop to debug text classifiers by identifying and disabling problematic internal logic. By visualizing hidden features as word clouds, FIND allows experts to audit a model's global logic and mask irrelevant or biased features. Our evaluations across sentiment analysis, bias reduction, and dataset shift scenarios demonstrate that FIND effectively mitigates gender bias and improves performance under dataset shift without requiring extensive new data.

Introduction

While deep learning models achieve high benchmark accuracy, they are frequently "black boxes" that exploit dataset-specific artifacts. For instance, a sentiment classifier might learn that the word "check" is positive simply because it appeared frequently in five-star reviews. Existing solutions like data augmentation are costly, while local explanations (e.g., LIME) fail to provide a global view of a model's internal logic. FIND addresses these gaps by allowing humans to perform a global audit of a model's learned features, targeting the source of errors rather than individual misclassifications.

Methodology: The FIND Framework

The FIND framework operates on the final representation layer of deep learning models, specifically Convolutional Neural Networks (CNNs). The process consists of four main stages:

  1. Feature Visualization: Using Layer-wise Relevance Propagation (LRP), the system identifies n-grams in the training set that most strongly activate specific hidden neurons in the penultimate layer.
  2. Global Aggregation: These n-grams are aggregated into word clouds, each representing a "concept" learned by a specific feature.
  3. Human Debugging: A human reviewer examines these word clouds to identify irrelevant (e.g., punctuation, names) or harmful (e.g., gendered terms) features.
  4. Feature Disabling: Identified features are masked (multiplied by zero). The final classification layer is then fine-tuned while the rest of the network remains frozen, forcing the model to re-weight its decisions using only the remaining, valid features.
The FIND framework pipeline, illustrating the transition from an original model to a debugged model through human intervention.

Feature Interpretability and Selection

A key premise of FIND is that hidden features in deep networks often learn coherent, human-understandable concepts. Features are ranked and visualized to help debuggers distinguish between useful sentiment indicators and irrelevant artifacts. For example, one feature might capture "food quality," while another might accidentally capture "reviewer names" or specific formatting artifacts.

Word cloud visualizations of features ranked by their relevance and interpretability for human debuggers.

Experimental Results

The authors evaluated FIND across several domains, including sentiment analysis (Yelp, Amazon), bias reduction (Biosbias), and dataset shift (20Newsgroups to Religion).

Bias Mitigation

In the Biosbias experiment, which involves predicting occupation from biographies, FIND successfully targeted gender-biased neurons. By disabling features that triggered on gendered pronouns (e.g., "he/his"), the framework reduced gender bias metrics (FPED and FNED) by over 50% (e.g., FPED dropped from 0.250 to 0.118) with negligible impact on overall F1 scores.

Robustness to Dataset Shift

When training on 20Newsgroups and testing on a separate Religion dataset, the model initially overfitted to training artifacts like poster names (e.g., "Keith," "Gregg"). Disabling these "artifact" features improved the Macro F1 from 0.731 to 0.799, demonstrating significantly better generalization to out-of-distribution data.

Discussion and Conclusion

FIND demonstrates that global feature auditing is a powerful tool for model debugging. By fixing the internal logic rather than playing "whack-a-mole" with individual predictions, it provides a scalable way to improve model fairness and robustness. However, challenges remain regarding the scalability of manual review for larger models like Transformers and the potential for human bias in the debugging process. Future work may explore automated feature selection or applying FIND to more complex architectures like attention-based models.

Summary updated

BibTeX
@inproceedings{lertvittayakumjorn2020find,
  author = {Piyawat Lertvittayakumjorn and Lucia Specia and Francesca Toni},
  title = {{FIND: Human-in-the-Loop Debugging Deep Text Classifiers}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.24},
}
Figure