Paper 03~8 min readNeurIPS 2020
Paper Breakdown

Retrieval-Augmented
Generation, explained.

A language model is a brilliant student who took a closed-book exam on the entire internet — and now answers everything from memory, blurring details and inventing the rest. This 2020 paper handed that student a library card: retrieve the right pages first, then answer. It's the idea behind every "chat with your docs" product you've used.

Video breakdown
The animated walkthrough is in production.
Read the full breakdown below in the meantime ↓
01

The closed-book problem

By 2020, large language models could answer trivia surprisingly well — from memory alone. All their knowledge was crammed into their weights during training, a process the authors call parametric memory. Impressive, but it has three deep flaws.

It's lossy: facts get blurred into a statistical haze, so the model confidently makes things up — hallucinates. It's frozen: to teach it something new, or fix a wrong fact, you have to retrain. And it's opaque: it can't tell you where an answer came from, because there is no "where" — just a fog of weights.

02

The big idea: give it a library card

The paper's fix is elegant: don't force the model to memorize everything. Pair it with a searchable external collection — the authors used all of Wikipedia — that it can look things up in on demand. They call this searchable index non-parametric memory.

Now answering a question becomes two steps instead of one: retrieve the most relevant documents, then generate an answer grounded in them. The model no longer has to be the encyclopedia; it just has to know how to read one.

The RAG loop
Query Retriever Top-k docs Generator Grounded answer
03

The retriever: matching on meaning

Old-school search matched keywords — miss the exact word and you miss the document. RAG uses dense retrieval (DPR): a neural encoder turns the query into a vector and every document into a vector, and "relevant" simply means "close in vector space." Ask about "the capital of France" and it finds the passage about Paris even if the word "capital" never appears.

All of Wikipedia is pre-encoded once into a vector index. At query time, the retriever encodes the question and pulls the top-k nearest passages — a handful of the most relevant pages, in milliseconds.

Worth knowing

This vector-search step is exactly what a vector database does today. The RAG paper is why "embed your documents, then do nearest-neighbor search" became the backbone of modern AI applications.

04

The generator: answer from evidence

The retrieved passages are handed to a generator — a sequence-to-sequence model (BART in the paper) — alongside the original question. The generator writes its answer conditioned on that evidence, effectively reading the passages and composing a response instead of dredging one up from memory.

Crucially, retriever and generator are trained together, end to end. The generator's success signal flows back and teaches the retriever what "relevant" really means for producing good answers — the two halves learn to cooperate.

05

RAG-Sequence vs RAG-Token

The paper offers two flavors. RAG-Sequence commits to one set of retrieved documents and writes the entire answer from them — simple and coherent. RAG-Token is more fluid: it can lean on a different document for each token it generates, so a single answer can stitch together facts from several sources.

Ask "Where were these two authors born?" and RAG-Token can pull one author's birthplace from one passage and the other's from another, mid-sentence. More flexible, slightly more expensive.

06

The real results

RAG set new state-of-the-art on open-domain question answering — Natural Questions, TriviaQA, WebQuestions — beating both pure parametric models and earlier retrieve-and-read pipelines. Just as telling: its answers were more specific, more factual, and less prone to hallucination, and because every answer traced back to real passages, they could be cited.

ApproachKnowledge lives in…Update knowledge
Closed-book LLMFrozen weights (parametric)Retrain the model
Fine-tuningFrozen weights (parametric)Retrain / re-tune
RAGEditable index (non-parametric)Edit a document — instant

That last row is the quiet superpower: swap in a fresh Wikipedia dump — or fix one wrong document — and the model's knowledge updates immediately, no retraining required.

07

Why it still matters

Every "chat with your PDF," every enterprise knowledge assistant, every AI search box that cites its sources is a descendant of this paper. The specific models have changed — bigger generators, better embedding models, hybrid keyword-plus-vector retrieval, re-rankers, agentic multi-hop retrieval — but the core loop is unchanged: retrieve, then generate.

RAG reframed knowledge as something a model looks up rather than something it is. That separation — reasoning in the weights, facts in an index you control — is the single most important pattern in applied AI today.

Worth knowing

Building a RAG system today means choosing an embedding model, a vector database, a chunking strategy, and a re-ranker — then evaluating retrieval quality. Every one of those decisions traces back to the two-step loop this paper introduced.

Frequently asked

Quick answers

What is Retrieval-Augmented Generation?

Pairing a language model with a retriever over an external document index, so it fetches relevant documents for a query and answers grounded in them — knowledge lives in a searchable index, not only in weights.

Why does RAG reduce hallucination?

It grounds answers in specific retrieved passages the model can quote and the system can cite, instead of dredging facts from a lossy memory — so answers are checkable and far less likely to be invented.

RAG or fine-tuning?

Fine-tuning bakes knowledge into weights (expensive, slow to update). RAG keeps knowledge in an editable index you can change instantly. Fine-tuning changes behavior/style; RAG changes what the model knows.

What is dense retrieval?

Encoding query and documents into vectors and matching on closeness in vector space — meaning, not keywords. The paper used DPR over a vector index of Wikipedia to fetch the top-k passages.

RAG-Sequence vs RAG-Token?

RAG-Sequence writes the whole answer from one set of documents; RAG-Token can attend to a different document per token, weaving facts from several sources into one response.

Finished this one? 0 / 30 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns