CONCEPT

Self-RAG

Authoritative Definition

A framework where large language models are fine-tuned to output special reflection tokens, allowing them to dynamically evaluate context relevance and self-correct generations.

Overview & Technical Description

Self-Reflective Retrieval-Augmented Generation (Self-RAG) is an advanced architectural paradigm that gives the LLM autonomy over its own retrieval and generation process. In traditional RAG systems, retrieval is a static, pre-generation step that blindly injects context into the prompt, whether the LLM actually needs it or not, potentially confusing the model with irrelevant noise. Self-RAG addresses this by training models to output specific control tokens during the inference phase. When presented with a prompt, the model can output a `[Retrieve]` token if it determines external knowledge is required. After retrieving context, it uses tokens like `[IsRel]` (Is Relevant) and `[IsSup]` (Is Supported) to critically evaluate whether the fetched documents actually contain the necessary information to answer the prompt. If the context is deemed irrelevant or contradictory, the model can discard it and trigger another retrieval iteration, or it can generate an answer and append an `[IsUse]` token to reflect on its own output's utility. This self-governing loop significantly enhances factual accuracy and reduces both hallucinations and dependency on brittle, hardcoded retrieval pipelines.

Editorial Notes

Fine-tunes the LLM to control its own retrieval behavior. Requires specialized model fine-tuning and inference infrastructure to parse and execute logic based on the reflection tokens in real-time.

Related Concepts