# Reading Wikipedia to Answer Open-Domain Questions

DrQA answers open-domain questions by reading Wikipedia articles

Danqi Chen, Adam Fisch, Jason Weston, Antoine Bordes · arXiv · 2017-3-31

- **Problem** Answering factoid questions from Wikipedia alone is hard because the system must first find the few relevant articles among 5,075,182 and then locate an answer span inside them.
- **Method** DrQA pairs a Document Retriever, which uses bigram-hashed TF-IDF to return 5 articles, with a Document Reader, an LSTM that finds the answer span inside them.
- **Results** Multitask training with distant supervision reaches 29.8 top-1 exact match, versus 27.1 for SQuAD-only training, on full-Wikipedia SQuAD.

## Why open-domain reading is harder than machine comprehension

The system answers factoid questions with Wikipedia as its single knowledge source, so it has no second corpus or fallback resource to draw on. Before any reading starts, the system has to pick the few relevant articles out of 5,075,182 retained articles. Knowledge bases are easier for computers to process, but the authors judge them too sparsely populated for open-domain questions, whereas Wikipedia holds current information written for people to read.

Large systems such as DeepQA lean on redundancy across several sources, while a single source means an answer may appear only once, so the reader has to be precise.

Machine comprehension datasets such as SQuAD, CNN/Daily Mail and CBT supply a short relevant text, which an open-domain system would not receive. The authors combine the two demands into machine reading at scale, which keeps the depth of reading comprehension while keeping search over a large resource. Search is therefore part of the task itself rather than a preprocessing step handled elsewhere.

## How the retriever and reader fit together

DrQA combines a Document Retriever, which narrows the search to a small set of articles, with a Document Reader, which looks for the answer inside those articles. The retriever is a non-learned ranking step that cuts the search space before any neural computation runs. The retriever returns 5 Wikipedia articles per question, and the reader processes those articles paragraph by paragraph.

The final prediction is the best span taken over all paragraphs considered.

The reader is the trained part, and the full system keeps the retriever unchanged while the reader's training data varies.

## Narrowing Wikipedia to five articles

The retriever finds candidate articles with an inverted index lookup and then scores them with a term vector model. Articles and questions are both represented as TF-IDF weighted bag-of-words vectors, so an article ranks higher when it shares more weighted words with the question.

Plain unigram vectors ignore word order, so the system adds bigram counts to recover some local order. Storing every bigram would be costly, so the bigrams are hashed into 224 bins with an unsigned murmur3 hash, following the hashing approach of Weinberger et al. (2009).

The measure is the percentage of questions whose answer string appears in one of the top 5 pages. The bigram retriever reached 77.8 on SQuAD against 62.7 for Wikipedia Search. On CuratedTREC it reached 86.0 against 81.0, on WebQuestions 74.4 against 73.7, and on WikiMovies 70.3 against 61.7. Plain TF-IDF without bigrams reached 54.4 on WikiMovies, below Wikipedia Search, so the bigram features are what move it above that baseline on this set.

The authors also tried Okapi BM25 and cosine distance between bag-of-embedding vectors, and report that both performed worse, without giving scores in the text.

## Encoding paragraph tokens and the question

Each paragraph token becomes a feature vector, and the sequence passes through a multi-layer bidirectional LSTM so that each token's output reflects its surrounding context. The output for a token concatenates the hidden units of every layer. The base embedding is 300-dimensional GloVe trained on 840B Web crawl data. Most of these embeddings stay fixed, and only the 1000 most frequent question words are fine-tuned, because some question words may carry much of the signal for QA.

Exact match features are three binary indicators that say whether a paragraph token matches a question word in its original, lowercase or lemma form. Token features add the part-of-speech tag, the named entity tag and the normalized term frequency. The aligned question embedding is a weighted sum of question word embeddings, which gives soft matches between near-synonyms such as car and vehicle.

The attention weight \\(a\_{i,j}\\) is a softmax over question positions \\(j'\\) of dot products between \\(\\alpha(E(p\_i))\\) and \\(\\alpha(E(q\_j))\\), where \\(\\alpha\\) is a single dense layer with ReLU nonlinearity.

The question passes through another recurrent network on top of its word embeddings, and its hidden units are then pooled into one vector. The pooling weights are \\(b\_j = \\exp(w\\cdot q\_j)/\\sum\_{j'}\\exp(w\\cdot q\_{j'})\\), with a learned vector \\(w\\), and the question vector is \\(q=\\sum\_j b\_j q\_j\\).

## Scoring start and end positions

Two classifiers run independently over the paragraph vectors, one for the start and one for the end of the span, and each uses a bilinear term with the question vector. The start score is \\(P\_{start}(i) \\propto \\exp(p\_i W\_s q)\\) and the end score is \\(P\_{end}(i) \\propto \\exp(p\_i W\_e q)\\).

Prediction takes the start token \\(i\\) and end token \\(i'\\) with \\(i \\le i' \\le i+15\\) that maximize \\(P\_{start}(i) \\times P\_{end}(i')\\). Scores must be comparable across paragraphs, so the unnormalized exponential is used and the argmax runs over all candidate spans from all considered paragraphs.

## Building training pairs from distant supervision

SQuAD provides 87k training examples and 10k development examples, each a paragraph, a question and an answer span from that paragraph. CuratedTREC, WebQuestions and WikiMovies contain only question-answer pairs, so the reader cannot be trained on them directly. Table 2 lists 71,231 distantly supervised examples for SQuAD and 3,464 for CuratedTREC, 4,602 for WebQuestions and 36,301 for WikiMovies.

Each question first goes through the Document Retriever to get the top 5 articles. Paragraphs from those articles are dropped if they lack an exact match of the known answer, or if they are shorter than 25 or longer than 1500 characters. If the question names entities, paragraphs missing all of them are also removed. For the remaining paragraphs, each answer-matching position is scored by unigram and bigram overlap with the question in a 20-token window, the top 5 paragraphs by overlap are kept, and the question is discarded if no paragraph overlaps.

Around half of the distantly supervised SQuAD examples come from pages outside the articles SQuAD used.

## Reader accuracy on SQuAD

Tokenization, lemmas, part-of-speech and named entity tags come from Stanford CoreNLP. Training batches hold 32 examples sorted by paragraph length, the optimizer is Adamax, and dropout with p = 0.3 is applied to word embeddings and LSTM hidden units.

In Table 4, the other listed single models reach 77.3 test F1 for BiDAF, 75.9 for DCN and 75.1 for Multi-Perspective Matching. The authors state that the system surpasses all published results and matches the top of the leaderboard at the time of writing.

## Which reader features carry the gain

The ablation removes feature groups from the paragraph representation and reports F1 on the SQuAD development set.

The authors describe the two features as playing a similar but complementary role in capturing how a question is paraphrased against the context.

These features help paragraph reading on SQuAD, but they do not improve results in the full-Wikipedia setting, where a streamlined model omits the CoreNLP token features and lemmas for exact match.

## Training configurations on full Wikipedia

Three reader training setups are compared, and the Document Retriever is held fixed across them. The SQuAD setup trains on the SQuAD training set only. Fine-tune (DS) pre-trains on SQuAD and then fine-tunes separately on each distantly supervised set, while Multitask (DS) trains one reader jointly on SQuAD and all distantly supervised sets.

For WebQuestions and WikiMovies, predicted answers must come from their candidate answer lists. Answers are scored by top-1 exact-match accuracy computed with the SQuAD evaluation script.

On full-Wikipedia SQuAD, top-1 exact-match accuracy is 27.1 for the SQuAD setup, 28.4 for Fine-tune (DS) and 29.8 for Multitask (DS). On WikiMovies the values are 24.5, 34.3 and 36.5 in the same order. On CuratedTREC they are 19.7, 25.7 and 25.4, so Fine-tune (DS) is slightly higher than Multitask (DS) there. On WebQuestions they are 11.8, 19.5 and 20.7.

The authors note that the SQuAD setup stays not far behind the others, which they read as evidence of task transfer. They attribute most of the gain over SQuAD to extra in-domain data rather than task transfer, since fine-tuning on each set alone also improves results. Multitask (DS) is the reader the authors single out as the overall system.

## Gap to an unconstrained system

YodaQA draws on websites, information extraction, databases and Wikipedia, and its CuratedTREC and WebQuestions figures come from its own benchmark page. Those figures also use resources such as Freebase and DBpedia, so they are not measured under the Wikipedia-only conditions used for DrQA.

On CuratedTREC, Multitask (DS) reached 25.4 against 31.3 for YodaQA. On WebQuestions it reached 20.7 against 39.8. The authors suggest the larger WebQuestions gap arises because that dataset was built from the Freebase structure that YodaQA uses directly.

## Where accuracy drops with search

On SQuAD development exact match is 69.5 when the paragraph is given and 27.1 when the system must search all of Wikipedia.

When the correct document is given but not the paragraph, the reader reaches 49.4. The authors attribute the remaining gap to highly topical sentences in the document, which produce false positives.

They also note that SQuAD questions were written with one specific paragraph in mind, so they can be ambiguous once that context is removed. They suggest that resources designed for MRS may be needed to go further.

## Limitations

The reader is trained on paragraphs one at a time and does not aggregate evidence across paragraphs and documents during training. End-to-end training across the Document Retriever and Document Reader was not carried out; the authors list it as future work.

The WebQuestions and WikiMovies scores depend on restricting predicted answers to candidate lists, a constraint applied only to those two datasets. Full-Wikipedia results cover the four datasets used in the study.

The BM25 and embedding-space retrieval comparisons are reported only as worse, without scores. The YodaQA comparison relies on numbers from another system that uses extra resources.

## Paper info

- **Authors**: Danqi Chen, Adam Fisch, Jason Weston, Antoine Bordes
- **Venue**: arXiv · Preprint
- **First published**: 2017-3-31
- **Added**: 2026-11-12
- **Updated**: 2017-4-28
- **Version**: v2
- **arXiv**: 1704.00051
- **Category**: cs.CL
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1704.00051v2) · [PDF ↗](https://arxiv.org/pdf/1704.00051v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Danqi Chen, Adam Fisch, Jason Weston, Antoine Bordes (2017). Reading Wikipedia to Answer Open-Domain Questions. arXiv:1704.00051v2. https://arxiv.org/abs/1704.00051v2

**BibTeX**

```
@misc{chen2017reading,
  title = {{Reading Wikipedia to Answer Open-Domain Questions}},
  author = {Danqi Chen and Adam Fisch and Jason Weston and Antoine Bordes},
  year = {2017},
  eprint = {1704.00051},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1704.00051v2}
}
```

## Related papers

- [Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL](https://refivu.com/en/papers/1d3e708c-277f-497f-9bbf-8b12de718d99-adaptive-elbow-graph-traversal-for-schema-retrieval-in.md)
- [TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehension](https://refivu.com/en/papers/34db6f08-4b90-47eb-a2d8-fd0c5a90bf6e-triviaqa-a-large-scale-distantly-supervised-challenge.md)
- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://refivu.com/en/papers/569bb9ab-8345-4766-a539-e7ffb7b1754e-retrieval-augmented-generation-for-knowledge-intensive-nlp.md)
- [FEVER: a large-scale dataset for Fact Extraction and VERification](https://refivu.com/en/papers/59763d9c-0c11-477a-89ee-abea10ff28a0-fever-a-large-scale-dataset-for-fact-extraction.md)
- [Adam: A Method for Stochastic Optimization](https://refivu.com/en/papers/1e4ce3cf-c297-4440-9078-a86a09a9caca-adam-a-method-for-stochastic-optimization.md)
- [An overview of gradient descent optimization algorithms](https://refivu.com/en/papers/96d69873-e1ce-41dd-9333-645272090396-an-overview-of-gradient-descent-optimization-algorithms.md)

## Other paper commentary

- [A Neural Conversational Model](https://refivu.com/en/papers/2838569c-2f3a-45e5-86e6-549de8737d24-a-neural-conversational-model.md)
- [OpenNMT: Open-Source Toolkit for Neural Machine Translation](https://refivu.com/en/papers/d158ab7b-d0c6-4ffd-a069-53d34c28b7eb-opennmt-open-source-toolkit-for-neural-machine-translation.md)
- [Google's Multilingual Neural Machine Translation System: Enabling Zero-Shot Translation](https://refivu.com/en/papers/0924ecf7-d413-4972-9e1d-36ae4961169c-google-s-multilingual-neural-machine-translation-system.md)
- [Text Summarization with Pretrained Encoders](https://refivu.com/en/papers/7b8e7251-bfcc-4cab-9359-040ecd948516-text-summarization-with-pretrained-encoders.md)
- [SpanBERT: Improving Pre-training by Representing and Predicting Spans](https://refivu.com/en/papers/11f04ed9-a517-4d5d-a835-58a3e13f7118-spanbert-improving-pre-training-by-representing-and.md)
- [CogVideoX: Text-to-Video Diffusion Models with An Expert Transformer](https://refivu.com/en/papers/d337167e-74d3-423d-ae74-fbe584f8b441-cogvideox-text-to-video-diffusion-models-with-an.md)
- [Neural Combinatorial Optimization with Reinforcement Learning](https://refivu.com/en/papers/428e6cb1-5b5b-43dc-ad1f-c954e953fc5b-neural-combinatorial-optimization-with-reinforcement.md)
- [Towards Open Set Deep Networks](https://refivu.com/en/papers/2821701d-d008-4717-86f5-1119fb0809bf-towards-open-set-deep-networks.md)
- [Graph Embedding Techniques, Applications, and Performance: A Survey](https://refivu.com/en/papers/eeed1384-bf87-452c-b3b1-9ecc6ce7d43b-graph-embedding-techniques-applications-and-performance-a.md)
- [Expanding Performance Boundaries of Open-Source Multimodal Models with Model, Data, and Test-Time Scaling](https://refivu.com/en/papers/90a6655e-9301-4ffa-a598-267663200fa0-expanding-performance-boundaries-of-open-source-multimodal.md)
- [A Multitask, Multilingual, Multimodal Evaluation of ChatGPT on Reasoning, Hallucination, and Interactivity](https://refivu.com/en/papers/a220e44a-f4ac-4a9b-9268-eefcbafeda8e-a-multitask-multilingual-multimodal-evaluation-of-chatgpt-on.md)
- [Image Captioning with Semantic Attention](https://refivu.com/en/papers/1d01d0ec-7423-41cc-9a8a-b002bc483a11-image-captioning-with-semantic-attention.md)

## Terms in this paper

- [SQuAD](https://refivu.com/en/terms/097ea97dc6b6-squad)
- [open-domain question answering](https://refivu.com/en/terms/b846fb1506b3-open-domain-question-answering)
- [distant supervision](https://refivu.com/en/terms/a1678e57d4cf-distant-supervision)
- [WebQuestions](https://refivu.com/en/terms/4353621a1edb-webquestions)
- [DrQA](https://refivu.com/en/terms/b70d7ac85653-drqa)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/0abc2d22-75a1-4c4d-91be-624a590aabec-reading-wikipedia-to-answer-open-domain-questions)
