BERT-kNN: Adding a kNN Search Component to Pretrained Language Models for Better QA

Nora Kassner, Hinrich Schütze
5/2/2020
cs.CL

Official code: norakassner/BERT-kNN (24 stars, Python, last commit 2021-01-20).

Abstract

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).

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

243PythonOct 1, 20205 years ago

Similar Papers

Cite this paper

@article{kassner2020bertknn,
  title  = {BERT-kNN: Adding a kNN Search Component to Pretrained Language Models for Better QA},
  author = {Nora Kassner and Hinrich Schütze},
  year   = {2020},
  eprint = {2005.00766},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2005.00766}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2005.00766.svg)](https://codeofpaper.com/paper/2005.00766)

Discussion