Retrieval-augmented generation

A language model that looks up outside text and uses it when it writes an answer.

By Mackenzie Bowes · mackenzie@mackenziebowes.com · @_mackenziebowes on X

models which combine pre-trained parametric and non-parametric memory for language generation.

From Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al., arXiv 2005.11401, submitted 2020-05-22, accepted at NeurIPS 2020).

RAG comes up in How to test an AI agent, and whether retrieval cuts hallucinations. The page explains it plainly: RAG gives the model documents to answer from. It then reads a study of legal AI tools and Vectara's leaderboard to see whether that lowers made-up answers. n8n AI agents shows how common the setup is: n8n features a "RAG chatbot for company documents" among its community templates. If a vendor offers a chatbot over your files, this is the setup they mean.

The name comes from this paper's abstract, which says the model's learned knowledge is the parametric memory and the store it looks up is the non-parametric memory. The plain-words definition above is this site's reading of that abstract.

Pages that use this term