Sub topic 14
Limitations and Common Failure Modes
Assume you know basic Python, tokenization, transformer encoders, and the meaning of start and end logits. Extractive question answering (QA) is useful because it copies an answer from a supplied context. That design also creates strict limits: the model cannot reliably answer with information that is absent, rewrite the answer in a new form, or inspect text that was never included in its input.
Where the approach fails
A QA model predicts a text span, not a complete explanation. It can select a plausible phrase even when the question is ambiguous or the context does not support an answer. The model's confidence score measures preference among candidate spans. It is not a proof that the answer is correct.
Common failure modes include:
- Answer absent from the context: An extractive model may still select an unrelated span unless it was trained to predict a null answer.
- Ambiguous wording: A question such as “Who approved it?” may have several possible people or references for “it.”
- Reasoning across passages: The answer may require combining facts from separate documents. A single-context span model cannot perform this reliably.
- Boundary errors: The model finds the right idea but includes extra words or stops too early.
- Tokenization errors: Subword tokens and offset mappings can cause labels or decoded text to point to the wrong characters.
- Long-context errors: Truncation can remove the answer. Overlapping windows can produce duplicate or inconsistent candidates.
- Domain shift: A model fine-tuned on news or Wikipedia may perform poorly on medical notes, contracts, or informal messages.
- Distractors: Repeated names, dates, or phrases can make a locally plausible span look more likely than the correct one.
A practical error-analysis loop
Separate errors caused by the model from errors caused by preprocessing. First inspect the original question and context. Then check the selected token indices, offset mappings, and decoded character span. For long contexts, record which window produced the answer.
| Symptom | Likely cause | Useful check |
|---|---|---|
| Answer is unrelated | No-answer handling is missing | Compare the best span with the null score |
| Answer is cut off | Incorrect span boundary | Inspect start and end offsets |
| Correct answer disappears | Context was truncated | Log window coverage and stride |
| Scores look good but F1 is low | Wrong normalization or labels | Compare prediction and reference text |
| Performance drops on new data | Domain shift | Evaluate by document and question type |
A useful diagnostic set groups examples by question type: fact lookup, multi-sentence reasoning, ambiguous reference, unanswerable question, and long-context question. Look for patterns instead of examining only the average score.
Choosing a different architecture
Use extractive QA when the answer should be copied exactly and the relevant passage is known. Use retrieval-augmented QA when the relevant passage must first be found across a document collection. Use generative QA when the answer must summarize, combine evidence, translate, or explain.
These approaches can also be combined. A retriever can select passages, an extractive reader can identify evidence spans, and a generator can produce a fluent response. The extra stages improve coverage but add latency and new failure points, such as retrieving the wrong passage or generating claims unsupported by the evidence.
Evaluation limits
Exact match requires normalized prediction text to match a reference exactly. F1 gives partial credit for overlapping tokens. Neither metric measures whether the answer is useful, well-supported, or sufficient for a multi-step question. Report results by category when possible, and inspect false positives and false negatives manually.
Exercise
A model returns a high-scoring span from a window that does not contain the reference answer. Name two likely causes and one diagnostic step.
Show answer
The context may have been truncated incorrectly, or the model may have selected a plausible distractor because no-answer handling is weak. Check the window's offsets and compare its span with the null-answer score.