Self-RAG

Self-RAG

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

Self-RAG is the official open-source implementation of the SELF-RAG framework, which teaches a language model to retrieve information on demand, generate answers, and critique its own output through self-reflection. Rather than retrieving documents for every query whether they are needed or not, a Self-RAG model decides for itself when external knowledge would help. The project has earned more than 2,400 stars on GitHub and was last actively updated in May 2024.

Overview

Naive retrieval-augmented generation retrieves passages blindly, which can hurt as often as it helps when the model already knows the answer or the retrieved text is irrelevant. Self-RAG addresses this by training the model with special reflection tokens: the model can request retrieval, judge whether a passage is relevant, check whether its generation is supported by the evidence, and assess overall usefulness. The repository, from researcher Akari Asai and collaborators, includes the training and inference code from the paper along with released model checkpoints, so other researchers can reproduce results and build on the approach. A project page summarizes the method, examples, and findings. Worked examples on that page show the reflection tokens in action step by step, which makes the model’s retrieval and critique decisions unusually transparent compared with a typical black-box retrieval pipeline.

Key Features

  • On-demand retrieval: the model decides when external knowledge is needed
  • Self-reflection tokens for judging relevance, support, and answer quality
  • Official training and inference code accompanying the SELF-RAG paper
  • Released trained checkpoints for experimentation and comparison
  • Improves factuality over naive always-retrieve RAG pipelines
  • Open source under the MIT license

๐Ÿ’ณ Pricing

Self-RAG is completely free and open source under the MIT license. Running the models only requires your own compute and any retrieval corpus you choose to index.

Who Is It For

Self-RAG is for RAG researchers and engineers who want retrieval to be adaptive rather than automatic. It is a valuable reference if you are building question-answering systems where factual grounding matters and indiscriminate retrieval has been hurting quality.

๐Ÿš€ Visit Self-RAG Official Site

๐Ÿšฉ Report an issue