Natural Language Processing (NLP)

Question Answering

Definition

Question answering (QA) systems accept a natural language question and return a precise answer, optionally grounded in a source document or corpus. Extractive QA identifies the answer span within a provided passage (as in SQuAD benchmarks); generative QA produces free-form answers using language models. Open-domain QA retrieves relevant documents then extracts or generates answers. Modern QA systems typically use a retriever (BM25 or dense embeddings) to fetch relevant context and a reader (transformer) to extract or generate the answer. QA is the core technology behind RAG systems and AI chatbots that answer knowledge base queries.

Why It Matters

Question answering is the fundamental capability that makes AI chatbots useful for knowledge retrieval. When a user asks 'How do I reset my password?' or 'What is the refund policy?' a QA system can extract the precise answer from documentation rather than returning a list of potentially relevant links. This transforms the user experience from search to conversation. Accurate QA reduces support ticket volume by deflecting queries to self-service, directly reducing operational costs.

How It Works

Modern open-domain QA uses a two-stage retrieve-then-read pipeline. The retriever (typically a BM25 index or a bi-encoder dense retrieval model) selects the top-k passages from a large corpus based on query similarity. The reader (a cross-encoder transformer like BERT fine-tuned on SQuAD) processes each passage with the question and predicts the answer start/end positions within the passage. For generative QA, a seq2seq model generates the answer conditioned on retrieved passages. RAG combines both paradigms for grounded, fluent answers.

Extractive Question Answering — Answer Span Detection

Question

When was OpenAI founded?

Context Passage (answer span highlighted)

OpenAI was founded in December 2015 by Sam Altman, Greg Brockman, Elon Musk, and others. The company released GPT-4 in March 2023, which demonstrated strong performance across many benchmarks. OpenAI is headquartered in San Francisco, California.

Extracted Answer

December 2015

92%
Exact Match
95%
F1 Score
97%
Confidence

Real-World Example

A software documentation chatbot uses extractive QA to answer developer questions against 500+ pages of API docs. When a developer asks 'What is the rate limit for the messages endpoint?' the system retrieves the rate-limits section and extracts '100 requests per minute per API key' as the answer span. This deflects 67% of developer support tickets, freeing engineering time for complex integration questions.

Common Mistakes

  • Expecting QA models to answer questions not covered by retrieved documents—models hallucinate when context is insufficient
  • Using a single passage as context—complex questions often require synthesizing information from multiple sources
  • Ignoring answer confidence scores—low-confidence answers should trigger fallback to human support

Related Terms

Ready to build your AI chatbot?

Put these concepts into practice with 99helpers — no code required.

Start free trial →
What is Question Answering? Question Answering Definition & Guide | 99helpers | 99helpers.com