- Introduced by
- Rajpurkar, Zhang, Lopyrev & Liang (SQuAD)
- Year
- 2016
- Type
- NLP question-answering task
What does it do?
Machine reading comprehension (MRC), popularised by the SQuAD benchmark of Rajpurkar, Zhang, Lopyrev and Liang (2016), is a natural-language-processing task in which a model answers questions about a given passage.
Answers may take the form of a selected option, a span extracted from the passage, or a short free-form response. SQuAD's answers are segments of text from the reading passage, which is why extractive answering is the form most closely associated with the benchmark.
The intuition behind the method
Imagine handing a reader a paragraph and then asking a question about it — a good reader does not recite the whole text, they locate the relevant sentence and pull out the precise answer. MRC teaches a machine to do the same: rather than searching a whole library, it focuses on one supplied passage, lines the question up against the wording, and returns the span or statement that answers it. The passage is the ground truth, so the model's job is comprehension within that context, not free recall.
History
MRC was catalysed by SQuAD (Rajpurkar et al., 2016), a dataset of more than 100,000 questions posed by crowdworkers on Wikipedia articles, where each answer is a segment of the corresponding passage. Later datasets such as HotpotQA (Yang et al., 2018) target diverse, explainable multi-hop question answering.
When to use it
Use MRC when you have text passages and need answers to questions that are grounded in those passages, for example knowledge access over documents, tutoring tools, or question answering over a bounded text collection. Do not use it when no supporting passage exists, because the model cannot supply an answer the text does not contain. Avoid it when questions are vague or compound, when the answer depends on knowledge outside the passage, or when a question needs evidence gathered from several sources, which calls for a multi-hop setting.
Limitations and considerations
- Answers are only as good as the passage; if the text does not contain the answer, the model cannot supply it.
- Vague or ambiguous questions degrade accuracy, since the model has no way to clarify intent.
- Extractive answers are limited to wording that already appears in the passage, so paraphrased or inferred answers may be scored as wrong.
- Questions that require combining evidence from multiple places (multi-hop reasoning) remain hard. HotpotQA (Yang et al., 2018) was built to test multi-hop question answering.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- For extractive answers, which are spans copied from the passage, each response can be checked against a specific piece of text rather than against free recall.
- Covers multiple-choice, extractive and open-ended answer forms within one task framing.
- The encode step can build on pretrained transformer language models, so comprehension does not have to be learned from scratch.
Applications
- Knowledge access: answering user questions directly from documents or manuals.
- Educational technology: answering learners' questions about a supplied reading passage.
- Querying research databases by posing natural-language questions over stored passages.
- Building question-answering layers over institutional or domain-specific text collections.
How it works
How it works
The pipeline takes two inputs: a context passage and a clearly formulated question. The passage must actually contain (or support) the answer, and the question has to be unambiguous, because the model can only answer with respect to the text it is given.
A pretrained transformer language model processes the question and the passage together, producing a joint representation from which the parts of the passage that bear on the question can be identified. This is the step where the model relates the wording of the question to the wording of the text.
From that joint representation the model produces an answer: it selects an option for a multiple-choice item, extracts the answer span from the passage for an extractive question, or generates a short open-ended response. An extracted span is a piece of the passage itself and can be checked directly against it. An open-ended response is generated and may paraphrase the text or go beyond it, so it has to be verified against the passage before it is relied on.
Predicted answers are scored against reference answers. For extractive, SQuAD-style evaluation there are two standard measures. Exact match (EM) gives a prediction a score of 1 if it equals the reference answer after standard text normalisation (case, punctuation and articles removed), and 0 otherwise. Token-overlap F1 is the harmonic mean of token precision and recall between the predicted and reference spans, giving partial credit for partly correct answers. Both are averaged over all questions. Multiple-choice items are scored by accuracy, the proportion of correct selections. The original SQuAD paper gives reference points for reading a score: a logistic regression model reached an F1 of 51.0%, a simple baseline reached 20%, and human performance was 86.8%. Errors should then be inspected by hand, especially questions that require combining evidence from several places in the text, since a high overlap score can hide answers that are only partly correct.
Common pitfalls
- Expecting an answer that is not present in the passage. MRC reads the given context and does not retrieve outside knowledge.
- Feeding ambiguous or compound questions, which split the model's focus and produce partial answers.
- Reporting only fluency or surface plausibility. Score predictions against reference answers with exact match and token-overlap F1, and use accuracy for multiple-choice items.
- Accepting a fluent answer without checking it against the passage. A reader can return a confident answer that the passage does not support or that is wrong, and open-ended responses are the most exposed. Check each answer against the passage span it cites. Where the application allows, provide a way for the system to decline to answer.
- Assuming single-passage models handle multi-hop questions. Multi-hop reasoning is a distinct and harder setting, which dedicated datasets such as HotpotQA (Yang et al., 2018) address.
Frequently asked questions
What is the difference between multiple-choice and extractive MRC?
In multiple-choice MRC the model picks the correct option from a fixed set, while in extractive MRC it identifies and returns the exact span of the passage that answers the question. Open-ended MRC instead produces a short free-form answer, which need not be copied verbatim from the passage. All three read the same supplied passage; they differ in how the answer is delivered.
Can the model answer if the passage does not contain the answer?
No. MRC answers with respect to the given context. If the passage does not contain or support the answer, the task cannot produce a reliable one, which is why a relevant, sufficient passage is a prerequisite.
Why does question phrasing matter so much?
The model aligns the question against the passage to locate the answer, so a clearly formulated, unambiguous question is essential. Vague or compound questions split the model's focus and lead to partial or incorrect answers.
What makes multi-hop questions harder?
Multi-hop questions require combining evidence from several places, often several documents, before an answer can be formed. Single-passage models that excel at locating one span struggle here, which is why dedicated multi-hop datasets such as HotpotQA were created.
Related methods
Sources
Rajpurkar, P., Zhang, J., Lopyrev, K. & Liang, P. (2016). SQuAD: 100,000+ Questions for Machine Comprehension of Text. EMNLP, 2383-2392.
Open DOI referenceYang, Z. et al. (2018). HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answering. EMNLP.
Open DOI reference