RAG and Retrieval Systems
Retrieve useful evidence, ground generated answers, and measure retrieval separately from generation.
Background reading
Introduction to Retrieval-Augmented Generation
Retrieval-augmented generation, or RAG, finds relevant information from an external collection and gives that evidence to a language model before it writes an answer.
A language model can produce a confident sentence by repeatedly selecting likely next tokens. That process can create fluent text even when the model has no reliable evidence for the claim it is making.
For example, ask about an internal policy that was never in the model’s training data. The model may still complete the answer in a plausible style. Fluency tells us that the continuation reads well; it does not tell us that the policy is correct.
Retrieval-augmented generation addresses this problem by finding relevant source passages before the answer is written. We can then evaluate two separate questions: did retrieval find the needed evidence, and did the generated answer use that evidence correctly?
Continue with Pro
Get Pro on codebaobab.com.
What you will learn next
- 01Prompt Engineering
- 02Hallucination
- 03Grounding and Verification
- 04Retrieval-Augmented Generation
- 05Chunking and the Unit You Retrieve
- 06Sparse, Dense, and the Index
- 07Preparing a Query for Retrieval
- 08From Retrieved Candidates to Model Context
- 09Diagnosing a RAG Failure
- 10LLM-as-a-Judge
- 11Updating Retrieved Knowledge
- 12Designing a Travel Policy RAG System
- 13Testing an LLM Judge for Reliability
- 14Review
- 15References