Corrective RAG

What is Corrective RAG?

Corrective RAG (CRAG) is a technique that enhances the Retrieval-Augmented Generation (RAG) process by actively evaluating and refining retrieved documents to ensure relevancy and accuracy. This aims to reduce hallucinations in large language models (LLMs).

How Does CRAG Work?

CRAG goes beyond traditional RAG by introducing a retrieval evaluator that assigns a relevance score to documents fetched from a knowledge base. It then categorizes these documents based on confidence levels:

  • Correct: Documents with high confidence scores undergo further refinement using a "decompose-then-recompose" strategy, ensuring only the most relevant information is retained.
  • Incorrect: For documents with low confidence scores, CRAG utilizes web searches to find new sources of relevant knowledge, rewriting inputs and using a web search API.
  • Ambiguous: Documents that fall between these two categories are handled with a combination of the strategies mentioned above.

After evaluating and refining the documents, CRAG generates a final response using the enhanced information.

Pros and Cons of Using CRAG

  • Self-Correcting Property: CRAG can identify and correct irrelevant information, enhancing the relevancy of text generation.
  • Dependency on Retrieval Evaluator: The quality of CRAG heavily relies on the retrieval evaluator, requiring up-to-date models and high-quality data.
  • Dependency on Web Search: While web searches add diverse information, they may introduce biased or unreliable data.
  • Increased Computational Cost: CRAG’s complexity can result in higher computational costs and latency.

Conclusion

CRAG enhances RAG by validating and improving the relevance of retrieved documents. It uses strategies like "decompose-then-recompose" and external web searches, though its success depends on the evaluator's and web search's quality. By reducing hallucinations, CRAG aims to produce more robust LLMs.

Stay updated with
the Giskard Newsletter