what is rag in llm

11 months ago 27
Nature

RAG stands for Retrieval-Augmented Generation, which is an AI framework for improving the quality of LLM-generated responses by grounding the model on external knowledge bases. RAG combines an information retrieval component with a text generator model. It retrieves relevant content from an external knowledge base and combines it with the users question to generate a response. RAG aims to improve prediction quality by using an external datastore at inference time to build a richer prompt that includes some combination of context, history, and recent/relevant knowledge. RAG LLMs can outperform LLMs without retrieval by a large margin with much fewer parameters, and they can update their knowledge by replacing their retrieval corpora, and provide citations for users to easily verify and evaluate the predictions. RAG allows language models to bypass retraining, enabling access to the latest information for generating reliable outputs via retrieval-based generation.