# Retrieval-Augmented Generation for Large Language Models: A Survey

Retrieval-augmented generation methods fall into three paradigms, from Naive to Modular

Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi and 4 more · arXiv · 2023-12-18

- **Problem** Large language models hallucinate and lack knowledge beyond their training data, which limits them on knowledge-intensive tasks.
- **Method** The authors sort RAG into Naive, Advanced and Modular paradigms, then review the retrieval, generation and augmentation techniques each one uses.
- **Results** A cited study found that adding irrelevant documents raised accuracy by over 30%.

## Why plain LLMs need outside knowledge

Large language models perform well on many tasks but fall short on domain-specific and knowledge-intensive work. When a query goes beyond the training data or needs current information, the model can produce hallucinations, meaning fluent text that is wrong.

RAG handles this by pulling document chunks from an external knowledge base. Candidates are chosen by semantic similarity to the query, and the chosen chunks are added to the model input before it answers. Because the answer can rest on external text, the chance of factually incorrect content falls.

The survey asks how the idea developed after the Transformer era, when pre-training work first added outside knowledge, and after ChatGPT, when retrieval moved into the inference stage. It covers over 100 RAG studies and groups them into three paradigms.

## Three RAG paradigms and what changes between them

The earliest paradigm, Naive RAG, runs one pass of indexing, retrieval and generation. Indexing converts raw files such as PDF, HTML, Word and Markdown into plain text, splits the text into chunks and stores their embeddings in a vector database. At query time, the same embedding model encodes the question, the system scores it against the stored chunks, and the top K chunks are placed in the prompt.

The model then writes its answer from the question and these chunks.

Naive RAG has a weakness at each stage. Retrieval often has poor precision and recall, so it can pick misaligned chunks and miss key information. Generation can hallucinate, and augmentation can produce redundant or incoherent text, or output that only repeats retrieved passages. A single retrieval on the original query may also fail on complex questions.

Advanced RAG keeps the chain-like pipeline but adds work before and after retrieval. Before retrieval it refines the index with sliding windows, finer segmentation and metadata, and it rewrites or expands queries. After retrieval it reranks chunks so the most relevant ones sit near the edges of the prompt, and it compresses context to reduce information overload.

Modular RAG replaces the fixed chain with functional modules that can be swapped, added or rewired. Examples include a Search module over search engines, databases and knowledge graphs, a Memory module, Routing, a Predict module that generates context and a Task Adapter. Flows can be iterative or adaptive, as in ITER-RETGEN, FLARE and Self-RAG, which decide when retrieval is needed.

Modular RAG builds on Advanced and Naive RAG rather than discarding them.

## Choices inside retrieval and generation

Most retrieval uses unstructured text, mainly Wikipedia dumps for open-domain question answering. Tables are harder to use, because text splitting can separate a table from its content and tables are awkward to match by similarity. KnowledGPT and G-Retriever work with knowledge graphs, and G-Retriever adds a Prize-Collecting Steiner Tree step to pick graph content.

Other methods have the LLM supply its own context, as GenRead does, and Selfmem builds a memory pool from its own outputs.

Retrieval units run from tokens and phrases up to propositions and whole documents. Coarse units may carry more relevant information, but they also add redundant text that can distract the retriever and the language model. Fine units are harder to retrieve reliably and may not keep enough semantic context. Fixed chunk sizes such as 100, 256 or 512 tokens are common, and Small2Big retrieves sentences but passes the surrounding sentences to the LLM as context.

Retrieval compares embeddings, for example by cosine similarity, so the embedding model shapes what is found. Hybrid retrieval combines a sparse model such as BM25 with dense retrievers, because the two capture different relevance features. REPLUG uses the LLM as a supervisory signal: it compares probability distributions over retrieved documents and trains the retriever by KL divergence.

LLMs tend to attend to the start and end of a long context and neglect the middle, so retrieved content is usually curated before generation. Reranking can be rule-based, model-based or LLM-based, and LLMLingua uses small language models to remove unimportant tokens from the prompt. RECOMP trains an information condenser with contrastive learning, using one positive and five negative samples per training data point.

In the Filter-Reranker paradigm, small models filter candidates and LLMs reorder the remaining ones.

Fine-tuning can adapt an LLM to particular data formats and output styles. RA-DIT aligns the scoring functions of retriever and generator with KL divergence.

## RAG compared with fine-tuning

The survey places RAG, fine-tuning and prompt engineering on two axes: how much external knowledge is needed and how much the model must be adapted. Prompt engineering needs little of either, RAG suits precise information lookup, and fine-tuning suits reproducing a specific structure, style or format.

RAG supports real-time knowledge updates and offers interpretability, but it adds latency and raises ethical questions about retrieved data. Fine-tuning is more static, since updates need retraining, but it allows deep customisation of behaviour and style. Fine-tuning needs substantial compute for data preparation and training, and it may struggle with unfamiliar data, although it can reduce hallucinations.

A cited study compared the two across knowledge-intensive topics and found that RAG outperformed unsupervised fine-tuning for knowledge seen in training and for entirely new knowledge.

The authors treat RAG and fine-tuning as complementary rather than mutually exclusive. Their combined use may give the best performance, but reaching a satisfactory result can take several iterations.

## How RAG systems are evaluated

Task-level metrics are the usual starting point: EM and F1 for question answering, Accuracy for fact checking, and BLEU and ROUGE for answer quality. The authors observe that research concentrates on methods, with little work on the characteristics specific to evaluating RAG models.

Retrieval quality is measured with search and recommendation metrics such as Hit Rate, MRR and NDCG. Generation quality is split by content type: for unlabelled content it covers faithfulness, relevance and non-harmfulness, and for labelled content it focuses on accuracy. Both can be assessed manually or automatically.

Three quality scores are used: context relevance, answer faithfulness and answer relevance. Context relevance and noise robustness bear mainly on retrieval, while the other abilities bear mainly on generation.

The survey covers 26 tasks and nearly 50 datasets for assessing RAG. RGB, RECALL and CRUD are benchmarks for the abilities of RAG models, while RAGAS, ARES and TruLens are tools that use LLMs to judge quality scores. Table III lists the traditional metrics that fit each aspect, and the authors state that these do not yet form a mature or standardised approach.

## Limits the authors point to

The authors name weak precision and recall, hallucination and overreliance on retrieved text as problems of Naive RAG. Structured databases need effort to build, validate and maintain, and coarse retrieval units can add redundancy.

A cited study by Cuconasu et al. analysed document type, relevance, position and number, and found that including irrelevant documents could raise accuracy by over 30%. That result runs against the expectation that irrelevant documents lower quality, and the authors use it to call for further robustness research.

LLMs can now manage contexts exceeding 200,000 tokens, which raises the question of whether RAG is still needed. The authors argue RAG stays useful because large contexts slow inference, and because retrieved references let users check answers while long-context generation remains hard to inspect.

The evaluation material in this excerpt summarises tasks, metrics and tools from prior work.

## Paper info

- **Authors**: Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, Meng Wang, Haofen Wang
- **Venue**: arXiv · Preprint
- **First published**: 2023-12-18
- **Added**: 2026-11-11
- **Updated**: 2024-3-27
- **Version**: v5
- **arXiv**: 2312.10997
- **Category**: cs.CL · cs.AI
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2312.10997v5) · [PDF ↗](https://arxiv.org/pdf/2312.10997v5)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, Meng Wang, Haofen Wang (2023). Retrieval-Augmented Generation for Large Language Models: A Survey. arXiv:2312.10997v5. https://arxiv.org/abs/2312.10997v5

**BibTeX**

```
@misc{gao2023retrieval,
  title = {{Retrieval-Augmented Generation for Large Language Models: A Survey}},
  author = {Yunfan Gao and Yun Xiong and Xinyu Gao and Kangxiang Jia and Jinliu Pan and Yuxi Bi and Yi Dai and Jiawei Sun and Meng Wang and Haofen Wang},
  year = {2023},
  eprint = {2312.10997},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.10997v5}
}
```

## Other paper commentary

- [BERTScore: Evaluating Text Generation with BERT](https://refivu.com/en/papers/30f8b3be-d1a1-4c44-9203-702fc98d0cc9-bertscore-evaluating-text-generation-with-bert.md)
- [Qwen2.5-VL Technical Report](https://refivu.com/en/papers/d6d371c0-2b43-451e-8129-a5fc723ff2ae-qwen2-5-vl-technical-report.md)
- [GPT-4o System Card](https://refivu.com/en/papers/7f73de51-bae5-43e2-85f2-6decfe19e7c4-gpt-4o-system-card.md)
- [Qwen3 Technical Report](https://refivu.com/en/papers/efd0e142-cc80-4bf8-b7fa-33c525cf374d-qwen3-technical-report.md)
- [Prompting Is Programming: A Query Language for Large Language Models](https://refivu.com/en/papers/688fcde1-89d3-44fe-b9ec-673455f09c78-prompting-is-programming-a-query-language-for-large.md)
- [Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks](https://refivu.com/en/papers/805208af-12ea-4b4b-b1a8-6db7601b1c37-sentence-bert-sentence-embeddings-using-siamese-bert.md)
- [MissForest - nonparametric missing value imputation for mixed-type data](https://refivu.com/en/papers/ab5b3748-ade4-4bb9-b016-975b4f82baee-missforest-nonparametric-missing-value-imputation-for-mixed.md)
- [Deformable DETR: Deformable Transformers for End-to-End Object Detection](https://refivu.com/en/papers/e0311cd6-f252-409d-a37d-7b236622ec8e-deformable-detr-deformable-transformers-for-end-to-end.md)
- [Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation](https://refivu.com/en/papers/178a13b8-5d0e-4448-a1cb-759db558ade3-swin-unet-unet-like-pure-transformer-for-medical.md)
- [How transferable are features in deep neural networks?](https://refivu.com/en/papers/cb0b30a7-565d-41f8-bd71-41713c953bea-how-transferable-are-features-in-deep-neural-networks.md)
- [HuggingFace's Transformers: State-of-the-art Natural Language Processing](https://refivu.com/en/papers/226edb36-2edb-4a96-aca3-9909969cdf23-huggingface-s-transformers-state-of-the-art-natural.md)
- [The Mythos of Model Interpretability](https://refivu.com/en/papers/28c70275-bdc3-4d2e-8c3b-711d370f197b-the-mythos-of-model-interpretability.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [BLEU](https://refivu.com/en/terms/42cd9b97719e-bleu)
- [Fine-tuning](https://refivu.com/en/terms/66a12665f507-fine-tuning)
- [MRR](https://refivu.com/en/terms/3d251a2fd6a5-mrr)
- [HotPotQA](https://refivu.com/en/terms/16cb986b71c1-hotpotqa)
- [retrieval-augmented generation](https://refivu.com/en/terms/86077612addb-retrieval-augmented-generation)
- [NDCG](https://refivu.com/en/terms/4758d58c5780-ndcg)
- [benchmark](https://refivu.com/en/terms/83ba7f0a7ab9-benchmark)
- [LLMs](https://refivu.com/en/terms/9f7eca307e44-llms)
- [embedding](https://refivu.com/en/terms/dd0144726bba-embedding)
- [knowledge graph](https://refivu.com/en/terms/16ac20ac3e18-knowledge-graph)
- [prompt engineering](https://refivu.com/en/terms/fd335dee5f48-prompt-engineering)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/ac45776a-0a09-4a03-a773-f9aa88c71453-retrieval-augmented-generation-for-large-language-models-a)
