Module 4 · What the model can see

Retrieval, as a pipeline that can break in six places

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 5 of 9 in this chapter

This chapter’s goalBudget a context window across system prompt, history, retrieved material and output; predict where in a long prompt information is most likely to be missed; and explain why prompt injection is a structural property of the input format rather than a bug awaiting a patch.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Six places retrieval breaks, in order of frequencySplit thedocumentsinto chunksA boundarythrough atable or ananswer capseverythingdownstreamEmbed andstore thechunksVectors fromoneprovider’smodel aremeaninglessto another’sEmbed thequestion“The drug issafe” and“the drug isnot safe” sitvery closetogetherRetrieve thenearest fewIf the rightchunk is inthe top fiveonly 60% ofthe time,nothing above60% isavailablePaste theminto thepromptNineplausibledistractorsaround onecorrectpassagemeasurablyloweraccuracyGenerateThe model mayanswer fromits weightsinstead, orreport anoutdatedpolicyfaithfullyand with acitationFive of the six failures happen before the model is asked anything, and all six get reported as “themodel hallucinated”. Measure the stages apart: hand the model the correct chunk yourself, and whateverstill fails is generation.
Five of the six failures happen before the model is asked anything, and all six get reported as "the model hallucinated". Measure the stages apart: hand the model the correct chunk yourself, and whatever still fails is generation.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

The pipeline, stated plainly

Retrieval-augmented generation has an aura of sophistication that it does not deserve. It is this:

  1. Split your documents into chunks.
  2. Embed each chunk and store the vectors.
  3. Embed the incoming question.
  4. Retrieve the nearest chunks.
  5. Paste them into the prompt with an instruction to answer from them.
  6. Generate.

Nothing more. When it works well it is because steps 1 to 4 worked well. When it fails, the failure is usually in steps 1 to 4 and gets described as “the model hallucinated”.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI, Actually Explained exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘Retrieval, as a pipeline that can break in six places’, in How a Language Model Actually Works. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/how-llms-work/retrieval-mechanically (Accessed: 29 November 2026).