Natural language processing
Question Answering and Reading Comprehension
Design extractive, abstractive, open-domain, and conversational question-answering systems with answerability, evidence, calibration, and abstention.
By the end you can
- Distinguish extractive, generative, open-domain, closed-book, and conversational QA
- Represent answerability, evidence support, alternatives, and abstention explicitly
- Evaluate answer correctness separately from retrieval and citation quality
- Design QA datasets and interfaces that resist shortcuts and unsupported answers
Key idea
Sometimes the correct answer is “not supported here”
In May 2024 Google’s AI Overviews told users to add glue to pizza and to eat rocks. On 30 May Google explained the rocks answer by the absence of anything better to say: “This is what is often called a 'data void' or 'information gap,' where there's a limited amount of high quality content about a topic.” That is Elizabeth Reid, VP and Head of Google Search, writing on the company’s own blog. Satire had filled the gap. The glue answer came from sarcastic forum content. Reid listed more than a dozen fixes — better detection of nonsensical queries among them, and limits on satirical and user-generated sources — and reported content-policy violations on fewer than one in every 7 million unique queries where an AI Overview appeared. Note what the operator conceded. The system did not reason badly over its evidence. It answered where the corpus held nothing worth answering from.
Question answering requires an answerability decision before or alongside producing an answer. Unanswerable cases must be present in data, metrics, and interface behavior.
The 2018 fix was to put that decision into the data itself. Rajpurkar and colleagues added “over 50,000 unanswerable questions written adversarially by crowdworkers to look similar to answerable ones” to the existing SQuAD paragraphs — 53,775 of them by the body’s count. The cost is the headline. A system reaching “86% F1 on SQuAD” “achieves only 66% F1” once the unanswerable questions are mixed in. Twenty points of apparent reading comprehension turned out to be the habit of always producing something.
A system that always answers has not solved answerability; it has removed the option to be honest.
Comparison
Question-answering settings
The evidence boundary and output contract determine what counts as success.
The boundary bites hardest in open-domain QA over questions people actually asked, and Natural Questions is built out of exactly those. Google released it in 2019. Its abstract states the provenance plainly: “Questions consist of real anonymized, aggregated queries issued to the Google search engine.”
The counts are the lesson. The training set holds 307,373 examples. Only 152,148 have a long answer and 110,724 have a short answer. Roughly half the questions are marked null, because the retrieved Wikipedia page does not answer them. That is not an adversarial split or a stress test bolted on afterwards. It is what a corpus of real queries looks like once somebody checks whether the evidence supports an answer at all. Every setting below inherits that arithmetic. They differ only in where evidence may come from and what the system is permitted to say back.
Extractive QA
Select a span from a supplied passage.
- Evidence is local
- Boundary evaluation
- Cannot answer beyond passage
- Needs no-answer option
Abstractive or generative QA
Compose an answer from supplied or retrieved evidence.
- Can synthesize several passages
- Needs support checks
- Flexible wording
- Risk of unsupported details
Open-domain QA
Retrieve evidence from a large corpus before answering.
- Retriever and reader cascade
- Corpus freshness matters
- Attribution needed
- Candidate recall limits answer
Closed-book QA
Answer from model parameters without an external corpus.
- Simple interface
- Knowledge hard to update
- Weak provenance
- Higher verification burden
Conversational QA
Use previous turns, corrections, and discourse state.
- Context-dependent questions
- Coreference and repair
- History selection
- State and privacy risks
Visual
Evidence flow in open-domain QA
Each stage can fail while later output remains fluent.
Stage three is not a rare exception branch. In Natural Questions, roughly half of the 307,373 training examples end there: 152,148 have a long answer, 110,724 have a short answer, and the remainder are null.
1. Interpret the question
Identify need, constraints, language, entity, time, and answer type.
2. Retrieve candidate evidence
Search authorized, current documents with lexical and semantic signals.
3. Decide answerability
Determine whether evidence is sufficient, conflicting, missing, or out of scope.
4. Select or compose an answer
Extract a span or generate a concise response tied to evidence.
5. Attribute and present uncertainty
Show sources, caveats, alternatives, and safe next steps.
Example
Dataset shortcuts that inflate QA scores
A benchmark can reward pattern matching without the intended reading behavior.
Each item below is a way to score without doing the reading, and the size of such an effect is measurable. One distracting sentence, inserted into SQuAD paragraphs, took sixteen published models from an average of 75% F1 to 36%. Jia and Liang ran that test in 2017.
- Question-only clue: wording predicts the answer type or dataset source without reading the passage.
- Position bias: answers appear disproportionately in the first sentence or paragraph.
- Lexical overlap: the correct sentence repeats the question while a paraphrased distractor is ignored.
- Annotation artifacts: answerable and unanswerable questions use different style or length.
- Duplicate context: near-identical passages or questions cross train and test splits.
- Entity prior: a frequently occurring name becomes the default answer regardless of evidence.
Analogy
An open-book examination with citation rules
An open-book exam requires every claim to be supported by the provided materials, and “the material does not establish this” receives full credit when appropriate.
The packet handed out for an exam is assembled in advance, while a production corpus can be incomplete, contradictory, outdated, or permission-restricted. Reasoning and evidence availability remain separate concerns.
Answer quality begins with whether the allowed evidence supports an answer at all.
Exact match and token overlap see only part of correctness
Extractive QA often uses exact match and token-level F1 against reference spans; valid alternative spans, normalization, multi-span answers, and semantically equivalent wording can complicate these measures.
Generative QA additionally needs factual support, completeness, attribution, contradiction, concision, and utility. Human or model-assisted review requires validated rubrics and a reviewer who checks the source.
The measure arrived with the dataset. SQuAD, published in 2016, holds “107,785 question-answer pairs on 536 articles”, and in it “the answer to each question is a segment of text from the corresponding reading passage”. A span is what makes exact match and token F1 computable at all. Its authors’ own baseline was “a strong logistic regression model, which achieves an F1 score of 51.0%”, against “human performance (86.8%)”. That gap is what the metric was built to expose. It says nothing about an answer that is correct in different words.
How much correctness those measures throw away has since been counted. In 2022 Bulian and colleagues collected 23,260 human answer-equivalence ratings over 17,655 candidate answers produced by BiDAF, XLNet and LUKE on SQuAD. Their paper opens with the diagnosis: “The predictions of question answering (QA) systems are typically evaluated against manually annotated finite sets of one or more answers. This leads to a coverage limitation that results in underestimating the true performance of systems, and is typically addressed by extending over exact match (EM) with predefined rules or with the token-level F1 measure.” The result gives the bias a direction. Exact match and token-level F1 systematically underestimate QA systems, because they reject answers a human judges equivalent to — or better than — the reference. The error runs one way, against the system. 23,260 human judgements is what it took to show it.
23,260 human ratings say the same thing about exact match and token F1: they miss correctness, and they miss it in one direction.
Key idea
A citation can be present and still fail
The cited passage may be irrelevant, outdated, permission-inappropriate, or unable to support the specific claim; a generated sentence can also contain several claims while one citation supports only part of them.
Evaluate citation entailment or support at claim level, source authority, freshness, and coverage; the interface should not use citation formatting as a visual substitute for verification.
Somebody has checked. In 2023 Liu and colleagues had humans audit four generative search engines — Bing Chat, NeevaAI, perplexity.ai and YouChat — sentence by sentence against the citations those systems had attached. The result: “on average, a mere 51.5% of generated sentences are fully supported by citations”. And “only 74.5% of citations support their associated sentence”. Responses that were “fluent and appear informative” carried, on average, one unsupported sentence in two.
The same failure has now been measured on deployed assistants, by the people whose journalism they summarise. Journalists at 22 public service media organisations, in 18 countries and 14 languages, evaluated 2,709 news answers from ChatGPT, Copilot, Gemini and Perplexity. The BBC and the European Broadcasting Union published the result on 21 October 2025. 45% of those answers contained at least one significant issue. The largest single cause was not getting the facts wrong: “Sourcing was the biggest cause of problems, with 31% of all responses having significant issues with sourcing – this includes information in the response not supported by the cited source, providing no sources at all, or making incorrect or unverifiable sourcing claims.” Accuracy accounted for 20% of responses and context for 14%. Gemini alone had significant issues in 76% of its responses. The citation relationship broke more often than the facts did.
Retrieval does not remove the problem. It moves it somewhere harder to see. A preregistered benchmark put 202 legal queries to retrieval-augmented commercial QA tools sold as “hallucination-free”, and found that they hallucinate between 17% and 33% of the time. Grounding a generator in retrieved documents changes the shape of the error. It does not license the marketing claim.
On 2,709 audited news answers, sourcing failed more often than facts: 31% against 20%.
Steps
Build a QA evaluation set with real answerability
The set should expose the complete retrieval and answer decision.
Step three is where most evaluation sets are thin, and it does not require invention. Natural Questions reached its null cases by taking real queries and recording that the retrieved Wikipedia page did not answer them: 307,373 training examples, 152,148 with a long answer, 110,724 with a short answer. The unanswerable cases were counted, not simulated.
1. Sample real information needs
Include exact facts, explanations, procedures, comparisons, and follow-ups.
2. Freeze evidence versions
Record corpus snapshot, permissions, dates, and document identifiers.
3. Add plausible unanswerable cases
Use related passages with missing, conflicting, or out-of-scope evidence.
4. Annotate answers and support
Allow alternatives, evidence spans, caveats, and reasons for abstention.
5. Test the full cascade
Measure retrieval, answerability, answer, citation, latency, and repair separately.
Create a paired answerability challenge
For ten answerable questions, create a minimally changed version that the corpus cannot support; preserve topic and wording so the difference depends on evidence, date, jurisdiction, or entity.
Measure answer rate, abstention precision, retrieval overlap, and claim support. Inspect whether the model answers from prior associations instead of the supplied corpus.
This exercise has been run in public, on a deployed system, by a reporter. New York City launched its MyCity chatbot in October 2023, on Microsoft's Azure AI services, to answer small-business questions. On 29 March 2024 Colin Lecher of The Markup published what came back when he asked it questions whose answers are fixed by the city's own law. Landlords, it said, need not accept Section 8 housing vouchers. On whether an employer may take a share of workers' tips: “Yes, you can take a cut of your worker's tips.” Both answers were fluent. Both were confidently wrong about the law the tool existed to explain. Neither came with any signal that the system had no authority to give them. The city left the tool online; Mayor Eric Adams acknowledged on 2 April 2024 that its answers were wrong in some areas.
Abstention is the other half of the same measurement, and its price can be read off a table. The legal benchmark reports: “As shown in Figure 4, Lexis+ AI provides accurate (i.e., correct and grounded) responses on 65% of queries, while Ask Practical Law AI refuses to answer queries 62% of the time and responds accurately just 18% of the time.” Thomson Reuters's Ask Practical Law AI declines most of what it is asked and is still accurate on only 18%. Silence is not by itself honesty. Answer rate and abstention precision have to be measured together, or a system can look careful and be wrong at the same time.
A good no-answer test is close enough to tempt an unsupported response.
Case
One inserted sentence took sixteen models from 75 to 36
The paired test is simple. In 2017 Jia and Liang inserted into a SQuAD paragraph a single distracting sentence, “automatically generated to distract computer systems without changing the correct answer or misleading humans”. Then they reran the models. “In this adversarial setting, the accuracy of sixteen published models drops from an average of 75% F1 score to 36%; when the adversary is allowed to add ungrammatical sequences of words, average accuracy on four models decreases further to 7%.” Sixteen systems, one added sentence, half the score gone.
Figure
Position
A benchmark measures the questions somebody thought to write down
A leaderboard gets read as a measurement of an ability. It is a measurement of the questions in a file. Four of the papers in this lesson make that unusually easy to see, because the same name is on all four.
SQuAD came first, in 2016: 107,785 question–answer pairs over 536 articles, the answer to each question a segment of text from its passage, a logistic-regression baseline at 51.0 F1 and human performance at 86.8. Robin Jia and Percy Liang broke it in 2017. One inserted sentence — generated to distract computer systems without changing the correct answer or misleading humans — took sixteen published models from an average of 75 F1 to 36, and four of them to an average of 7 once the inserted text was allowed to be ungrammatical. The repair came in 2018: over 50,000 unanswerable questions written adversarially, 53,775 by the body’s count, after which a system reaching 86 per cent F1 on the original scored 66. Then the 2023 audit of four generative search engines, in which a mere 51.5 per cent of generated sentences were fully supported by their citations. Percy Liang co-authored all four.
Read that sequence as a schedule rather than as a scoreboard. Each gap took another paper and another year, written by people who already had the dataset in front of them and still had to build the file that would expose it. None of the leaderboards in between was lying. Each reported accurately on the questions it contained. What none of them could report on was the questions nobody had written yet — the ones with no answer in the passage, the ones with a plausible distractor sitting beside the evidence.
The schedule did not stop with those four. Natural Questions arrived in 2019 with 307,373 training examples of which only 152,148 have a long answer, a file in which the missing answers were counted at construction time instead of discovered by a later adversary. Bulian and colleagues arrived in 2022 with 23,260 human ratings showing the error running the other way, the metric marking correct answers wrong. Then the measurement left the benchmark entirely: 2,709 news answers checked by journalists at 22 public service media organisations, 202 legal queries put to products sold as “hallucination-free”. Each of those is another class of question somebody finally wrote down. Each found something the previous file could not have shown.
So the defensible reading of a benchmark result is bounded and dated: this system answers this class of question, as of the last time somebody thought of a new class. That is a much smaller claim than reading comprehension, and it is the claim the evidence in this lesson supports. It also says which number deserves attention, and it is not the one at the top of the table. It is the size of the drop the last time somebody added a kind of example the file did not contain: thirty-nine points in 2017, twenty in 2018.
Thirty-nine points from one inserted sentence, twenty from questions with no answer. Neither kind was in the file until somebody wrote it.
Key takeaways
- Question answering varies by evidence boundary, output form, retrieval stage, conversation context, and permission to answer.
- Answerability is a first-class prediction, not an edge case: of Natural Questions' 307,373 training examples, only 152,148 have a long answer on the retrieved Wikipedia page and 110,724 have a short one.
- Open-domain QA requires separate retrieval, reader, answerability, answer, citation, and presentation evaluation, because a data void at stage two still produces a fluent sentence at stage five.
- Exact match and token overlap err in one direction: 23,260 human ratings collected by Bulian and colleagues show the measures reject answers a person judges equivalent to, or better than, the reference.
- Citations must support individual claims — 51.5% of generated sentences in four search engines were fully supported, and sourcing was the biggest problem in the BBC–European Broadcasting Union audit, hitting 31% of 2,709 news answers against 20% for accuracy.
- Strong QA evaluation uses realistic questions, frozen evidence, plausible no-answer pairs, support annotations, cascade diagnostics, and abstention read against accuracy — Ask Practical Law AI refuses 62% of queries and is still accurate on just 18%.