Notes

Generator (RAG)

In a retrieval system the search half gets the attention, but something still has to turn the retrieved passages into an answer a person can read. That is the generator — the language model at the end of the pipeline, and the only part the reader ever hears from.

A different job from answering alone

Asked a question cold, a model draws on whatever its weights happen to remember. Given retrieved passages, the task becomes reading comprehension: find the relevant lines, reconcile them when they disagree, say what they support and no more, and attribute it. That is why instruction-tuned models are used in this slot — the generator has to obey an instruction like "answer only from the context provided, and say so when you cannot".

Where it goes wrong
  • It answers from memory instead of the documents, confidently and with last year's figure.
  • It misses a passage that was retrieved correctly but sat in the middle of a long context.
  • It writes a plausible citation to a source that says nothing of the kind.

These failures are measured as faithfulness — whether the answer is supported by what was supplied — separately from whether it is true.

Choosing one

Grounding lowers the bar. With good retrieval, an 8-billion-parameter open model matches a frontier model on documentation questions, because the knowledge sits in the prompt rather than in the weights. The context window then sets the real ceiling: it decides how many retrieved chunks the generator ever sees.

In a retrieval-augmented system the generator is the language model that writes the final answer from the passages the retriever supplied. Its task is reading and synthesis rather than recall: use the supplied text, reconcile conflicts, attribute claims and decline when the evidence is absent. It determines faithfulness — whether the answer is actually supported by the documents — and its context window caps how much retrieved material can be used at all.

Picture a student sitting an open-book exam. Someone has already pulled out the right pages and put them on the desk; the student still has to read them, work out what they say, and write the answer in their own words. In a system that looks things up before replying, the generator is that student — the part that turns a stack of found documents into a sentence you can use. It is where honesty is won or lost. A good one sticks to what the pages actually say and admits when they are silent. A careless one quietly fills the gap from memory, and sounds just as confident.