
retribert
Language509 ops81.3M params
Two BERT encoders and a dot product: dense retrieval that beat BM25 for open-domain question answering.
Language · 304 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
The DPR encoder itself, an independent BERT base uncased network whose [CLS] representation is the 768-dimensional output vector.
About this model's family
DPR, the Dense Passage Retriever, finds candidate passages for open-domain question answering with dense vectors alone, learned by a simple dual-encoder framework, instead of the traditional sparse TF-IDF or BM25 matching. The question encoder and passage encoder are two independent BERT networks (base, uncased), each taking the representation at the [CLS] token as its output, so the vectors have 768 dimensions. Similarity is just the dot product of the two vectors, chosen because the function has to be decomposable so passage representations can be precomputed.
The surprise of the paper is how simple the recipe is: the embedding is optimized for maximizing inner products of question and relevant passage vectors, with an objective comparing all pairs of questions and passages in a batch. With in-batch negatives, each batch of B questions yields B training instances with B minus 1 negative passages per question at no extra cost. The best model mixes gold passages from the same mini-batch with one BM25 negative passage. No extra pretraining is needed, since simply fine-tuning the question and passage encoders on existing question-passage pairs is sufficient to greatly outperform BM25. At inference the passage encoder runs over all passages offline and FAISS indexes the vectors. DPR beats BM25 by a large margin, 65.2% versus 42.9% in Top-5 accuracy, and lifts end-to-end QA accuracy over ORQA, 41.5% versus 33.3%, on open Natural Questions.
This family also holds two retrievers that are not DPR but share the idea of maximizing the dot product between a query vector and Wikipedia passage vectors. REALM is trained without passage supervision but needs an expensive pre-training step with an Inverse Cloze Task, 100,000 steps at batch size 4096, and re-computes the embeddings of all Wikipedia passages during training. RetriBERT came out of the ELI5 long-form question answering write-up, trained on batches of 512 question-answer pairs. It uses a single BERT-style model for both questions and answers, with separate projection matrices bringing both representations down to dimension 128. The official DPR code is CC-BY-NC 4.0 licensed as of now. A March 2021 release added a new bi-encoder checkpoint trained on NQ with hard negatives mined using the DPR index itself. That lifted top-20 retrieval accuracy on the NQ test set from 79.97 to 81.33.
Key idea. DPR shows that a plain BERT dual encoder, fine-tuned on existing question-passage pairs with in-batch negatives and no extra pretraining, retrieves passages far better than BM25 and raises end-to-end open-domain QA accuracy.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{karpukhin2020densepassageretrievalopendomain,
title={Dense Passage Retrieval for Open-Domain Question Answering},
author={Vladimir Karpukhin and Barlas Oğuz and Sewon Min and Patrick Lewis and Ledell Wu and Sergey Edunov and Danqi Chen and Wen-tau Yih},
year={2020},
eprint={2004.04906},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2004.04906},
}