Retrieval-Augmented Generation
RAG retrieves relevant documents first, then conditions a language model on that evidence so answers can be grounded, cited, and updated without retraining.
Definition
Lewis et al. (2020) combine a dense or sparse retriever with a generator. The generator sees query + passages and is trained (or prompted) to use them. The point is parametric memory (weights) plus non-parametric memory (the index).
Why it matters
Pure LLMs invent plausible facts. RAG makes the answer depend on a corpus you can audit. For Codex / Memory, this is the bridge between wiki text and chat. Quality is corpus quality plus retrieval plus faithfulness — not model size alone.
Case
Ask “what is Active Share?” Without retrieval a model may invent a formula. With RAG it should pull the Codex entry and cite it. If the corpus only has a stub, an honest system says the definition is thin instead of fabricating a playbook.
How to read it
Judge RAG by citation faithfulness, recall of the right chunk, and latency. If every hit is a one-line tagline, retrieval works and the corpus is empty. Fix content first.
Key papers
Landmark references with real publisher or arXiv links — not token-overlap noise.
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksLewis et al. · 2020 · NeurIPSThe RAG paper.