MMOOZZGG.com

Glossary

What is Self-RAG

In short

Self-RAG is a method in which a language model decides by itself whether it needs a search in documents, and grades the passages it finds and its own answer.

Search and RAG · Self-RAG

MMOOZZGG.com editorsChecked: 1 min read

For a child

Imagine a student writing an essay. Sometimes they remember the answer and write it at once. If they are not sure, they go to the shelf for a book. Then they reread what they wrote and ask: does the book really say that? If not, they fix it. Self-RAG teaches a computer to act like this careful student, who decides when to look in the book.

In plain words

In ordinary RAG, the system searches the documents for every question, even when it is not needed, and gives the model everything it finds. Here the model is trained to put marks on its answer as it goes. First it marks whether it needs a reference. Then it checks whether a passage it found relates to the question. At the end it marks whether the passage supports its sentence and whether the whole answer is useful. For example, “good afternoon” starts no search, but for a question about delivery terms the model takes the contract and checks every number against it.

For business

The method is useful where a wrong answer is expensive: legal notes, answers about pricing plans, technical manuals. The model filters out extra passages and marks claims without support. So the check is built into the answer, and an employee does not have to reread every case. The limit: it is not a setting on top of any neural network but a specially trained model. For Russian documents and your own industry it needs more training, which means data, labeling and computing. Companies often take the idea from the method and build similar checks with separate model calls. How such checks lower the share of wrong answers is covered together with the risks of AI errors.

For a specialist

Self-RAG (Self-Reflective Retrieval-Augmented Generation) was proposed by Asai, Wu, Wang, Sil and Hajishirzi (2023). One language model is trained to generate, besides text, reflection tokens of four types. Retrieve decides whether to call the retriever on the current segment. IsRel grades whether the retrieved passage helps answer. IsSup shows whether the passage supports the segment’s claims fully, partly or not at all. IsUse rates the usefulness of the answer on a scale from 1 to 5. A separate critic model inserts the tokens into the training corpus offline, and the generator learns on this corpus with the usual next-token objective, so the critic is not needed at inference. At inference, a segment-level beam search runs: a weighted sum of the critic token probabilities is added to the segment probability, and the retrieval threshold can be tuned. The authors trained versions with 7 and 13 billion parameters. By their data, these beat ChatGPT and Llama2-chat with retrieval on open questions, reasoning and fact checking, and in long answers they raise factual accuracy and citation precision.

Example

A legal team’s assistant gets a question about the deadline to answer a claim. The model finds two passages, marks one as not relevant, answers from the second and notes that the term in its answer is confirmed by the contract text.

Related terms

Questions and answers

How is Self-RAG different from ordinary RAG? Ordinary RAG searches for every question and gives the model everything it finds. In Self-RAG the model decides by itself whether a search is needed, and marks which passages fit and whether they support the answer.
Can you turn on Self-RAG in any AI model? No, it is not a setting but a way to train a model with special tokens. You can build similar logic from separate model calls: check whether a search is needed, grade the passages and compare the answer with them.

Sources

Not sure whether your company needs this?

AI solutions map
Contact us