difficulty 3/5
Retrieval-augmented generation
Retrieve passages from a document store, put them in the model's input, and generate from those. Moves facts out of the weights and into an index you can inspect, correct and replace.
Intuition
A pretrained model stores what it knows in its weights. Lewis et al. call that parametric memory, and they are precise about what it costs: such models "cannot easily expand or revise their memory, can't straightforwardly provide insight into their predictions, and may produce 'hallucinations'" [1, §1].
All three problems have the same shape. A fact spread across billions of weights has no address, so you cannot look it up, cite it, or change it without training. The fix is to stop trying: keep a separate document store — a non-parametric memory — retrieve from it at query time, and put what comes back into the model's input.
The gain is not mainly accuracy. It is that "knowledge can be directly revised and expanded, and accessed knowledge can be inspected and interpreted" [1, §1]. Facts become data you administer rather than behaviour you retrain.
Formal definition
How it works
Where it's used
Why & when
Worked example
Pitfalls
Check yourself
3 questions
The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.
Sources
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (2021)paperhttps://ar5iv.labs.arxiv.org/html/2005.11401
- Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks (2019)paperhttps://ar5iv.labs.arxiv.org/html/1908.10084
- Training Language Models to Follow Instructions with Human Feedback (2022)paperhttps://ar5iv.labs.arxiv.org/html/2203.02155