Self-Retrieval-Augmented Generation (SRAG)
- SRAG is a design space of retrieval-augmented generation systems where models control retrieval through self-generated signals.
- It uses methods like query proposal, hidden-state uncertainty, and self-memory to merge internal judgments with external evidence.
- SRAG variants enhance tasks in biomedical QA, code generation, and text-to-image applications while balancing cost and reliability.
Self-Retrieval-Augmented Generation (SRAG) denotes a family of retrieval-augmented generation architectures in which the model participates in retrieval control rather than acting only as a downstream consumer of retrieved evidence. Across the cited literature, this participation takes several forms: generating or refining retrieval queries, assigning self-generated rewards to retrieval trajectories, selecting between internal parametric knowledge and external evidence, triggering retrieval from internal uncertainty signals, expressing next-step information needs from hidden states, retrieving from self-generated documents or self-memory, and retrieving task-specific exemplars from the model’s own training distribution (Hu et al., 2024, Weng et al., 10 Feb 2025, Yao et al., 2024, Cheng et al., 2023, Li et al., 2024). This breadth suggests that SRAG is better understood as a design space than as a single algorithmic template.
1. Conceptual scope and definitional variants
The cited work uses the term Self-Retrieval-Augmented Generation non-uniformly. In biomedical question answering, SRAG is framed as a decision process in which the LLM proposes retrieval actions, evaluates retrieved evidence with self-generated rewards, and iteratively refines retrieval before answer generation (Hu et al., 2024). In post-hoc self-selection systems, SRAG refers to producing one answer from internal parametric knowledge and another from retrieval-augmented context, then asking the same model to compare the pair and choose the final answer (Weng et al., 10 Feb 2025). In adaptive retrieval controllers, SRAG is instantiated as uncertainty-triggered retrieval and re-ranking based on internal states (Yao et al., 2024). Other papers extend the label to retrieval from self-generated memory, self-generated documents, or the task’s own labeled training set (Cheng et al., 2023, Li et al., 2024, Wang et al., 24 Jul 2025).
| SRAG pattern | Self component | Representative instantiations |
|---|---|---|
| Retrieval-action control | Query proposals, self-reward, search | SeRTS in biomedical RAG (Hu et al., 2024) |
| Answer-source selection | Internal-only vs retrieval-augmented comparison | Self-Selection RAG (Weng et al., 10 Feb 2025) |
| Uncertainty-gated retrieval | Hidden-state uncertainty triggers retrieval and re-ranking | SeaKR (Yao et al., 2024) |
| Information-need retrieval | Next-step hidden states become retrieval queries | SelfRACG for code (Dong et al., 25 Jul 2025) |
| Self-generated context | Self-Docs or self-memory are retrieved as context | Self-Docs study; selfmem (Li et al., 2024, Cheng et al., 2023) |
| Task-exemplar retrieval | Labeled training examples become dynamic prompts | SRAG-MAV (Wang et al., 24 Jul 2025) |
| Self-reflective multimodal retrieval | Generator-informed negatives train a retriever | RealRAG (Lyu et al., 2 Feb 2025) |
Standard RAG is repeatedly described as a one-shot pipeline in which a retriever pulls top- documents and a generator answers from them. SRAG variants alter that division of labor. Some shift retrieval-time decisions into the generator; others keep the retriever but allow the generator to decide whether retrieval is needed, which retrieved items reduce uncertainty, or whether retrieved evidence should be trusted at all (Hu et al., 2024, Yao et al., 2024, Weng et al., 10 Feb 2025). A plausible implication is that the “self” in SRAG refers less to a specific supervision scheme than to endogenous control: retrieval is partially governed by the model’s own states, outputs, or judgments.
2. Retrieval as an internal control loop
One major SRAG line turns retrieval into an explicit search or control problem. SeRTS formulates retrieval as Monte Carlo Tree Search over a query/action space. Each node is defined as , where is the question, the current query proposal, the retrieved documents, the scalar reward, the textual feedback, and summarizes ancestor and sibling context. A Query Proposer LLM generates new queries using sibling feedback and ancestor observations; BM25 executes the proposal; an Evaluator LLM scores the evidence on a 5-point additive rubric and returns both a scalar reward and natural-language suggestions; MCTS then performs selection, expansion, evaluation, and backpropagation, with early stopping when a node reaches reward $5$ (Hu et al., 2024). Retrieval is therefore no longer a single similarity lookup, but a tree-structured exploration of alternative query formulations.
SeaKR operationalizes SRAG differently. It measures self-aware uncertainty from hidden states, using the log-determinant of a regularized Gram matrix built from multiple short pseudo-generations. Retrieval is triggered only when the step-level uncertainty exceeds a threshold near , queries are formed by pruning low-probability tokens from a short pseudo-generation, and candidate passages are re-ranked by how much they reduce uncertainty after insertion into the prompt. SeaKR also compares two final reasoning strategies—rationales-only versus knowledge-only—and returns the answer associated with lower uncertainty (Yao et al., 2024). Here, self-retrieval is not search over explicit query branches, but closed-loop control via internal-state calibration.
Self-MedRAG adds an answer-and-rationale verification loop. It combines BM25 and Contriever-MSMARCO via Reciprocal Rank Fusion with fusion constant 0, generates an answer and rationale with DeepSeek, and verifies each rationale statement with either RoBERTa-large-MNLI or Llama 3.1-8B used as an NLI classifier. A statement is supported when its maximum entailment confidence across retrieved passages exceeds 1, and the full answer is accepted when the proportion of supported rationale statements reaches 2; otherwise, unsupported rationale elements are concatenated into the next query and the retrieval-generation-verification cycle repeats (Ryan et al., 8 Jan 2026). The control signal is thus evidentiary sufficiency rather than uncertainty or reward.
Post-hoc self-selection systems use a different retrieval control point. Self-Selection RAG always computes both an internal-only answer and a retrieval-augmented answer, each with an explanation, then prompts the same LLM to compare the pair and choose a final answer. This inference path uses three LLM calls: internal generation, retrieval plus generation, and pairwise self-selection. There is no separate scorer, learned classifier head, or external verifier at inference time; the LLM itself is both generator and selector (Weng et al., 10 Feb 2025). In contrast to retrieval gating before generation, this design guarantees that both knowledge sources are considered before the final decision.
SelfRACG moves the control problem into the hidden states of code generation. Its Information Need Expression module computes a retrieval representation for the last token at every layer via retrieval-aware attention in parallel to standard self-attention, aggregates those vectors by mean pooling, and uses the resulting embedding for Maximum Inner Product Search over repository fragments. Retrieval is invoked before generating the next code fragment, so every generation step is preceded by self-expression of information needs and dense search (Dong et al., 25 Jul 2025). Unlike external code retrievers based on semantic similarity to existing context, this design makes retrieval depend on what the model is about to need next.
3. What is being retrieved: documents, memory, exemplars, and multimodal references
A second axis of variation concerns the retrieval target itself. Some SRAG systems still retrieve from conventional external corpora, but use self-derived queries or control signals. Others retrieve artifacts produced by the model or from the model’s immediate training environment.
The paper on augmented queries recasts query rewriting as a self-retrieval mechanism: the model first generates an “intermediate document” that resembles the phrasing likely to appear in the corpus, then uses that augmented query for retrieval. Documents are pre-encoded with TF-IDF, Doc2Vec, or BERT embeddings, optionally reduced to two dimensions with UMAP for BERT. At retrieval time the system returns the best-matching sentence together with its neighbors 3, and Orca2 7B answers from the resulting context (Ghali et al., 2024). The “self” component is therefore query synthesis rather than retrieval gating or self-critique.
The Self-Docs line pushes further by treating self-generated documents as retrieval context in their own right. In this setting, Self-Docs are produced by the same LLM used for downstream question answering, without external knowledge, and are classified along a Systemic Functional Linguistics taxonomy spanning ideational, interpersonal, and textual dimensions. The study identifies eight Self-Doc types, such as authoritative-fine-structured and conversational-coarse-unstructured, and investigates both Self-Docs alone and mixtures of Self-Docs with retrieved Wikipedia passages, including style-transformed mixing in which retrieved documents are rewritten to match the Self-Doc style (Li et al., 2024). Here SRAG is not iterative retrieval control, but retrieval-augmented generation with a context partly authored by the model itself.
The selfmem framework generalizes this intuition into an iterative memory loop. At round 4, the memory pool is 5, where the self-memory contains model-generated textual items from prior rounds. A selector scores candidate memory items, one is chosen to condition the next generation, new outputs are written back into self-memory, and the process repeats for 6 rounds (Cheng et al., 2023). This framework is explicitly motivated by the duality that “better generation can actively create better memory,” in contrast to classical RAG’s assumption that only better memory improves generation.
Training-set retrieval yields another SRAG variant. SRAG-MAV for fine-grained Chinese hate speech recognition retrieves semantically nearest labeled training instances with bge-large-zh-v1.5 embeddings, concatenates one retrieved exemplar per prompt, and uses these prompts to guide triplet extraction with Qwen2.5-7B. The quadruplet extraction task is reformulated into triplet extraction because the authors report that in the dataset “Hateful = no-hate” occurs only when “Targeted Group = no-hate”; hatefulness is then deterministically reconstructed from the predicted Targeted Group (Wang et al., 24 Jul 2025). In this case, SRAG is essentially dynamic, retrieval-based in-context learning over the task’s own annotations.
RealRAG extends SRAG into text-to-image generation. A frozen text-to-image generator is paired with a retriever trained by self-reflective contrastive learning. For each prompt, the current generator synthesizes an image; the nearest real image to that generated output is mined as a reflective negative; and the retriever is trained to prefer real images that match the prompt while compensating for what the generator already knows. At inference time, the trained retriever returns real-world image references that condition a frozen diffusion or autoregressive generator (Lyu et al., 2 Feb 2025). This is a multimodal analogue of generator-aware retrieval.
4. Optimization objectives and learning signals
SRAG systems also differ sharply in how they learn retrieval behavior. SeRTS combines search-time self-reward with post-hoc policy optimization. It collects trajectories consisting of proposed queries, observations, and evaluator rewards, then fine-tunes proposer and evaluator LLMs with PPO using LoRA on Llama2-7b-chat through TRL/PEFT. The reported training setup uses lora_target_modules=["q_proj","v_proj"], lora_r=16, lora_alpha=32, lora_dropout=0.05, micro_batch_size=1, batch_size=8, num_epochs=1, learning_rate=1.41e−5, and reward baseline=3.75, trained on a single A6000 GPU in approximately two hours (Hu et al., 2024). In this formulation, the evaluator’s rubric functions as the reward model, but no separately trained reward head is introduced.
Self-Selection RAG replaces explicit reward modeling with Direct Preference Optimization. Its Retrieval-Generation Preference dataset is constructed from WebQuestions, SQuAD 2.0, and SciQ. GPT-3.5 generates one internal-only candidate and one retrieval-augmented candidate per question; GPT-3.5 then labels correctness against the gold answer; only cases where exactly one candidate is correct are retained, producing 7 labeled preferences; and additional negatives are mined from semantically similar queries to create 8 preference instances for DPO training (Weng et al., 10 Feb 2025). The selector is therefore trained directly on pairwise preferences rather than scalar rewards.
SelfRACG trains only the retrieval path, not the generation path. Its Information Need-Guided training has two stages: Stage 1 uses approximately 9 million GitHub files split into 20-line fragments, with the immediate next fragment as the positive and in-batch negatives; Stage 2 uses LLM-synthesized candidate next fragments, treating the model’s immediate next-step preference as the positive and alternative continuations as negatives. Both stages optimize the same inner-product contrastive loss, and the retrieval path is implemented as Layer-wise LoRA in parallel to self-attention, with rank 0 and 1 (Dong et al., 25 Jul 2025). The result is a retrieval-specialized adapter whose gradients do not perturb the base generation parameters.
RAG-RL turns the answer generator into a self-retriever by reinforcement learning over noisy passage pools. The model is trained to output both an answer and supporting passage identifiers, and the reward decomposes into exact-match answer reward, citation recall minus penalties for incorrect citations, and formatting reward. The paper reports 2, 3, 4, and optimization with Group Relative Policy Optimization using a KL coefficient 5 and learning rate 6 (Huang et al., 17 Mar 2025). Curriculum learning is central: easy samples containing gold passages with few distractors are combined with hard samples containing many distractors, and the Min-Max curriculum is reported to outperform training only on maximum difficulty.
RealRAG uses an InfoNCE-style objective with both in-batch negatives and a generator-informed reflective negative. The text encoder from CLIP is frozen, the vision encoder is augmented with a lightweight MLP head, and the retriever is optimized so that the prompt embedding prefers the true image over both ordinary negatives and the real image most similar to the generator’s current output (Lyu et al., 2 Feb 2025). The self-reflective negative is the mechanism by which generator deficiencies are injected into retrieval training.
Selfmem uses a learned selector rather than RL or DPO. Candidate memory items are assigned task utilities such as BLEU or ROUGE, these utilities are temperature-smoothed into a target distribution, and a cross-encoder selector is trained with a ranking loss to match that distribution. The paper also distinguishes dual training, where generator and selector are optimized separately, from joint training, where the selector loss is added to the generation loss (Cheng et al., 2023). This is one of the clearest examples of SRAG as alternating write-to-memory and retrieve-from-memory optimization.
5. Empirical results across domains
In biomedical retrieval-augmented question answering, SeRTS reports improvements over BM25 and self-reflection on BioASQ-QA. On Task 11b batch 1 averaged over seeds 42, 43, and 44, BM25 achieves Precision 7, Recall 8, F1 9, and Hit Rate 0; GPT-3.5-turbo with SeRTS at sim=12, max ucb reaches Precision 1, Recall 2, F1 3, and Hit Rate 4; Llama2-7b with the same setup reaches Precision 5, Recall 6, F1 7, and Hit Rate 8. For answer generation, BM25 yields ROUGE-2 F1 9 and ROUGE-SU4 F1 0, whereas GPT-3.5-turbo plus SeRTS reaches ROUGE-2 F1 1 and ROUGE-SU4 F1 2, and Llama2-7b plus SeRTS(PPO) reaches ROUGE-2 F1 3 and ROUGE-SU4 F1 4 (Hu et al., 2024). Self-MedRAG reports that hybrid retrieval via BM25+Contriever+RRF improves over single retrievers, and that adding the self-reflective loop increases accuracy on MedQA from 5 to 6 and on PubMedQA from 7 to 8 (Ryan et al., 8 Jan 2026).
On open-domain QA, Self-Selection-RGP reports strong results on Natural Questions and TriviaQA. For Mistral-7B in zero-shot evaluation, it reaches NQ EM 9, F1 0, and Accuracy 1, compared with Standard RAG Accuracy 2; on TriviaQA it reaches EM 3, F1 4, and Accuracy 5, compared with SURE Accuracy 6. For Llama2-13B-Chat, the same method is competitive on TriviaQA but is below SURE on zero-shot NQ, where Self-Selection-RGP Accuracy is 7 versus SURE Accuracy 8 (Weng et al., 10 Feb 2025). SeaKR reports large gains on complex QA: on 2WikiMultiHopQA, F1 9 versus DRAGIN 0 and IRCoT 1; on HotpotQA, F1 2 versus DRAGIN 3 and IRCoT 4; and on IIRC, F1 5 versus DRAGIN 6 and IRCoT 7. On simple QA, it reports F1 8 on NaturalQuestions, 9 on TriviaQA, and 0 on SQuAD, with Self-RAG outperforming it on NQ due to in-domain fine-tuning (Yao et al., 2024). The Self-Docs study reports that well-crafted Self-Docs can outperform top retrieved Wikipedia on average across TriviaQA, HotpotQA, FEVER, and ELI5, with AFU and CFU both achieving average 1 versus Wiki-only average 2, and style-transformation mixing improving the average to 3 with CCU (Li et al., 2024).
In code generation, SelfRACG improves both retrieval ranking and downstream completion. For OpenCoder-1.5B, no retrieval yields EM 4, ES 5, and Pass@1 6; the best external retriever in Vanilla RACG yields EM 7, ES 8, and Pass@1 9; SelfRACG yields EM $5$0, ES $5$1, and Pass@1 $5$2. For OpenCoder-8B, the corresponding values are EM $5$3, ES $5$4, and Pass@1 $5$5 without retrieval; EM $5$6, ES $5$7, and Pass@1 $5$8 for the best external retriever; and EM $5$9, ES 0, and Pass@1 1 for SelfRACG. On retrieval metrics, Qwen2.5-Coder-7B with SelfRACG reaches Recall@1 2 and MRR@10 3, above NV-Embed-v2 and GritLM-7B (Dong et al., 25 Jul 2025). In text-to-image generation, RealRAG reports FID improvements across backbones; for autoregressive Emu on Stanford Cars, FID improves from 4 to 5, which the paper reports as a gain of 6, and diffusion backbones such as Flux and SD v2.1 also improve across Cars, Dogs, and Flowers (Lyu et al., 2 Feb 2025).
In structured extraction and general text generation, SRAG-MAV reports Hard Score 7, Soft Score 8, and Average Score 9 on STATE ToxiCN, compared with GPT-4o Average 00 and fine-tuned Qwen2.5-7B Average 01. Its ablation sequence shows Base Qwen2.5-7B SFT at Hard 02, Soft 03, Avg 04; +TR at Hard 05, Soft 06, Avg 07; +TR+SRAG at Hard 08, Soft 09, Avg 10; and +TR+SRAG+MAV at Hard 11, Soft 12, Avg 13 (Wang et al., 24 Jul 2025). In selfmem, self-memory outperforms external retrieval on multiple tasks: on JRC-Acquis machine translation, Transformer_joint + Self memory reaches BLEU 14, chrF++ 15, and TER 16; on XSum, Selfmem reaches ROUGE-1/2/L of 17; and on BigPatent it reaches 18 (Cheng et al., 2023).
6. Limitations, disagreements, and open directions
The most immediate limitation is conceptual heterogeneity. The cited literature uses SRAG to describe at least seven distinct behaviors: self-rewarded retrieval search, post-hoc answer-source selection, uncertainty-triggered retrieval, hidden-state information-need retrieval, retrieval from self-generated memory, retrieval of self-generated documents, and retrieval from the model’s own training set (Hu et al., 2024, Weng et al., 10 Feb 2025, Yao et al., 2024, Cheng et al., 2023, Li et al., 2024, Wang et al., 24 Jul 2025). This suggests that SRAG currently functions as an umbrella term for self-involving retrieval control rather than a stabilized technical category.
A second limitation is cost. Self-Selection RAG requires three LLM calls per query plus retrieval (Weng et al., 10 Feb 2025). SeaKR estimates uncertainty from approximately 19 short pseudo-generations per decision point (Yao et al., 2024). Self-MedRAG adds iterative verification whose cost scales with the number of rationale statements and passages (Ryan et al., 8 Jan 2026). SRAG-MAV increases inference time through multi-round voting with top-20 prompts (Wang et al., 24 Jul 2025). SelfRACG requires two-stage training and synthetic data generation, though it reports substantially lower overhead than training a standalone dual-capability retriever-generator model (Dong et al., 25 Jul 2025).
Reliability risks also differ by variant. SeRTS notes catastrophic forgetting during PPO and possible reward hacking, including failures of the Query Proposer to follow the required output format (Hu et al., 2024). Self-Selection RAG reports residual selection errors, partial matching issues, and dependence on corpus coverage, with “lack of evidence” accounting for 21 of sampled TriviaQA errors (Weng et al., 10 Feb 2025). SeaKR requires hidden-state access and careful threshold calibration (Yao et al., 2024). Self-Docs can hallucinate because they are generated from parametric memory rather than external evidence, and their effectiveness is strongly style- and task-dependent (Li et al., 2024). Selfmem can amplify poor early generations through self-feedback drift, and RealRAG can underperform similarity-only retrieval early in training before the reflective signal matures (Cheng et al., 2023, Lyu et al., 2 Feb 2025).
Despite these limitations, several papers explicitly argue for broad transferability. SeRTS states that the SRAG principle extends beyond biomedicine to domains such as law, finance, and scientific QA (Hu et al., 2024). Self-MedRAG characterizes its hybrid retrieval plus verification loop as domain-agnostic for evidence-grounded decision support (Ryan et al., 8 Jan 2026). SelfRACG presents adaptations to long-form text, math reasoning, and QA as natural extensions of information-need-guided retrieval (Dong et al., 25 Jul 2025). A plausible implication is that future work will likely focus less on whether SRAG is useful and more on which self-signal—uncertainty, preference, reward, hidden-state need, self-authored context, or retrieved exemplars—is most appropriate for a given task, cost budget, and reliability requirement.