Explaining and Improving Model Behavior with k Nearest Neighbor Representations
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). First posted on arXiv 18 Oct 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 9; 2022: 3; 2023: 2; 2024: 6; 2025: 3; 2026: 4.
27 papers.
Sort:
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021QA Dataset Explosion: A Taxonomy of NLP Resources for Question Answering and Reading Comprehensioncited by 91
- 2021Combining Feature and Instance Attribution to Detect Artifactscited by 38
- 2021An Empirical Comparison of Instance Attribution Methods for NLPcited by 35
- 2024Training Data Attribution via Approximate Unrolled Differentiationcited by 33
- 2021On Training Instance Selection for Few-Shot Neural Text Generationcited by 25
- 2022Towards Tracing Factual Knowledge in Language Models Back to the Training Datacited by 21
- 2021Interpreting Deep Learning Models in Natural Language Processing: A Reviewcited by 19
- 2021Cross-Domain Data Integration for Named Entity Disambiguation in Biomedical Textcited by 15
- 2023How do languages influence each other? Studying cross-lingual data sharing during LM fine-tuningcited by 14
- 2024Latent Concept-based Explanation of NLP Modelscited by 13
- 2022Contrastive Error Attribution for Finetuned Language Modelscited by 12
15 more
- 2021Improving and Diagnosing Knowledge-Based Visual Question Answering via Entity Enhanced Knowledge Injectioncited by 8
- 2024Towards flexible perception with visual memorycited by 8
- 2025Enhancing Training Data Attribution with Representational Optimizationcited by 8
- 2022Interpreting Embedding Spaces by Conceptualizationcited by 6
- 2024Data-centric Prediction Explanation via Kernelized Stein Discrepancycited by 3
- 2021Behavior of k-NN as an Instance-Based Explanation Methodcited by 2
- 2024FASTTRACK: Fast and Accurate Fact Tracing for LLMscited by 2
- 2023Wrapper Boxes: Faithful Attribution of Model Predictions to Training Datacited by 1
- 2024InfFeed: Influence Functions as a Feedback to Improve the Performance of Subjective Taskscited by 1
- 2025Separating Knowledge and Perception with Procedural Datacited by 0
- 2025Robust Nearest Neighbour Retrieval Using Targeted Manifold Manipulationcited by 0
- 2026Vector Quantized Latent Concepts: A Scalable Alternative to Clustering-Based Concept Discoverycited by 0
- 2026STRIDE: Training Data Attribution via Sparse Recovery from Subset Perturbationscited by 0
- 2026Near-Exponential Convergence Rates for kNN Classification based on Boltzmann Margincited by 0
- 2026Analysis of Quantized and Efficiently Adapted Protein Language Modelscited by 0
- 2026Analysis of Quantized and Efficiently Adapted Protein Language Models30 Sep 2026
- 2026Near-Exponential Convergence Rates for kNN Classification based on Boltzmann Margin9 Jun 2026
- 2026STRIDE: Training Data Attribution via Sparse Recovery from Subset Perturbations3 Jun 2026
- 2026Vector Quantized Latent Concepts: A Scalable Alternative to Clustering-Based Concept Discovery2 Feb 2026
- 2025Robust Nearest Neighbour Retrieval Using Targeted Manifold Manipulation9 Nov 2025
- 2025Separating Knowledge and Perception with Procedural Data12 Aug 2025
- 2025Enhancing Training Data Attribution with Representational Optimization24 May 2025
- 2024Towards flexible perception with visual memory15 Aug 2024
- 2024Training Data Attribution via Approximate Unrolled Differentiation20 May 2024
- 2024FASTTRACK: Fast and Accurate Fact Tracing for LLMs22 Apr 2024
- 2024Latent Concept-based Explanation of NLP Models18 Apr 2024
- 2024Data-centric Prediction Explanation via Kernelized Stein Discrepancy22 Mar 2024
15 more
- 2024InfFeed: Influence Functions as a Feedback to Improve the Performance of Subjective Tasks22 Feb 2024
- 2023Wrapper Boxes: Faithful Attribution of Model Predictions to Training Data15 Nov 2023
- 2023How do languages influence each other? Studying cross-lingual data sharing during LM fine-tuning22 May 2023
- 2022Contrastive Error Attribution for Finetuned Language Models21 Dec 2022
- 2022Interpreting Embedding Spaces by Conceptualization22 Aug 2022
- 2022Towards Tracing Factual Knowledge in Language Models Back to the Training Data23 May 2022
- 2021Improving and Diagnosing Knowledge-Based Visual Question Answering via Entity Enhanced Knowledge Injection13 Dec 2021
- 2021Interpreting Deep Learning Models in Natural Language Processing: A Review20 Oct 2021
- 2021Cross-Domain Data Integration for Named Entity Disambiguation in Biomedical Text15 Oct 2021
- 2021Behavior of k-NN as an Instance-Based Explanation Method14 Sep 2021
- 2021QA Dataset Explosion: A Taxonomy of NLP Resources for Question Answering and Reading Comprehension27 Jul 2021
- 2021On Training Instance Selection for Few-Shot Neural Text Generation7 Jul 2021
- 2021Combining Feature and Instance Attribution to Detect Artifacts1 Jul 2021
- 2021An Empirical Comparison of Instance Attribution Methods for NLP9 Apr 2021
- 2021What Makes Good In-Context Examples for GPT-3?17 Jan 2021
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021QA Dataset Explosion: A Taxonomy of NLP Resources for Question Answering and Reading Comprehensioncited by 91
- 2021Combining Feature and Instance Attribution to Detect Artifactscited by 38
- 2021An Empirical Comparison of Instance Attribution Methods for NLPcited by 35
- 2024Training Data Attribution via Approximate Unrolled Differentiationcited by 33
- 2021On Training Instance Selection for Few-Shot Neural Text Generationcited by 25
- 2022Towards Tracing Factual Knowledge in Language Models Back to the Training Datacited by 21
- 2021Interpreting Deep Learning Models in Natural Language Processing: A Reviewcited by 19
- 2021Cross-Domain Data Integration for Named Entity Disambiguation in Biomedical Textcited by 15
- 2023How do languages influence each other? Studying cross-lingual data sharing during LM fine-tuningcited by 14
- 2024Latent Concept-based Explanation of NLP Modelscited by 13
- 2022Contrastive Error Attribution for Finetuned Language Modelscited by 12
12 most cited of 27 All 27 (JSON)
- 2026Analysis of Quantized and Efficiently Adapted Protein Language Models30 Sep 2026
- 2026Near-Exponential Convergence Rates for kNN Classification based on Boltzmann Margin9 Jun 2026
- 2026STRIDE: Training Data Attribution via Sparse Recovery from Subset Perturbations3 Jun 2026
- 2026Vector Quantized Latent Concepts: A Scalable Alternative to Clustering-Based Concept Discovery2 Feb 2026
- 2025Robust Nearest Neighbour Retrieval Using Targeted Manifold Manipulation9 Nov 2025
- 2025Separating Knowledge and Perception with Procedural Data12 Aug 2025
- 2025Enhancing Training Data Attribution with Representational Optimization24 May 2025
- 2024Towards flexible perception with visual memory15 Aug 2024
- 2024Training Data Attribution via Approximate Unrolled Differentiation20 May 2024
- 2024FASTTRACK: Fast and Accurate Fact Tracing for LLMs22 Apr 2024
- 2024Latent Concept-based Explanation of NLP Models18 Apr 2024
- 2024Data-centric Prediction Explanation via Kernelized Stein Discrepancy22 Mar 2024
12 newest of 27 All 27 (JSON)