BERT-kNN: Adding a kNN Search Component to Pretrained Language Models for Better QA
Not on the map. Why?
Abstract (arXiv)
Khandelwal et al. (2020) use a k-nearest-neighbor (kNN) component to improve language model performance. We show that this idea is beneficial for open-domain question answering (QA). To improve the recall of facts encountered during training, we combine BERT (Devlin et al., 2019) with a traditional information retrieval step (IR) and a kNN search over a large datastore of an embedded text collection. Our contributions are as follows: i) BERT-kNN outperforms BERT on cloze-style QA by large margins without any further training. ii) We show that BERT often identifies the correct response category (e.g., US city), but only kNN recovers the factually correct answer (e.g., "Miami"). iii) Compared to BERT, BERT-kNN excels for rare facts. iv) BERT-kNN can easily handle facts not covered by BERT's training set, e.g., recent events.
Key facts. Cited by 36 papers in the map (data through 7 Oct 2026). First posted on arXiv 2 May 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 11; 2022: 12; 2023: 7; 2024: 3; 2025: 2; 2026: 1.
36 papers.
Sort:
By area:
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Modelscited by 251
- 2021Multilingual LAMA: Investigating Knowledge in Multilingual Pretrained Language Modelscited by 132
- 2021Knowledgeable or Educated Guess? Revisiting Language Models as Knowledge Basescited by 107
- 2021Adaptive Semiparametric Language Modelscited by 83
- 2021Adaptive Nearest Neighbor Machine Translationcited by 58
- 2022Retrieval-Enhanced Machine Learningcited by 46
- 2022Nonparametric Masked Language Modelingcited by 39
- 2022Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learningcited by 36
- 2021ConvFiT: Conversational Fine-Tuning of Pretrained Language Modelscited by 25
- 2021DREAM: Improving Situational QA by First Elaborating the Situationcited by 18
- 2022You can't pick your neighbors, or can you? When and how to rely on retrieval in the kNN-LMcited by 18
24 more
- 2022Relation Extraction as Open-book Examination: Retrieval-enhanced Prompt Tuningcited by 13
- 2022Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddingscited by 12
- 2021Static Embeddings as Efficient Knowledge Bases?cited by 11
- 2024Retrieval-Enhanced Machine Learning: Synthesis and Opportunitiescited by 11
- 2025Pre-training Limited Memory Language Models with Internal and External Knowledgecited by 11
- 2025Defending Against Knowledge Poisoning Attacks During Retrieval-Augmented Generationcited by 11
- 2021Not Far Away, Not So Close: Sample Efficient Nearest Neighbour Data Augmentation via MiniMaxcited by 10
- 2023Legal Question-Answering in the Indian Context: Efficacy, Challenges, and Potential of Modern AI Modelscited by 10
- 2021KNN-BERT: Fine-Tuning Pre-Trained Models with KNN Classifiercited by 7
- 2023Retrieval-Enhanced Visual Prompt Learning for Few-shot Classificationcited by 6
- 2024ARAIDA: Analogical Reasoning-Augmented Interactive Data Annotationcited by 6
- 2022Error-Robust Retrieval for Chinese Spelling Checkcited by 4
- 2023Mitigating Catastrophic Forgetting in Task-Incremental Continual Learning with Adaptive Classification Criterioncited by 4
- 2021A Neighbourhood Framework for Resource-Lean Content Flaggingcited by 3
- 2022WikiOmnia: generative QA corpus on the whole Russian Wikipediacited by 2
- 2022Augmentation with Projection: Towards an Effective and Efficient Data Augmentation Paradigm for Distillationcited by 2
- 2023Machine Reading Comprehension using Case-based Reasoningcited by 2
- 2023RSpell: Retrieval-augmented Framework for Domain Adaptive Chinese Spelling Checkcited by 2
- 2023Towards Faster k-Nearest-Neighbor Machine Translationcited by 1
- 2022Transferring Knowledge via Neighborhood-Aware Optimal Transport for Low-Resource Hate Speech Detectioncited by 0
- 2022Reranking Overgenerated Responses for End-to-End Task-Oriented Dialogue Systemscited by 0
- 2022Task-Specific Embeddings for Ante-Hoc Explainable Text Classificationcited by 0
- 2023Revisiting k-NN for Fine-tuning Pre-trained Language Modelscited by 0
- 2026AILQA: Evaluating AI-Driven Legal Question Answering Systems for the Indian Legal Systemcited by 0
- 2026AILQA: Evaluating AI-Driven Legal Question Answering Systems for the Indian Legal System21 Jul 2026
- 2025Defending Against Knowledge Poisoning Attacks During Retrieval-Augmented Generation4 Aug 2025
- 2025Pre-training Limited Memory Language Models with Internal and External Knowledge21 May 2025
- 2024Retrieval-Enhanced Machine Learning: Synthesis and Opportunities17 Jul 2024
- 2024ARAIDA: Analogical Reasoning-Augmented Interactive Data Annotation20 May 2024
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models12 Feb 2024
- 2023Towards Faster k-Nearest-Neighbor Machine Translation12 Dec 2023
- 2023Legal Question-Answering in the Indian Context: Efficacy, Challenges, and Potential of Modern AI Models26 Sep 2023
- 2023RSpell: Retrieval-augmented Framework for Domain Adaptive Chinese Spelling Check16 Aug 2023
- 2023Retrieval-Enhanced Visual Prompt Learning for Few-shot Classification4 Jun 2023
- 2023Machine Reading Comprehension using Case-based Reasoning24 May 2023
- 2023Mitigating Catastrophic Forgetting in Task-Incremental Continual Learning with Adaptive Classification Criterion20 May 2023
24 more
- 2023Revisiting k-NN for Fine-tuning Pre-trained Language Models18 Apr 2023
- 2022Nonparametric Masked Language Modeling2 Dec 2022
- 2022Task-Specific Embeddings for Ante-Hoc Explainable Text Classification30 Nov 2022
- 2022Error-Robust Retrieval for Chinese Spelling Check15 Nov 2022
- 2022Reranking Overgenerated Responses for End-to-End Task-Oriented Dialogue Systems7 Nov 2022
- 2022You can't pick your neighbors, or can you? When and how to rely on retrieval in the kNN-LM28 Oct 2022
- 2022Augmentation with Projection: Towards an Effective and Efficient Data Augmentation Paradigm for Distillation21 Oct 2022
- 2022Transferring Knowledge via Neighborhood-Aware Optimal Transport for Low-Resource Hate Speech Detection17 Oct 2022
- 2022Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning29 May 2022
- 2022Relation Extraction as Open-book Examination: Retrieval-enhanced Prompt Tuning4 May 2022
- 2022Retrieval-Enhanced Machine Learning2 May 2022
- 2022WikiOmnia: generative QA corpus on the whole Russian Wikipedia17 Apr 2022
- 2022Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddings14 Jan 2022
- 2021DREAM: Improving Situational QA by First Elaborating the Situation16 Dec 2021
- 2021KNN-BERT: Fine-Tuning Pre-Trained Models with KNN Classifier6 Oct 2021
- 2021ConvFiT: Conversational Fine-Tuning of Pretrained Language Models21 Sep 2021
- 2021Knowledgeable or Educated Guess? Revisiting Language Models as Knowledge Bases17 Jun 2021
- 2021Not Far Away, Not So Close: Sample Efficient Nearest Neighbour Data Augmentation via MiniMax28 May 2021
- 2021Adaptive Nearest Neighbor Machine Translation27 May 2021
- 2021Static Embeddings as Efficient Knowledge Bases?14 Apr 2021
- 2021A Neighbourhood Framework for Resource-Lean Content Flagging31 Mar 2021
- 2021Adaptive Semiparametric Language Models4 Feb 2021
- 2021Multilingual LAMA: Investigating Knowledge in Multilingual Pretrained Language Models1 Feb 2021
- 2021What Makes Good In-Context Examples for GPT-3?17 Jan 2021
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Modelscited by 251
- 2022Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learningcited by 36
- 2025Defending Against Knowledge Poisoning Attacks During Retrieval-Augmented Generationcited by 11
- 2023RSpell: Retrieval-augmented Framework for Domain Adaptive Chinese Spelling Checkcited by 2
- 2025Defending Against Knowledge Poisoning Attacks During Retrieval-Augmented Generation4 Aug 2025
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models12 Feb 2024
- 2023RSpell: Retrieval-augmented Framework for Domain Adaptive Chinese Spelling Check16 Aug 2023
- 2022Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning29 May 2022
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Multilingual LAMA: Investigating Knowledge in Multilingual Pretrained Language Modelscited by 132
- 2021Knowledgeable or Educated Guess? Revisiting Language Models as Knowledge Basescited by 107
- 2021Adaptive Semiparametric Language Modelscited by 83
- 2021Adaptive Nearest Neighbor Machine Translationcited by 58
- 2022Retrieval-Enhanced Machine Learningcited by 46
- 2022Nonparametric Masked Language Modelingcited by 39
- 2021ConvFiT: Conversational Fine-Tuning of Pretrained Language Modelscited by 25
- 2021DREAM: Improving Situational QA by First Elaborating the Situationcited by 18
- 2022You can't pick your neighbors, or can you? When and how to rely on retrieval in the kNN-LMcited by 18
- 2022Relation Extraction as Open-book Examination: Retrieval-enhanced Prompt Tuningcited by 13
- 2021Static Embeddings as Efficient Knowledge Bases?cited by 11
12 most cited of 30 All 30 (JSON)
- 2026AILQA: Evaluating AI-Driven Legal Question Answering Systems for the Indian Legal System21 Jul 2026
- 2025Pre-training Limited Memory Language Models with Internal and External Knowledge21 May 2025
- 2024Retrieval-Enhanced Machine Learning: Synthesis and Opportunities17 Jul 2024
- 2023Towards Faster k-Nearest-Neighbor Machine Translation12 Dec 2023
- 2023Legal Question-Answering in the Indian Context: Efficacy, Challenges, and Potential of Modern AI Models26 Sep 2023
- 2023Retrieval-Enhanced Visual Prompt Learning for Few-shot Classification4 Jun 2023
- 2023Machine Reading Comprehension using Case-based Reasoning24 May 2023
- 2023Mitigating Catastrophic Forgetting in Task-Incremental Continual Learning with Adaptive Classification Criterion20 May 2023
- 2023Revisiting k-NN for Fine-tuning Pre-trained Language Models18 Apr 2023
- 2022Nonparametric Masked Language Modeling2 Dec 2022
- 2022Task-Specific Embeddings for Ante-Hoc Explainable Text Classification30 Nov 2022
- 2022Error-Robust Retrieval for Chinese Spelling Check15 Nov 2022
12 newest of 30 All 30 (JSON)