Question Answering (QA) is a task in natural language processing (NLP) where a system is designed to automatically extract or generate a direct, accurate, and concise answer to a user’s question, usually based on a given text passage, document collection, or Knowledge Graph. Unlike traditional document retrieval, which returns a list of relevant documents, a QA system provides the specific, factual answer.
Context: Relation to LLMs and Search
QA is the most visible and valuable end-goal for systems utilizing Large Language Models (LLMs), forming the core of all modern search and Generative Engine Optimization (GEO) efforts.
- Generative Snippets: The output of a modern search engine or conversational AI is a Generative Snippet—a direct answer to the user’s question. This snippet is the output of a high-performance QA system, typically built on the Retrieval-Augmented Generation (RAG) architecture.
- Factual Grounding: RAG systems enable high-quality QA by first using Vector Search to retrieve highly relevant context (the Retrieval step) and then feeding that context to an LLM, which extracts and synthesizes the final answer (the Generation step). This “grounded” approach prevents the LLM from generating false or unsupported information (Hallucination).
- GEO Strategy: For content providers, optimizing for QA means ensuring that content is structured in a way that allows the system to easily identify factual answers (e.g., using explicit headers, lists, and Structured Data like Schema.org) to maximize the probability of becoming the source for a generative answer.
Types of Question Answering
QA systems are generally categorized by the nature of the answer source and the method of extraction:
1. Extractive QA
- Mechanism: The system identifies and extracts a span of text directly from the source document that contains the answer. The model predicts the starting and ending token indices of the answer.
- LLM Connection: Often uses Encoder-only Transformer Architecture models (like BERT) trained on datasets like SQuAD (Stanford Question Answering Dataset).
- Strength: Guarantees factual accuracy since the answer is a direct quote.
2. Abstractive QA (Generative QA)
- Mechanism: The system generates a novel answer by summarizing, paraphrasing, or synthesizing information from the source text. The answer may use words that were not present in the original source documents.
- LLM Connection: Uses Decoder-only or Encoder-Decoder Transformer Architecture models (like GPT or T5). This is the approach used for creating modern Generative Snippets.
- Strength: Produces more fluent, natural-sounding, and concise answers, which is preferred for conversational AI.
3. Knowledge Base QA
- Mechanism: The system answers questions by querying structured data stored in a Knowledge Graph (KB). The query is translated into a structured query language (like SPARQL or Cypher), and the result (a fact or entity) is returned.
- Strength: Highly reliable for factual questions involving relationships between Entities (e.g., “Who directed the movie starring actor X?”).
Related Terms
- Retrieval-Augmented Generation (RAG): The current best-practice architecture for building high-performance QA systems.
- Context Window: The space within the LLM where the retrieved context for the QA task is injected.
- Hallucination: The risk that QA systems are designed to mitigate by using factual context.