P

Question Answering: Definition and Examples

Question Answering (QA) is a branch of natural language processing that aims to generate accurate and relevant answers to questions posed in natural language.

Full definition

Question Answering (QA) is a field of artificial intelligence that involves developing systems capable of understanding a question formulated in natural language and providing an exact answer. Unlike a traditional search engine that returns a list of documents, a QA system directly extracts or generates the expected answer.

Several types of Question Answering exist. Extractive QA identifies and extracts a precise passage from an existing document corpus. Generative QA, on the other hand, formulates an original response by synthesizing available information — this is how large language models like Claude or GPT work. There is also open-domain QA, which answers questions on any topic, and closed-domain QA, specialized in a specific knowledge area.

With the rise of LLMs, Question Answering has become one of the most common use cases of generative AI. Retrieval-Augmented Generation (RAG) techniques combine document retrieval and generation to provide answers that are both accurate and grounded in verifiable sources. In prompt engineering, mastering QA allows you to formulate questions that maximize the quality and reliability of responses.

Applications are numerous: enterprise virtual assistants, customer support chatbots, medical research systems, educational tools, and interactive knowledge bases. The quality of a QA system is mainly measured by the relevance, accuracy, and completeness of its answers.

Etymology

The term 'Question Answering' comes from English and literally means 'answering questions'. This research field has existed since the 1960s with early systems like BASEBALL (1961) and LUNAR (1972), but it saw major growth with the TREC QA competitions in the 2000s, then a revolution with the arrival of Transformer models from 2018 onward.

Concrete examples

Automated customer support

Based solely on the following documentation, answer the customer's question concisely and accurately. If the answer is not in the documentation, state it clearly. Documentation: {CONTEXT}. Question: {QUESTION}

Legal document analysis

You are a legal assistant. Carefully read the following contract and answer the question by citing the relevant clauses: what are the conditions for early termination? Contract: {DOCUMENT}

Review and learning

I will ask you questions about World War II. For each answer, cite your historical sources and indicate your level of certainty. Question: What were the economic causes of the conflict?

Practical usage

In prompt engineering, Question Answering is optimized by formulating precise questions, providing relevant context, and explicitly asking the model to cite its sources or signal uncertainties. Using techniques like RAG anchors answers in reliable documents and reduces hallucinations. Structuring prompts with a role, context, and expected answer format significantly improves QA quality.

Related concepts

Retrieval-Augmented Generation (RAG)Natural Language Processing (NLP)Information extractionGrounding

FAQ

What is the difference between extractive and generative Question Answering?
Extractive QA locates and extracts an exact passage from a source document to answer the question. Generative QA, used by LLMs, synthesizes information and formulates an original response in natural language. Modern approaches like RAG combine both: retrieving relevant passages then generating a synthetic answer.
How can hallucinations be reduced in a Question Answering system?
Several strategies exist: providing precise documentary context in the prompt, asking the model to cite its sources, using a RAG architecture to anchor answers in verified documents, and adding an explicit instruction like 'if you don't know the answer, say so' to avoid made-up responses.
Does Question Answering work in all languages?
Current large language models like Claude support QA in many languages, including French. However, performance may vary by language due to imbalances in training data. For critical use cases in a specific language, it is recommended to test answer quality and use source documents in the target language.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.