LLMVisibility.wikiThe sourced reference on how AI assistants learn about, find and cite brands

Retrieval-augmented generation

From LLMVisibility.wiki

Retrieval-augmented generation (RAG) is a technique that lets large language models retrieve external documents and use them, alongside their trained parameters, to produce an answer.[2] It was introduced in a 2020 paper that combined a pre-trained parametric model with a non-parametric index of text accessed through a neural retriever.[1] Later work extended the idea to browsing with citations and to graph-structured summaries of document collections.[5][3]

Key facts. RAG was proposed in a 2020 paper combining a seq2seq language model with a dense vector index retrieved by a neural retriever, and has since been extended to web-browsing systems and graph-based retrieval.[1][5][3]

Definition

Retrieval-augmented generation enables large language models to retrieve and incorporate new information from external data sources rather than relying only on what was learned during training.[2] With RAG, a model first refers to a specified set of documents and then responds to a user query, so retrieved text supplements information already present in the training data.[2] This allows systems to use domain-specific or updated information not available in the original training set, and to include sources in their responses so that answers can be checked.[2] The approach is widely discussed in relation to parametric versus retrieved knowledge and to grounding and web search tools.

The original RAG design

The term was introduced in a 2020 paper describing models that combine pre-trained parametric and non-parametric memory for language generation.[1] In that design, the parametric memory is a pre-trained sequence-to-sequence model and the non-parametric memory is a dense vector index of Wikipedia accessed with a pre-trained neural retriever.[1] The authors compared two formulations, one conditioning on the same retrieved passages across a whole generated sequence and another that can use different passages per token, and reported state-of-the-art results on three open-domain question answering tasks, outperforming parametric-only seq2seq models and task-specific retrieve-and-extract architectures.[1] They also found that RAG models generated more specific, diverse, and factual language than a parametric-only baseline.[1] This directly addressed the paper's stated concern that pre-trained models store factual knowledge in their parameters but have limited ability to access and precisely manipulate it, and that providing provenance for their decisions remains an open research problem.[1] The approach is closely tied to how systems handle knowledge cutoffs and long-tail knowledge about small brands.

Browsing and citing: WebGPT

A separate line of work fine-tuned GPT-3 to answer long-form questions using a text-based web-browsing environment that let the model search and navigate the web, a system known as WebGPT.[5] The task was designed so it could be performed by humans, allowing the model to be trained with imitation learning and then refined with human feedback on answer quality.[5] To make human evaluation of factual accuracy easier, the models were required to collect references while browsing in support of their answers.[5] Evaluated on ELI5, a dataset of questions asked by Reddit users, the best model's answers were preferred by humans 56% of the time over human demonstrators and 69% of the time over the highest-voted Reddit answer.[5] This browsing-and-citing pattern is relevant to how later assistants are described in pages on how ChatGPT finds and cites sources, how Claude finds and cites sources, how Gemini finds and cites sources, and how Perplexity finds and cites sources.

Graph-based retrieval

Standard RAG retrieves relevant passages for a specific question but struggles with global questions directed at an entire text corpus, such as asking for the main themes in a dataset, because that is inherently a query-focused summarization task rather than an explicit retrieval task.[3] GraphRAG was proposed as a graph-based approach to question answering over private text corpora that scales with both the generality of user questions and the quantity of source text.[3] It uses a language model to build a graph index in two stages: first deriving an entity knowledge graph from source documents, then pregenerating community summaries for groups of closely related entities.[3] Given a question, each community summary generates a partial response, and all partial responses are summarized again into a final answer.[3] For global sensemaking questions over datasets in the 1 million token range, the authors report substantial improvements over a conventional RAG baseline in the comprehensiveness and diversity of generated answers.[3] This structured approach is one way retrieval systems try to improve on simple passage ranking discussed in relation to measuring LLM visibility.

Limits of retrieval

RAG can reduce factual errors but does not solve all problems, since language models can generate misinformation even when pulling from factually correct sources if they misinterpret the context.[2] One documented example involved a model retrieving a rhetorical chapter title and generating a false statement because it did not understand the context of that title, as described by MIT Technology Review.[2] Together these findings show that retrieval improves access to outside information but does not guarantee correct interpretation or reliable use of that information, a theme also covered in discussions of LLM hallucinations about brands and why LLM answers vary. How a brand's own pages are found and crawled in the first place is covered in how LLMs learn about brands, Common Crawl, and the AI crawler and fetcher reference.

Common questions

What is retrieval-augmented generation?

Retrieval-augmented generation is a technique that lets large language models retrieve and incorporate new information from external data sources before responding to a query, supplementing what was learned during training.[2] It was introduced in a 2020 paper that combined a pre-trained parametric model with a non-parametric dense vector index retrieved by a neural retriever.[1]

How is RAG different from fine-tuning?

RAG pulls relevant text from databases, uploaded documents, or web sources at the time of answering, rather than relying only on static training data.[2] This reduces the need to retrain a model with new data, saving on computational and financial costs compared with updating the model's parameters directly.[2]

Does RAG stop hallucinations?

RAG can reduce factual errors and help models stick to facts, but it does not solve all problems.[2] Models can still generate misinformation even from factually correct retrieved sources if they misinterpret context, as in a documented case where a model turned a rhetorical chapter title into a false factual claim.[2]

What is GraphRAG?

GraphRAG is a graph-based approach to question answering over private text corpora that uses a language model to build an entity knowledge graph from source documents and pregenerate summaries for communities of related entities.[3] It was designed to handle global, corpus-wide questions that conventional RAG struggles with, and reported substantial gains in comprehensiveness and diversity of answers over a conventional RAG baseline.[3]

Why does the position of retrieved text matter?

Research on long-context language models found that performance can degrade significantly depending on where relevant information appears in the input, with the best performance when it is near the beginning or end and worse performance when it must be found in the middle.[4]

See also

References

  1. ^ a b c d e f g h i j "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks". Lewis et al., arXiv. Retrieved November 2026.
  2. ^ a b c d e f g h i j k l m "Retrieval-augmented generation". Wikipedia. Retrieved November 2026.
  3. ^ a b c d e f g h i j "From Local to Global: A Graph RAG Approach to Query-Focused Summarization". Edge et al., arXiv. Retrieved November 2026.
  4. ^ a b "Lost in the Middle: How Language Models Use Long Contexts". Liu et al., arXiv (TACL 2024). Retrieved November 2026.
  5. ^ a b c d e f "WebGPT: Browser-assisted question-answering with human feedback". Nakano et al., arXiv. Retrieved November 2026.