FDEInterviews logo
★ Read firstNeurIPS 2020

Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks

The 2020 paper that named RAG: a generator paired with a searchable index, so a model's knowledge can be checked, cited and updated without retraining.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2020
AUTHORS
Lewis, Perez, Piktus, Petroni, et al.
FROM
Facebook AI Research, University College London, New York University
PUBLISHED
May 2020 · NeurIPS 2020
CITED BY
19,621Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 20% of this breakdown.

01

The paper in one minute

Large language models learn a remarkable amount of world knowledge during training, but they keep it in their weights. You cannot look up where an answer came from, you cannot correct one wrong fact without retraining, and the model will confidently invent things it does not know.

The team at Facebook AI Research proposed giving the model a second memory it can search. For each input, a retriever looks up the most relevant passages in an index, here 21 million 100-word chunks of Wikipedia, and a generator writes the answer conditioned on both the question and those passages. They call the weights parametric memory and the index non-parametric memory, and they named the combination retrieval-augmented generation: RAG.

It worked. RAG set new best published results in 2020 on three open-domain question answering benchmarks, beating both models that answer from memory alone and pipelines that extract answer spans from retrieved text. Human raters judged its generated text more factual and more specific than the same generator without retrieval.

The experiment that matters most to practitioners is small. The authors built one index from a 2016 Wikipedia dump and one from 2018, then asked who held 82 positions whose holders had changed. With the matching index, RAG answered about 70% correctly. With the wrong year's index, it fell to 4% to 12%. Change the documents and you change what the model knows.

THE IDEA, VISUALLY
TWO MEMORIES: ONE YOU CAN EDIT WITHOUT RETRAINING Question Query encoder BERT, from DPR Document index 21M passages, 100 words non-parametric memory top K = 5 or 10 Retrieved passages Generator BART, 400M parametric memory Answer question also goes to the generator Retriever and generator are fine-tuned together; the document encoder and index stay frozen. Update the index and the answers change, no retraining. SWAP THE INDEX, CHANGE WHAT IT KNOWS 82 world leaders who changed between dumps 2016 leaders 2018 leaders 2016 index 70% 4% 2018 index 12% 68% Matching index: 70% and 68% correct. Mismatched: 12% and 4%. The index is the knowledge.
A model with two memories. The weights hold general knowledge; the index holds facts you can read, cite and replace. Swap the index and the answers follow it.
Research notes: the problem, approach and results
21Mpassages

100-word chunks of a Wikipedia dump, searched for every question

68% → 4%

accuracy on world leaders with the right index, and with an index from the wrong year

42.7%

of Jeopardy questions judged more factual for RAG, against 7.1% for the model without retrieval

THE PROBLEM

Language models store knowledge in their weights, where it cannot be inspected, cited or updated without retraining, and they make things up.

THE IDEA

Pair a generator with a retriever over a document index. Fetch relevant passages for each input and condition the answer on them.

THE RESULT

State of the art on open-domain QA, answers judged more factual than a model without retrieval, and knowledge you update by rebuilding an index.

02

Why it matters to an FDE

Most enterprise AI projects are retrieval projects. The customer's knowledge lives in documents, tickets and databases, not in any model's weights, and this paper is where the pattern started.

The index is the knowledge. The hot-swap experiment is the paper's real gift to practitioners. Accuracy did not come from the model; it came from whether the index matched the question. A stale index fails silently: the system still answers fluently, from last year's policy. Keeping the index fresh is a data engineering job, and it decides answer quality more than the choice of model.

Word matching sometimes wins. On FEVER, a fact-checking task built around named entities, plain BM25 keyword search beat the paper's learned dense retriever. Dense retrieval won on the question answering tasks. That is the origin of the hybrid-search advice you will give on most projects: product codes, names and IDs need keyword matching, paraphrased questions need embeddings.

Retrieval does not guarantee grounding. RAG answered 11.8% of questions correctly even when the right answer was in none of the retrieved passages. The generator was drawing on its own weights. If a customer needs every answer traceable to a source, retrieval alone does not deliver that; you need to check the answer against the passages.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 49 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The ideas to keep, original RAG against today's RAG, the two variants and the misreadings to avoid

    Free account
  2. 04How it works

    The retriever, the generator, how passages are combined and how training works, with a diagram

    Premium
  3. 05The numbers that matter

    Every headline result, the ablations that matter for building, and where each comes from

    Premium
  4. 06Try it yourself

    BM25 in twenty lines, an index swap like the paper's, and a staleness check you can ship

    Premium
  5. 07Where it breaks

    What the paper left unsolved, and what deployments added on top of it

    Premium
  6. 08Using it on a deployment

    The design decisions, in order, and the two metrics to watch from day one

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →