Explaining and Improving Model Behavior with k Nearest Neighbor Representations

By Nazneen Rajani, Ben Krause, Wen Yin, Tong Niu, Richard Socher, Caiming Xiong. 2020

39 citations recorded by the source corpus.

Interpretability techniques in NLP have mainly focused on understanding individual predictions using attention visualization or gradient-based saliency maps over tokens. We propose using k nearest neighbor (kNN) representations to identify training examples responsible for a model's predictions and obtain a corpus-level understanding of the model's behavior. Apart from interpretability, we show that kNN representations are effective at uncovering learned spurious associations, identifying mislabeled examples, and improving the fine-tuned model's performance. We focus on Natural Language Inference (NLI) as a case study and experiment with multiple datasets. Our method deploys backoff to kNN for BERT and RoBERTa on examples with low model confidence without any update to the model parameters. Our results indicate that the kNN approach makes the finetuned model more robust to adversarial inputs.

Subfields: Artificial Intelligence, Safety, Robustness & Interpretability

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Sameer Singh
  2. Mohit Bansal
  3. Yoav Goldberg
  4. Noah A. Smith
  5. Jacob Andreas
  6. Yulia Tsvetkov
  7. Matt Gardner
  8. Kelvin Guu

In Safety, Robustness & Interpretability

  1. Sameer Singh
  2. Byron C. Wallace
  3. Sarthak Jain
  4. Pouya Pezeshkpour
  5. Jacob Andreas
  6. Frederick Liu
  7. Tolga Bolukbasi
  8. Ian Tenney

Citations in the corpus