What is retrieval-augmented generation?

Definition

A retriever selects material relevant to a request, and a generation process uses that material alongside its learned capabilities. This can supply knowledge outside model parameters and make supporting sources available.

For example, a document assistant can find a product specification before answering a question about it. Retrieval can miss the needed passage, and generation can still misinterpret evidence, so grounding is not a guarantee of accuracy.

ELI5

The model looks up useful information before writing its answer.

For example, it can consult a manual for a sensor's specification. It still needs the right passage and must use it correctly.

Does this require retraining for every document change?

No. An external collection can be updated separately, though some retrieval and generation systems also use training.

Does retrieval guarantee a factual answer?

No. The sources, selected passages and the generated interpretation all affect correctness.

  1. Adam Lucek beside the words RAG From Documents to Answers
Definition card for retrieval-augmented generation: What is retrieval-augmented generation?

Retrieval-augmented generation combines a generative model with information retrieved from an external collection to help produce a response.