Technology and computing
Retrieval-augmented generation
Retrieval-augmented generation (RAG) is a technique that enhances large language models (LLMs) by integrating external information retrieval during response generation. Introduced in 2020 by Facebook AI Research, RAG addresses the limitations of static training data by allowing models to access up-to-date, domain-specific, or private information. It improves accuracy, reduces hallucinations, and enables fact-based responses without retraining. RAG is now widely used across industries, especially in healthcare and enterprise settings, though challenges remain in context interpretation and evaluation.
How RAG Works
RAG allows LLMs to use non-public, domain-specific, or updated information not available in the model's original training data.
RAG helps reduce AI hallucinations, such as describing non-existent policies or recommending nonexistent legal cases.
RAG extends LLM capabilities to specific domains or an organization's internal knowledge base without requiring model retraining.
RAG is a cost-effective approach to improving LLM output so it remains relevant, accurate, and useful in various contexts.
Given a user query, a document retriever selects the most relevant documents to augment the query before the LLM generates a response.
Data to be referenced in RAG is typically converted into LLM embeddings, numerical representations stored in a vector database.
RAG can be used on unstructured, semi-structured, or structured data, including knowledge graphs.
RAG allows LLMs to include sources in their responses, enabling users to verify cited information.
Benefits and Applications
The term retrieval-augmented generation (RAG) was introduced in a 2020 paper that described combining a parametric language model with a non-parametric external memory accessed through retrieval at inference time.
RAG improves LLMs by incorporating information retrieval before generating responses.
RAG was first proposed in 2020 by Facebook AI Research as a solution to the knowledge limitations of language models.
RAG has been studied in healthcare as a way to ground LLM outputs in external medical knowledge sources, though challenges remain in evaluation and ethics.
Limitations and Challenges
RAG can reduce factual errors, but it does not solve all the problems, such as when LLMs misinterpret context from factually correct sources.
An example of RAG failure is an AI-generated response stating, 'The United States has had one Muslim president, Barack Hussein Obama,' based on a rhetorical chapter title.
RAG is programmed to prioritize new information, a technique sometimes called 'prompt stuffing'.
More
RAG is used to improve LLM performance by blending the LLM process with a web search or document lookup to help LLMs stick to the facts.
RAG reduces the need to retrain LLMs with new data, saving on computational and financial costs.
Related
Written by 1x0 AI from public sources. Checked 2 December 2026.
Text: CC BY-SA 4.0, free to reuse and adapt with a link to this page, under the same licence. Photos and illustrations: as credited.