dpr-retrieval-eval
Dense Passage Retrieval for Open-Domain Question Answering — Karpukhin et al. (2020) (arXiv:2004.04906, 2020)
What this evaluates
Evaluates a model's ability to retrieve relevant passages from a large unstructured corpus for open-domain question answering. It probes semantic matching and dense retrieval capabilities by measuring how often the correct answer span appears in the top-k retrieved passages.
Datasets
- Natural Questions — total ?; splits: train (58880), dev (8757), test (3610)
- TriviaQA — total ?; splits: train (60413), dev (8837), test (11313)
- WebQuestions — total ?; splits: train (2474), dev (361), test (2032)
- CuratedTREC — total ?; splits: train (1125), dev (133), test (694)
- SQuAD v1.1 — total ?; splits: train (70096), dev (8886), test (10570)
Metrics
top-k retrieval accuracy (primary) — range: percent
- Percentage of top-k retrieved passages that contain the gold answer span. Calculated as the number of questions where the answer is found in the top-k results divided by the total number of questions.
Input / output format
Input: A natural language question and a candidate pool of Wikipedia passages (100-word blocks, each prepended with the article title and a [SEP] token).
Output: A ranked list of candidate passages for the given question.
Scoring recipe
def compute_topk_accuracy(predictions, gold_answers, k=20):
correct = 0
for pred_passages, gold_span in zip(predictions, gold_answers):
top_k = pred_passages[:k]
if any(gold_span in passage for passage in top_k):
correct += 1
return correct / len(gold_answers)
Common pitfalls
- Wikipedia version and preprocessing differences require filtering out questions where gold passages cannot be matched to the candidate pool.
- For TREC, WebQuestions, and TriviaQA, positive passages are selected using BM25 top-100 results containing the answer, introducing a retrieval bias.
- SQuAD is explicitly noted as suboptimal for open-domain QA because many questions lack sufficient context without the original provided paragraph.
Evidence (verbatim from paper)
Table 2: Top-20 & Top-100 retrieval accuracy on test sets, measured as the percentage of top 20/100 retrieved passages that contain the answer.
Citation
@misc{karpukhin2020dpr,
title={Dense Passage Retrieval for Open-Domain Question Answering},
author={Karpukhin et al. (2020)},
year={2020},
note={arXiv:2004.04906}
}
1---2name: dpr-retrieval-eval3description: Evaluates a model's ability to retrieve relevant passages from a large unstructured corpus for open-domain question answering. It probes semantic matching and dense retrieval capabilities by measuring how often the correct answer span appears in the top-k retrieved passages. Use when the user wants to benchmark on Natural Questions, TriviaQA, WebQuestions, CuratedTREC, SQuAD v1.1, or asks about evaluating this task. Reports top-k retrieval accuracy.4metadata:5 source: https://skillmd.com/skills/qhjqhj00/dpr-retrieval-eval6 skill_kind: dataset_eval7 source_arxiv: 2004.049068 bibtex_key: karpukhin2020dpr9 confidence: high10---1112# dpr-retrieval-eval1314> Dense Passage Retrieval for Open-Domain Question Answering — Karpukhin et al. (2020) (arXiv:2004.04906, 2020)1516## What this evaluates1718Evaluates a model's ability to retrieve relevant passages from a large unstructured corpus for open-domain question answering. It probes semantic matching and dense retrieval capabilities by measuring how often the correct answer span appears in the top-k retrieved passages.1920## Datasets2122- **Natural Questions** — total ?; splits: train (58880), dev (8757), test (3610)23- **TriviaQA** — total ?; splits: train (60413), dev (8837), test (11313)24- **WebQuestions** — total ?; splits: train (2474), dev (361), test (2032)25- **CuratedTREC** — total ?; splits: train (1125), dev (133), test (694)26- **SQuAD v1.1** — total ?; splits: train (70096), dev (8886), test (10570)2728## Metrics2930- `top-k retrieval accuracy` **(primary)** — range: percent31 - Percentage of top-k retrieved passages that contain the gold answer span. Calculated as the number of questions where the answer is found in the top-k results divided by the total number of questions.3233## Input / output format3435**Input**: A natural language question and a candidate pool of Wikipedia passages (100-word blocks, each prepended with the article title and a [SEP] token).3637**Output**: A ranked list of candidate passages for the given question.3839## Scoring recipe4041```python42def compute_topk_accuracy(predictions, gold_answers, k=20):43 correct = 044 for pred_passages, gold_span in zip(predictions, gold_answers):45 top_k = pred_passages[:k]46 if any(gold_span in passage for passage in top_k):47 correct += 148 return correct / len(gold_answers)49```5051## Common pitfalls5253- Wikipedia version and preprocessing differences require filtering out questions where gold passages cannot be matched to the candidate pool.54- For TREC, WebQuestions, and TriviaQA, positive passages are selected using BM25 top-100 results containing the answer, introducing a retrieval bias.55- SQuAD is explicitly noted as suboptimal for open-domain QA because many questions lack sufficient context without the original provided paragraph.5657## Evidence (verbatim from paper)5859> Table 2: Top-20 \& Top-100 retrieval accuracy on test sets, measured as the percentage of top 20/100 retrieved passages that contain the answer.6061## Citation6263```bibtex64@misc{karpukhin2020dpr,65 title={Dense Passage Retrieval for Open-Domain Question Answering},66 author={Karpukhin et al. (2020)},67 year={2020},68 note={arXiv:2004.04906}69}70```7172- arXiv: 2004.04906