Question Answering
Question answering (QA) is the task of getting an AI system to give a direct answer to a question, rather than just a list of links.
Overview
It powers search snippets, virtual assistants, and customer-support bots that pull precise answers from documents or knowledge.
Deep Dive
QA systems come in two main flavors. Extractive QA finds the exact span of text in a provided passage that answers the question, like highlighting a sentence in an article. Generative QA writes a fresh answer in its own words, which is what large language models do. A crucial distinction is open-book versus closed-book. Closed-book systems answer purely from knowledge baked into their weights, which risks confident-but-wrong answers. Open-book systems first retrieve relevant documents, then answer using that text, an approach called retrieval-augmented generation that grounds answers in real sources and lets them cite where the information came from. Strong QA also handles unanswerable questions, recognizing when the passage simply does not contain the answer instead of inventing one.
Technical Insight
Extractive QA models predict two probabilities for each token: how likely it is to be the start of the answer and how likely it is to be the end. The span with the highest combined start-and-end score becomes the answer. Modern open-book QA instead embeds the question, retrieves the most similar passages from a vector database, and feeds those passages to a language model that composes the answer. Grounding answers in retrieved text dramatically reduces hallucination compared with relying on the model's memory alone.
Strategic Impact
Speed and scale
Language workflows can move faster without sacrificing consistency.
Access and reach
It expands access across languages and communication styles.
Clearer decisions
Teams can spend more time on judgment while automation handles repetition.
The Future of Question Answering
QA is moving toward systems that show their work: answers paired with citations, confidence signals, and links back to source passages so users can verify them. Multi-hop reasoning, combining facts from several documents to answer harder questions, is improving. Expect tighter integration with live data through retrieval and tools, so assistants answer about current events, private company documents, or personal files rather than only static training knowledge. Reliable abstention, saying 'I don't know' when evidence is missing, will be a key quality marker.
Real-World Implementation
Search engines showing a direct featured-snippet answer extracted from a web page at the top of results.
Customer-support bots that retrieve the relevant help-center article and answer a user's specific question from it.
Voice assistants like Siri or Alexa responding to factual questions such as 'how tall is the Eiffel Tower?'.
Internal company tools that answer employee questions by pulling from policy documents and citing the source page.
Risks & Guardrails
Hallucinated facts can quietly enter reports, support flows, or research outputs.
Prompt sensitivity can create inconsistent results across similar requests.
Sensitive text data may be exposed if access controls are weak.
Implementation Roadmap
Define output format, tone, and quality standards before rollout.
Ground responses with trusted sources whenever accuracy matters.
Keep a human review checkpoint for high-stakes outputs.
Track failure patterns and retrain prompts or workflows regularly.
Keep Exploring
Free newsletter
Keep up with AI in 3 minutes a day
One short email each weekday with the three AI stories that actually matter. Free forever, no ads.
One email each weekday. Unsubscribe in one click. We never sell or share your address.
Test yourself
Take the Question Answering quiz
Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.
Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation
Next guide
Visual Question Answering
Frequently asked questions
What is Question Answering?
Question answering (QA) is the task of getting an AI system to give a direct answer to a question, rather than just a list of links. It powers search snippets, virtual assistants, and customer-support bots that pull precise answers from documents or knowledge.
What does an extractive question answering system do?
Extractive QA highlights the precise span within a given passage that contains the answer, rather than generating new text.
What is the key difference between closed-book and open-book QA?
Closed-book QA relies only on knowledge stored in the model's weights, while open-book QA retrieves relevant text and answers from it.
Why does retrieval-augmented generation reduce hallucination?
By feeding the model real retrieved passages, the answer is anchored to actual sources, reducing the chance of invented facts.
In extractive QA, what does the model predict for each token?
The model assigns start and end probabilities to tokens, and the highest-scoring span is returned as the answer.
What is a sign of a well-designed QA system when the passage lacks the answer?
Strong QA systems can abstain, identifying when the provided text does not contain an answer instead of fabricating one.