AssayAssay
01 / 08

Lesson 01 · Foundations · 12 min

Why retrieval

A model carries what it learnt during training. That knowledge is broad, fixed at a point in time, and impossible to attribute — you cannot ask which document a claim came from, because there is no document, only weights.

Retrieval changes the shape of the problem. Instead of hoping the answer is in the weights, you find the relevant text first and put it in front of the model. The model stops being the source and becomes the reader.

A retrieval pipelineahead of timedocumentschunksby sectionvectors1024 dimsindexpgvectorper questionquestionvectoras a querytop kby similarityanswergroundedif every score is low, nothing here answers the question — stop before generating
Two paths that meet. Documents are chunked and embedded once, ahead of time; a question is embedded at request time and matched against them.
Parametric knowledgeWhat the model absorbed in training. Fast, free at inference, unattributable, and stale the moment your documents change.
Retrieved knowledgeText fetched at request time and placed in the prompt. Current, attributable, and only as good as the retrieval.

The choice against fine-tuning is usually decided by how often the facts change and whether you need citations. Fine-tuning teaches a model a manner — a format, a voice, a task shape. Retrieval supplies facts. Teams reach for fine-tuning to fix a factual problem more often than they should, and are surprised when the model still invents things confidently.

  • The facts change weekly, or must be right today: retrieve.
  • Someone must be able to check where an answer came from: retrieve.
  • The answer depends on documents the model has never seen: retrieve.
  • You want a consistent output shape or tone: that is a prompt or a fine-tune, not retrieval.

The lab retrieves from a small retailer knowledge base — returns, shipping, warranty, care. Turn retrieval off and ask a question about the return window: the model will answer, plausibly, from nothing. Turn it on and the same question is answered from a passage you can read.

Retrieval does not make a model honest. It makes honesty possible, by putting a checkable source in front of it. Lesson 6 is about the difference.

Checkpoint

Find a question where the no-retrieval answer sounds right and is not.

The easy case: one passage answers it, and retrieval either finds that passage or it does not.

Ask the first question with retrieval switched off, then on. The off answer is invented — compare its confidence to its accuracy.

Nothing retrieved yet. Pick a question and press Retrieve — the passages come back with their similarity scores.