Papers › Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection

Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection

17 Oct 2023arXiv:2310.11511archive 2025-07-28

Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, Hannaneh Hajishirzi

Despite their remarkable capabilities, large language models (LLMs) often produce responses containing factual inaccuracies due to their sole reliance on the parametric knowledge they encapsulate. Retrieval-Augmented Generation (RAG), an ad hoc approach that augments LMs with retrieval of relevant knowledge, decreases such issues. However, indiscriminately retrieving and incorporating a fixed number of retrieved passages, regardless of whether retrieval is necessary, or passages are relevant, diminishes LM versatility or can lead to unhelpful response generation. We introduce a new framework called Self-Reflective Retrieval-Augmented Generation (Self-RAG) that enhances an LM's quality and factuality through retrieval and self-reflection. Our framework trains a single arbitrary LM that adaptively retrieves passages on-demand, and generates and reflects on retrieved passages and its own generations using special tokens, called reflection tokens. Generating reflection tokens makes the LM controllable during the inference phase, enabling it to tailor its behavior to diverse task requirements. Experiments show that Self-RAG (7B and 13B parameters) significantly outperforms state-of-the-art LLMs and retrieval-augmented models on a diverse set of tasks. Specifically, Self-RAG outperforms ChatGPT and retrieval-augmented Llama2-chat on Open-domain QA, reasoning and fact verification tasks, and it shows significant gains in improving factuality and citation accuracy for long-form generations relative to these models.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.11511")

Code

Syntology Ran 8 of 14 code samples harvested from 3 repositories linked to this paper; 6 have no recorded run. Of those that ran: 5 ran · our draft was wrong; 1 ran · fixture could not drive it; 2 ran with no contract checked.

By repository: official repository: 10 samples from 1 repository, 5 ran; community (archive-listed): 2 samples from 2 repositories, 1 ran; 2 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

AkariAsai/self-rag officialmentioned on GitHubpytorchMIT report
ShayekhBinIslam/openrag mentioned on GitHubpytorch report
fate-ubw/raglab mentioned on GitHubpytorch report
llm-lab-org/CLASP mentioned on GitHubMIT report
ruc-nlpir/flashrag mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested; 8 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

5ran · our draft was wrong
1ran · fixture could not drive it
2ran
6unverified

Licence: 3 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

encode_with_messages_format AkariAsai/self-rag/retrieval_lm/finetune.py official repository ran · our draft was wrong MIT (permissive) · 1cb0eeb16cf04ee3 · report
jload AkariAsai/self-rag/data_creation/train_special_tokens.py official repository ran MIT (permissive) · 3ca38f9acc00194b · report
load_data AkariAsai/self-rag/retrieval_lm/passage_retrieval.py official repository ran · our draft was wrong MIT (permissive) · 0c3de3890cd0b382 · report
metric_max_over_ground_truths AkariAsai/self-rag/retrieval_lm/metrics.py official repository ran · our draft was wrong MIT (permissive) · 6829ceb72569fa12 · report
preprocess AkariAsai/self-rag/data_creation/train_special_tokens.py official repository ran MIT (permissive) · 342f5e0ec01b9ed8 · report
accuracy AkariAsai/self-rag/retrieval_lm/metrics.py official repository unverified MIT (permissive) · e76cf27d36723be3 · report
encode_with_prompt_completion_format AkariAsai/self-rag/retrieval_lm/finetune.py official repository unverified MIT (permissive) · aac14d7de4178849 · report
exact_match_score AkariAsai/self-rag/retrieval_lm/metrics.py official repository unverified MIT (permissive) · d97ab73d08dfa3b9 · report
make_supervised_data_module AkariAsai/self-rag/data_creation/train_special_tokens.py official repository unverified MIT (permissive) · c22fc64f9f9730e4 · report
randomcrop AkariAsai/self-rag/retrieval_lm/src/data.py official repository unverified MIT (permissive) · e037474365501512 · report
read_jsonl fate-ubw/raglab/raglab/rag/train_alg/finetune.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 6242dd60b264c96f · report
load_balancing_loss_func ShayekhBinIslam/openrag/openrag/modeling_openrag.py community (archive-listed) unverified CC-BY-4.0 · pointer only · d9308d9bf18cd072 · report
apply_rotary_pos_emb identical code first harvested elsewhere ran · fixture could not drive it licence of this copy not recorded · f725bc2d76076485 · report
rotate_half identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · b99eea6376d1e212 · report

Tasks

Fact VerificationQuestion AnsweringRAGResponse GenerationRetrievalRetrieval-augmented Generation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Question Answering PopQA SelfRAG-7b Accuracy 54.9 #1 of 2 Archive leaderboard report
Question Answering PopQA SelfRAG-13b Accuracy 55.8 #2 of 2 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

HOCSET

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections