← AI Terminology
Question Answering
Question answering (QA) is an NLP task where a model produces a direct answer to a natural language question — either by extracting a span from a provided document (extractive QA), generating an answer from knowledge (open-domain QA), or combining retrieval and generation (RAG-based QA).
It is the canonical task that LLMs have transformed most completely.
It is the canonical task that LLMs have transformed most completely.
Why It Matters in AI
QA is the practical interface through which people extract value from AI: search engines, customer support bots, enterprise knowledge bases, and medical decision support all reduce to QA. BERT's breakthrough on SQuAD 2.0 (2018) first achieved human-level extractive QA. LLMs then generalised this to open-domain QA without document retrieval — answering arbitrary questions from parametric knowledge. RAG combines both: retrieve relevant documents, then generate a grounded answer.
Key Points
| Aspect | Description |
|---|---|
| RAG QA | Retrieve relevant documents → generate grounded answer — dominant production architecture |
| Multi-hop | Requires combining information from multiple passages — HotpotQA, MuSiQue benchmarks |
| Evaluation | EM (Exact Match), F1 (token overlap) for extractive; ROUGE, human evaluation for generative |
| Open-domain | No provided context — model uses parametric knowledge or retrieval — TriviaQA, Natural Questions |
| Extractive QA | Identify the answer span in a given passage — SQuAD benchmark; BERT/RoBERTa models |
| Abstractive QA | Generate an answer in free text — may not exist verbatim in any passage; requires reasoning |
Simple Analogy
A reference librarian: given a question, they either find the exact passage in a book (extractive), summarise knowledge from multiple sources (abstractive), or first locate the relevant books and then answer from them (RAG). LLMs replaced the librarian for most everyday questions — the library is now in the model's weights.
Common Usage Examples
- Extractive QA:
pipeline("question-answering", model="deepset/roberta-base-squad2")(question, context) - RAG:
qa_chain = RetrievalQA.from_chain_type(llm=ChatOpenAI(), retriever=vectorstore.as_retriever()) qa_chain.run("What is the company's revenue growth rate?")— RAG over financial documents- SQuAD:
datasets.load_dataset("squad")— 100K extractive QA pairs from Wikipedia - Closed-book:
client.messages.create(model="claude-opus-4-7", messages=[{"role":"user","content":"Who discovered penicillin?"}])
Summary
In short: Question answering is the task of producing direct answers to natural language questions — the practical interface for most AI value extraction, transformed by LLMs from narrow extractive systems into general open-domain knowledge engines.