# RAG (2020)

> Let a text generator look things up in Wikipedia before it answers, and give the idea its name.

Page: https://mralbu.github.io/ai-datasets/p/rag

## Key facts

- Title: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Authors: Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, Douwe Kiela
- Venue: NeurIPS 2020
- Category: Text
- Paper: https://www.alphaxiv.org/abs/2005.11401

## Why it matters

RAG named a pattern that now underlies most practical LLM applications: retrieve documents first, then generate from them. It showed that grounding answers in retrieved text reduces made-up facts and lets a model use knowledge it was never trained on.

## The idea

Pair a neural retriever, which finds relevant Wikipedia passages for a question, with a sequence-to-sequence generator that writes the answer conditioned on them, and train the two together. Knowledge lives in an index that can be updated without retraining the model.

## The result

State-of-the-art results on three open-domain question answering benchmarks, including Natural Questions, and more factual answers than a generator alone on MS MARCO.

## The data

- [Natural Questions (2019)](https://mralbu.github.io/ai-datasets/d/natural-questions.md): Real Google search questions, each answered by an annotator with a paragraph and a short span from Wikipedia.
- [MS MARCO (2016)](https://mralbu.github.io/ai-datasets/d/ms-marco.md): A million real Bing queries with candidate web passages and human-written answers when one exists.

## Builds on

- [DPR (2020)](https://mralbu.github.io/ai-datasets/p/dpr.md)
- [BERT (2018)](https://mralbu.github.io/ai-datasets/p/bert.md)
- [Transformer (2017)](https://mralbu.github.io/ai-datasets/p/transformer.md)

## Part of

- [Reading and retrieval](https://mralbu.github.io/ai-datasets/t/reading-retrieval.md) (step 4 of 4)
