---
title: Self-Retrieval-Augmented Generation (SRAG)
url: https://www.emergentmind.com/topics/self-retrieval-augmented-generation-srag
type: topic
---

# Self-Retrieval-Augmented Generation (SRAG)

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 [2406.11258][2502.06148][2406.19215][2305.02437][2410.13192]. 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 language model proposes retrieval actions, evaluates retrieved evidence with self-generated rewards, and iteratively refines retrieval before answer generation [2406.11258]. 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 [2502.06148]. In adaptive retrieval controllers, SRAG is instantiated as uncertainty-triggered retrieval and re-ranking based on internal states [2406.19215]. Other papers extend the label to retrieval from self-generated memory, self-generated documents, or the task’s own labeled training set [2305.02437][2410.13192][2507.18580].

| SRAG pattern | Self component | Representative instantiations |
|---|---|---|
| Retrieval-action control | Query proposals, self-reward, search | SeRTS in biomedical RAG [2406.11258] |
| Answer-source selection | Internal-only vs retrieval-augmented comparison | Self-Selection RAG [2502.06148] |
| Uncertainty-gated retrieval | Hidden-state uncertainty triggers retrieval and re-ranking | SeaKR [2406.19215] |
| Information-need retrieval | Next-step hidden states become retrieval queries | SelfRACG for code [2507.19033] |
| Self-generated context | Self-Docs or self-memory are retrieved as context | Self-Docs study; selfmem [2410.13192][2305.02437] |
| Task-exemplar retrieval | Labeled training examples become dynamic prompts | SRAG-MAV [2507.18580] |
| Self-reflective multimodal retrieval | Generator-informed negatives train a retriever | RealRAG [2502.00848] |

Standard RAG is repeatedly described as a one-shot pipeline in which a retriever pulls top-$k$ 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 [2406.11258][2406.19215][2502.06148]. 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 $s=[Q,A,D,R,F,O]$, where $Q$ is the question, $A$ the current query proposal, $D$ the retrieved documents, $R$ the scalar reward, $F$ the textual feedback, and $O$ 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$ [2406.11258]. 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 $-6$, 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 [2406.19215]. 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 $K=60$, 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 $\tau=0.5$, and the full answer is accepted when the proportion of supported rationale statements reaches $\theta=0.7$; otherwise, unsupported rationale elements are concatenated into the next query and the retrieval-generation-verification cycle repeats [2601.04531]. 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 [2502.06148]. 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 [2507.19033]. 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 $(n-1,n,n+1)$, and Orca2 7B answers from the resulting context [2402.16874]. 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 [2410.13192]. 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 $t$, the memory pool is $M^{(t)}=M_{\text{ext}}\cup M_{\text{self}}^{(t)}$, 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 $T$ rounds [2305.02437]. 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 [2507.18580]. 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 [2502.00848]. 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 [2406.11258]. 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 $M=3{,}756$ labeled preferences; and additional negatives are mined from semantically similar queries to create $21{,}928$ preference instances for DPO training [2502.06148]. 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 $1.3$ 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 $16$ and $\alpha=32$ [2507.19033]. 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 $\gamma_{\text{answer}}=5$, $\gamma_{\text{correct}}=5$, $\gamma_{\text{incorrect}}=2$, and optimization with Group Relative Policy Optimization using a KL coefficient $\beta=0.01$ and learning rate $10^{-6}$ [2503.12759]. 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 [2502.00848]. 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 [2305.02437]. 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 $72.48$, Recall $47.16$, F1 $45.87$, and Hit Rate $83.00$; GPT-3.5-turbo with SeRTS at `sim=12, max ucb` reaches Precision $74.65$, Recall $58.96$, F1 $54.70$, and Hit Rate $94.44$; Llama2-7b with the same setup reaches Precision $70.62$, Recall $52.51$, F1 $49.39$, and Hit Rate $85.55$. For answer generation, BM25 yields ROUGE-2 F1 $22.74$ and ROUGE-SU4 F1 $26.22$, whereas GPT-3.5-turbo plus SeRTS reaches ROUGE-2 F1 $24.35$ and ROUGE-SU4 F1 $27.77$, and Llama2-7b plus SeRTS(PPO) reaches ROUGE-2 F1 $23.63$ and ROUGE-SU4 F1 $27.34$ [2406.11258]. 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 $80.00\%$ to $83.33\%$ and on PubMedQA from $69.10\%$ to $79.82\%$ [2601.04531].

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 $37.8$, F1 $52.5$, and Accuracy $53.6$, compared with Standard RAG Accuracy $51.0$; on TriviaQA it reaches EM $54.4$, F1 $66.2$, and Accuracy $67.0$, compared with SURE Accuracy $61.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 $46.2$ versus SURE Accuracy $52.0$ [2502.06148]. SeaKR reports large gains on complex QA: on 2WikiMultiHopQA, F1 $36.0$ versus DRAGIN $30.0$ and IRCoT $26.5$; on HotpotQA, F1 $39.7$ versus DRAGIN $34.2$ and IRCoT $30.4$; and on IIRC, F1 $23.5$ versus DRAGIN $22.9$ and IRCoT $21.6$. On simple QA, it reports F1 $35.5$ on NaturalQuestions, $63.1$ on TriviaQA, and $36.5$ on SQuAD, with Self-RAG outperforming it on NQ due to in-domain fine-tuning [2406.19215]. 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 $51.6$ versus Wiki-only average $45.6$, and style-transformation mixing improving the average to $53.6$ with CCU [2410.13192].

In code generation, SelfRACG improves both retrieval ranking and downstream completion. For OpenCoder-1.5B, no retrieval yields EM $0.171$, ES $0.492$, and Pass@1 $19.8\%$; the best external retriever in Vanilla RACG yields EM $0.229$, ES $0.545$, and Pass@1 $27.6\%$; SelfRACG yields EM $0.241$, ES $0.552$, and Pass@1 $29.4\%$. For OpenCoder-8B, the corresponding values are EM $0.194$, ES $0.518$, and Pass@1 $24.8\%$ without retrieval; EM $0.264$, ES $0.576$, and Pass@1 $30.7\%$ for the best external retriever; and EM $0.281$, ES $0.593$, and Pass@1 $33.8\%$ for SelfRACG. On retrieval metrics, Qwen2.5-Coder-7B with SelfRACG reaches Recall@1 $0.244$ and MRR@10 $0.413$, above NV-Embed-v2 and GritLM-7B [2507.19033]. In text-to-image generation, RealRAG reports FID improvements across backbones; for autoregressive Emu on Stanford Cars, FID improves from $86.73$ to $70.55$, which the paper reports as a gain of $16.18\%$, and diffusion backbones such as Flux and SD v2.1 also improve across Cars, Dogs, and Flowers [2502.00848].

In structured extraction and general text generation, SRAG-MAV reports Hard Score $26.66$, Soft Score $48.35$, and Average Score $37.505$ on STATE ToxiCN, compared with GPT-4o Average $15.63$ and fine-tuned Qwen2.5-7B Average $35.365$. Its ablation sequence shows Base Qwen2.5-7B SFT at Hard $23.70$, Soft $47.03$, Avg $35.365$; `+TR` at Hard $24.33$, Soft $47.35$, Avg $35.840$; `+TR+SRAG` at Hard $25.30$, Soft $47.85$, Avg $36.575$; and `+TR+SRAG+MAV` at Hard $26.66$, Soft $48.35$, Avg $37.505$ [2507.18580]. In selfmem, self-memory outperforms external retrieval on multiple tasks: on JRC-Acquis machine translation, `Transformer_joint + Self memory` reaches BLEU $60.11$, chrF++ $73.25$, and TER $32.62$; on XSum, Selfmem reaches ROUGE-1/2/L of $50.3/26.7/41.6$; and on BigPatent it reaches $62.9/48.1/59.6$ [2305.02437].

## 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 [2406.11258][2502.06148][2406.19215][2305.02437][2410.13192][2507.18580]. 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 [2502.06148]. SeaKR estimates uncertainty from approximately $20$ short pseudo-generations per decision point [2406.19215]. Self-MedRAG adds iterative verification whose cost scales with the number of rationale statements and passages [2601.04531]. SRAG-MAV increases inference time through multi-round voting with top-$k$ prompts [2507.18580]. SelfRACG requires two-stage training and synthetic data generation, though it reports substantially lower overhead than training a standalone dual-capability retriever-generator model [2507.19033].

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 [2406.11258]. Self-Selection RAG reports residual selection errors, partial matching issues, and dependence on corpus coverage, with “lack of evidence” accounting for $51\%$ of sampled TriviaQA errors [2502.06148]. SeaKR requires hidden-state access and careful threshold calibration [2406.19215]. Self-Docs can hallucinate because they are generated from parametric memory rather than external evidence, and their effectiveness is strongly style- and task-dependent [2410.13192]. 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 [2305.02437][2502.00848].

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 [2406.11258]. Self-MedRAG characterizes its hybrid retrieval plus verification loop as domain-agnostic for evidence-grounded decision support [2601.04531]. SelfRACG presents adaptations to long-form text, math reasoning, and QA as natural extensions of information-need-guided retrieval [2507.19033]. 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.

Source: https://www.emergentmind.com/topics/self-retrieval-augmented-generation-srag