Chapter 4 · Adaptive RAG¶
4.1 Why Always-Retrieve Is Suboptimal ★★¶
The hidden assumption of standard RAG¶
The standard RAG pipeline from Chapter 1 does the same thing for every question: retrieve the top-k documents, put them in the prompt, and generate. Hidden inside is an assumption: retrieval always helps, or at least never hurts. But real questions vary enormously. "What is the capital of France?" is something the model memorized long ago; "What was some company's revenue last quarter?" is something the model cannot possibly know; "In what year was the alma mater of company A's CEO founded?" requires first finding the CEO, then the CEO's university, then the founding year. Handling all three with one pipeline is wasteful for the first kind and not enough for the third.
The problems with always-retrieve fall into three groups:
- Cost. Every retrieval needs query encoding, a vector search, and often a reranker pass. The bigger cost comes afterward: the retrieved documents add thousands of tokens to the prompt, so prefill compute and the KV cache both grow (see LLM Basic Chapter 6). With multi-step retrieval, the LLM is also called again and again. For questions the model already knows, all of this is wasted.
- Noise. Retrievers are not perfect, and the top-k often contains documents that are on topic but don't contain the answer. These documents distract the model and can even lead it astray (see Chapter 5).
- Hurting questions the model already knows. This is the most counter-intuitive point. Mallen et al. (2022) found on PopQA that for questions about popular entities, large models answer well without retrieval, and adding retrieval makes them worse. The reason is that the retrieved documents may be wrong, and the model tends to trust its context, so it turns a correct answer into a wrong one. In their analysis, retrieval flipped about 10% of questions from right to wrong, and on those questions the retriever's recall@1 was only 0.14, far below the overall 0.42. In other words, when retrieval quality is poor, retrieval itself becomes a source of errors.
Putting these three points together, "should we retrieve?" is really a per-question decision: retrieval is worth it only when its expected gain exceeds its cost. In the formula, \(q\) is the question, the difference in brackets is how much retrieval raises the chance of answering correctly, \(\mathrm{Cost}(q)\) is the extra expense of retrieval and the longer prompt, and \(\lambda\) is how much cost we are willing to pay per point of accuracy. For popular facts the gain is near zero or even negative, so we shouldn't retrieve; for long-tail or time-sensitive facts the gain is large, so we must. The catch is that both probabilities are unknown before answering, so every method in this chapter is essentially estimating this expected gain, just with different signals: the model's uncertainty, the question's complexity, the quality of the retrieved results, and so on.
Interview questions
- ★★ Why shouldn't we retrieve for every question?
- ★ When does retrieval make results worse?
Three decisions adaptive RAG makes¶
| Decision | Question it answers | Representative methods |
|---|---|---|
| When to retrieve | Does the model need external knowledge right now? | Uncertainty thresholds, popularity gating (Mallen et al. 2022), FLARE, Self-RAG's Retrieve token |
| How much / which strategy | No retrieval, one round, several rounds, or another pipeline? | Adaptive-RAG, bandit routers, Self-Route |
| Whether to trust the results | Are the retrieved documents good enough to use, or should they be fixed or replaced? | Self-RAG's IsRel / IsSup tokens, CRAG |
Adaptive RAG is not a single method but a family of methods built around three decisions. When to retrieve: is the model missing knowledge right now? How much to retrieve: is one round enough, are several needed, or should we switch to a completely different pipeline? Whether to trust the results: is what came back usable, and if not, should it be repaired or replaced with another source?
These decisions can also be made at different points in time. Deciding before generation (e.g. Adaptive-RAG, which looks only at the question text) is cheapest, but it must guess from the question alone. Deciding during generation (e.g. FLARE, Self-RAG) has more information, because the model has already started answering and can see where it is unsure; the cost is that retrieval and generation must interleave, which adds latency. Deciding after retrieval (e.g. CRAG) judges the quality of the retrieved results once they are in hand.
Interview questions
- ★ What decisions does adaptive RAG make, at which points can each be made, and what does each cost?
4.2 Deciding When to Retrieve: Uncertainty Signals ★★¶
The basic idea¶
| Signal | How it is computed | Extra cost | Main weakness |
|---|---|---|---|
| Entity popularity | Page views or frequency of the question's main entity | Near zero (a lookup) | Needs entity linking; only fits entity-centric factoid questions |
| Token probability / entropy | Minimum or mean token probability, or entropy, of a draft answer | One generation pass | Often overconfident after RLHF; low probability may reflect wording, not missing knowledge |
| Self-consistency | Sample several answers and measure disagreement (e.g. semantic entropy) | Several generations | Expensive; the model can be consistently wrong |
| Verbalized confidence / P(IK) | Ask the model whether it knows, or train a head to predict it | One short pass | Needs calibration; sensitive to the prompt |
| Hidden-state probe | A small classifier on internal activations | Cheap at inference; needs labeled data | Model-specific; may not transfer to new domains |
| Learned router | A small model trained on whether retrieval helped | Cheap | Needs labels; suffers from distribution shift |
The most natural idea is to retrieve only when the model doesn't know. But how do we tell that the model "doesn't know"? The LLM won't tell us directly, so we need a computable signal as a stand-in. The common signals fall into the groups in the table above.
Probability-based signals are the most widely used. \(x\) is the input, \(y_{<t}\) is what has been generated so far, and \(p_\theta(v \mid x, y_{<t})\) is the probability the model assigns at step \(t\) to each word \(v\) in the vocabulary \(\mathcal{V}\). \(H_t\) is the entropy at step \(t\): the flatter the distribution (the more the model hesitates between candidates), the higher the entropy. In practice we let the model write a draft without retrieval; if some token in the draft has probability below a threshold \(\theta\), or the entropy at some step exceeds a threshold \(\eta\), we take that as a sign the model is unsure and trigger retrieval.
Interview questions
- ★★ What signals can tell whether the model needs to retrieve?
Popularity-based adaptive retrieval ★¶
Mallen et al. (2022) give a simple and convincing example. They found that how well a model remembers a fact is strongly tied to how "popular" the entity is (measured by Wikipedia page views): large models have mostly memorized facts about popular entities, while for long-tail entities even making the model bigger barely helps. So their method is: for each relation type (such as "place of birth" or "director"), search for a popularity threshold on a development set; questions above the threshold are answered by the model directly, and only those below it trigger retrieval.
In terms of results, GPT-3 (davinci-003) paired with BM25 needed to retrieve for only about 40% of the questions, accuracy on PopQA was actually higher than always retrieving, and API cost was roughly halved. Another interesting finding is that small models (under 10B) need retrieval for almost every question, so adaptivity helps them very little. This shows that whether retrieval is needed depends on the specific model: the same question is common knowledge for a large model and long-tail for a small one.
The method's limits are just as clear: it only fits questions that ask for one fact about an entity, it needs entity recognition and linking first, and it doesn't apply to open-ended questions, reasoning questions or questions without a clear entity. But it makes the point of Section 4.1 very concrete: the value of retrieval is concentrated in the long tail the model doesn't know.
Interview questions
- ★ How does entity popularity relate to a model's parametric knowledge, and how can it be used to decide whether to retrieve?
The fundamental problem with uncertainty signals ★★¶
All these signals measure "how confident the model is", while what we really want to know is "how much retrieval would help". The two don't always agree, and there are two kinds of mismatch:
- Confident but wrong. The model is sure of a wrong answer, so it doesn't retrieve and outputs a hallucination. This is more common after RLHF: alignment training sharpens the output distribution, token probabilities are generally higher, and calibration gets worse (see LLM Basic Chapter 7). Time-sensitive questions are especially dangerous: the model firmly remembers the "current CEO" from its training data with high probability, but the answer has long been outdated.
- Unsure, but retrieval can't help either. The model really doesn't know, but the knowledge base doesn't contain the information or the retriever can't find it. Retrieval then just adds cost and may bring back misleading documents.
So an ideal signal must consider both the model and the retriever: the model doesn't know, and retrieval is likely to find the answer. Also, low probability doesn't necessarily mean missing knowledge: a token can have low probability simply because the same meaning can be phrased in several ways (for example "1990" and "nineteen ninety" splitting the probability), and retrieval won't help at all.
One conclusion worth remembering comes from Moskvoretskii et al. (2025). They systematically compared 35 methods on 6 datasets, including 8 recently proposed adaptive retrieval methods and 27 classic uncertainty estimation methods, and found that the classic uncertainty methods perform about as well on downstream QA as the complex adaptive retrieval pipelines, while being cheaper and better at judging "whether I know". They also found that on out-of-distribution data, downstream accuracy changes little, but the ability to judge "whether I know" drops markedly. The practical lesson: before designing a new method, get the two baselines "always retrieve" and "a simple uncertainty threshold" right.
Interview questions
- ★★ Why is token probability not a reliable signal for "needs retrieval"?
-
★ What happens to adaptive retrieval when the model is confident but wrong, and how can this be mitigated?
One fix is to look beyond the model's confidence and add rules that don't depend on it: force retrieval when the question is time-sensitive ("current", "latest", "this year") or involves private data. Another is to replace single-pass token probability with consistency across several samples, which is somewhat more sensitive to "confident but wrong". The root fix is better calibration, for example training the model to express uncertainty (see Chapter 5).
4.3 FLARE: Active Retrieval During Generation ★★¶
Why retrieve during generation¶
For short QA, retrieving once before generation is usually enough. But in long-form generation, such as writing a biography, the information the model needs keeps changing as writing progresses: first birth and education, then career, then major achievements. If we retrieve only with the original question, the recalled documents are mostly about the beginning, and later parts have no supporting material, so the model has to write from memory and is prone to hallucinate.
The early fix was fixed-interval retrieval: every \(l\) generated tokens (or every sentence), retrieve again using what was just generated. This has two problems. First, it's wasteful: for many sentences the model is completely sure and doesn't need retrieval. Second, it points the wrong way: using "what has already been written" as the query finds information that was needed in the past, not information needed for what comes next.
How FLARE works¶
FLARE (Forward-Looking Active REtrieval, Jiang et al. 2023) solves exactly these two problems. The core idea is "draft first, look it up only when unsure". Each step goes like this:
- Without retrieval, let the model draft the next sentence \(\hat{s}\). Here \(x\) is the input, \(y_{<t}\) is the output confirmed so far, and \(\hat{s}_{<w}\) is the part of the draft before token \(w\).
- If every token in \(\hat{s}\) has probability at least \(\theta\), the model is confident: accept the sentence without retrieval.
- If any token has probability below \(\theta\), build a query from \(\hat{s}\) and retrieve.
- Regenerate the sentence conditioned on the retrieved documents, replacing the draft. To keep the input short, only the documents retrieved at the current step are kept.
- Repeat until generation ends.
\(\theta\) controls how often retrieval happens: \(\theta = 0\) never retrieves, and \(\theta = 1\) retrieves for every sentence. In the paper, 30%–60% of sentences triggered retrieval on average across tasks.
Why is it called "forward-looking"? Because the draft represents what the model wants to say next, so using it as the query targets exactly the information the upcoming content needs. This is far more precise than querying with what has already been written.
Interview questions
- ★★ Walk through how FLARE works.
- ★ What does FLARE improve over fixed-interval retrieval?
How the query is formed ★¶
Using the draft directly as the query has a hidden risk: the low-confidence tokens are probably wrong. Say the model drafts "He won the Nobel Prize in 1987", and "1987" has low probability. Putting that wrong year in the query would steer the retriever toward irrelevant documents containing "1987". So FLARE offers two ways to build the query:
- Implicit (masked) query: mask out tokens with probability below another threshold \(\beta\) and retrieve with the rest. The example becomes "He won the Nobel Prize in ___", keeping only what the model is sure of and letting the retriever find the missing part.
- Explicit (generated) questions: pick out the low-confidence spans and have another LLM write a question for each one (e.g. "In what year did he win the Nobel Prize?"), then retrieve for each and merge the results.
The paper also compares a variant called FLARE-instruct: few-shot examples teach the model to write "[Search(query)]" itself during generation to trigger retrieval, similar to Toolformer. But the queries the model writes are less reliable, and on 2WikiMultihopQA it does clearly worse than FLARE-direct, which uses the draft (EM 42.4 vs 51.0). On the same dataset, the fixed-interval baseline that retrieves every 16 tokens scores only 43.2.
Interview questions
- ★ Why does FLARE mask low-confidence tokens before retrieving?
Costs and limitations ★¶
FLARE has three main costs. First, it needs token probabilities, which many closed APIs don't fully expose, so its use is limited. Second, extra LLM calls and latency: every time retrieval is triggered, the drafted sentence is thrown away and rewritten, and retrieval and generation must alternate sequentially, so end-to-end latency for long texts rises noticeably; after new documents are inserted, the earlier KV cache may also need recomputing. Third, it depends on calibration: its trigger relies entirely on token probabilities, so it can't escape the "confident but wrong" problem from Section 4.2 either.
Later work improved both "when to retrieve" and "what to query". For example, DRAGIN (Su et al. 2024) decides whether to retrieve by combining a token's uncertainty with its influence on later tokens (measured through attention) and its semantic importance, so retrieval isn't triggered just because some unimportant function word has low probability. To build the query, it uses the model's self-attention over the whole context to pick key terms, instead of using only the last sentence.
Interview questions
- ★ What are FLARE's limitations?
4.4 Deciding How Much: Adaptive-RAG and Strategy Routing ★★¶
Adaptive-RAG: choosing a strategy by query complexity ★★¶
| Label | Query type | Strategy | Rough cost |
|---|---|---|---|
| A | Simple; the model already knows | No retrieval: the LLM answers directly | 1 LLM call |
| B | Moderate; one fact to look up | Single-step RAG | 1 retrieval + 1 LLM call |
| C | Complex; multi-hop reasoning | Multi-step RAG (IRCoT: retrieval interleaved with chain-of-thought) | Several retrievals + several LLM calls |
The earlier methods only answer the binary question "retrieve or not". But there are more than two options in practice: single-step retrieval isn't enough for multi-hop questions, while multi-step retrieval (such as IRCoT; see Chapter 3 for multi-step retrieval) can handle complex questions but calls the LLM and the retriever at every step, which is very wasteful for simple questions. Adaptive-RAG (Jeong et al. 2024) treats this as a three-way choice: based on the question's complexity, pick one of no retrieval, single-step retrieval or multi-step retrieval.
The method trains a small classifier \(p_\phi\) (T5-Large, about 770M parameters, in the paper). It takes the question \(q\) and predicts which of the three complexity levels it belongs to; \(\hat{c}\) is the predicted level, and the matching strategy is then run. The classifier is small, so one pass costs almost nothing compared with an LLM call.
The hard part is where the training labels come from: there is no existing dataset annotated with "question complexity". The paper builds labels automatically:
- Label by outcome. For each training question, run all three strategies. If no retrieval already answers correctly, label it A; if no retrieval fails but single-step retrieval succeeds, label it B; if only multi-step retrieval succeeds, label it C. When several strategies succeed, pick the simplest, because the goal is to answer correctly at the lowest cost.
- Fill in by dataset. Questions that all three strategies get wrong can't be labeled by outcome, so the dataset's own bias is used: questions from single-hop datasets (such as NQ and TriviaQA) are labeled B, and those from multi-hop datasets (such as HotpotQA and MuSiQue) are labeled C.
In terms of results, with GPT-3.5 Adaptive-RAG reaches almost the same F1 as "always multi-step" (50.91 vs 50.87) in less than half the time (1.46 vs 3.33, with single-step RAG's time set to 1).
Interview questions
- ★★ Describe Adaptive-RAG. How are its classifier labels built?
- ★ Why is the simplest strategy chosen as the label when several strategies answer correctly?
Limitations of Adaptive-RAG ★¶
The classifier itself is actually not accurate: overall accuracy is only about 54.5%, and accuracy on class A (no retrieval needed) is only about 30%. Yet the overall results are still good, because the cost of errors is asymmetric. A large share of the errors "upgrade" a simple question to a more expensive strategy (e.g. A predicted as B), which only costs a bit more while the answer is usually still correct. What really hurts accuracy are "downgrade" errors, such as sending a question that needs multiple steps to single-step retrieval. In the paper, an oracle classifier (perfect labels) gives both better accuracy and better efficiency, which shows there is a lot of room to improve the classifier.
There are two more fundamental problems. First, complexity is relative to the model. The same question may be A for GPT-4 but B or C for a 3B model. The labels come from running a specific LLM, so switching LLMs means collecting labels again. Second, the classifier only sees the question text. It can't know how the retriever performs on this question, and it can't see the model's actual state while answering, so it can only guess complexity from surface features of the question (length, phrasing, whether it mentions several entities).
Interview questions
- ★ Adaptive-RAG's classifier is only about 55% accurate, so why does the system still work well?
- ★ If you switch to a different LLM, can Adaptive-RAG's classifier be reused as is?
Routing among RAG paradigms ★★¶
Adaptive-RAG generalizes to a broader routing problem: prepare a set of candidate pipelines \(\mathcal{A}\), such as no retrieval, single-step RAG, multi-step RAG, putting the whole document into a long context, GraphRAG, web search, or even a larger model; the routing policy \(\pi\) picks one pipeline \(a\) for each question \(q\) to get the best balance of quality and cost. \(\mathrm{Quality}(a, q)\) is how well pipeline \(a\) answers \(q\) (e.g. whether it's correct), \(\mathrm{Cost}(a, q)\) is its cost (number of retrievals, LLM calls, tokens or latency), and a larger \(\lambda\) leans toward saving money. There are three main ways to implement routing:
- Supervised classification. This is Adaptive-RAG's approach: run every pipeline offline to get labels and train a classifier. It's simple, but the labels are noisy, and the assumption that "each question has exactly one best strategy" is too rigid.
- Bandits / reinforcement learning. MBA-RAG (Tang et al. 2024) treats each retrieval strategy as an arm of a multi-armed bandit and uses a lightweight encoder (DistilBERT) to output the probability of choosing each arm from the question. The reward considers both whether the answer is correct and how many retrieval steps were used, so a correct answer that took many steps is still penalized. The advantage of a bandit is that it only needs feedback on the strategy it actually chose, so there is no need to run every strategy to create labels, and it can keep learning online and discover better choices through exploration.
- Cascades. Try the cheap option first and escalate if it fails. A typical example is Self-Route (Li et al. 2024), which chooses between RAG and long context: the model first answers from the top-k retrieved chunks only and is allowed to output "unanswerable"; only the questions it can't answer are passed, with the full document, to a long-context model (details and results in Chapter 3, 3.6).
Routing and cascades each have trade-offs. A router decides once, up front, so it is cheap, but it can't see any execution results, and a wrong choice can't be fixed. A cascade looks at results as it goes, so it is safer, but failed attempts add latency, and it depends on the model correctly realizing "I can't answer this", which brings us back to calibration. (This is the same kind of problem as LLM routing between small and large models; the candidates are simply RAG pipelines instead of models.)
Interview questions
- ★★ Given several RAG pipelines (no retrieval, single-step, multi-step, long context), how would you choose one per question?
- ★ What are the pros and cons of an up-front router versus a cascade?
- ★ Why use a bandit instead of supervised classification for strategy selection?
4.5 Self-RAG: Reflection Tokens ★★¶
Motivation¶
Ordinary RAG has three problems: it retrieves whether or not it's needed; it always concatenates k documents whether or not they're relevant; and after generating, it never checks whether the answer is actually supported by the documents. The idea of Self-RAG (Asai et al. 2023) is that instead of building lots of rules and extra modules around the model, we should train the model to make these judgments itself. Concretely, several kinds of special reflection tokens are added to the vocabulary, and the model outputs them during generation just like ordinary words, to express "should I retrieve now", "is this document relevant", "is the sentence I just wrote supported by the document" and "is the overall answer useful". Retrieval decisions, document filtering and self-checking are thus unified into a single next-token generation process.
The four reflection tokens ★★¶
| Token | Input | Output values | What it means |
|---|---|---|---|
| Retrieve | \(x\) (or \(x, y\)) | yes, no, continue | Should I retrieve now? ("continue" = keep using the current passage) |
| IsRel | \(x, d\) | relevant, irrelevant | Does passage \(d\) help answer \(x\)? |
| IsSup | \(x, d, y\) | fully supported, partially supported, no support | Are the claims in segment \(y\) backed by \(d\)? |
| IsUse | \(x, y\) | 5, 4, 3, 2, 1 | How useful is \(y\) as a response to \(x\)? |
x → [Retrieve=Yes] <p> d </p> [IsRel=Relevant] y_1 [IsSup=Fully supported]
→ [Retrieve=No] y_2 → ... → [IsUse=5]
Here \(x\) is the input, \(d\) is a retrieved document, and \(y\) is a segment of generated text (one sentence in the paper). Retrieve decides when to retrieve; the other three are critique tokens that make judgments: IsRel judges whether the document is relevant, IsSup judges whether the generated sentence is supported by the document (this maps directly to faithfulness; see Chapter 5), and IsUse gives the whole answer a usefulness score from 1 to 5 at the end. The sketch above shows where they appear in an output: the model decides to retrieve, reads a document, judges it relevant, writes the first sentence and judges it fully supported; then it decides the second sentence needs no retrieval and writes it directly; finally it scores the whole answer.
Interview questions
- ★★ What reflection tokens does Self-RAG use, and what does each do?
Training ★★¶
Self-RAG is trained in three steps and involves two models: a critic \(\mathcal{C}\) and a generator \(\mathcal{M}\).
- Collect critic data. GPT-4 labels sampled input–output pairs with reflection tokens, using a dedicated instruction and few-shot examples for each token type, collecting 4k–20k examples per type.
- Train the critic. A Llama 2-7B is trained on this data as the critic, with the objective on the left above: given input \(x\) and output \(y\), predict the reflection token \(r\) with a standard language-modeling loss. This effectively distills GPT-4's judgment into a cheap small model.
- Annotate offline, then train the generator. The critic processes the generator's training corpus: for each output segment, it decides whether retrieval is needed here; if so, the retriever fetches documents, and the critic judges whether they are relevant and whether the segment is supported, then gives the whole output an IsUse score. These reflection tokens and documents are inserted back into the text, forming the augmented corpus \(\mathcal{D}_{\text{gen}}\). The generator (Llama 2 7B and 13B, with the vocabulary expanded to include reflection tokens) is then trained with the objective on the right: plain next-token prediction, except the target sequence contains both the normal output \(y\) and the reflection tokens \(r\). The inserted documents are masked out of the loss, because the model should learn to use documents, not to generate them.
Why use an offline critic rather than calling a reward model online during training, as in RLHF? Because the online approach is expensive: every step needs sampling, scoring and a PPO update. Self-RAG writes the critic's judgments into the training data ahead of time, so the critic plays no part in generator training, which becomes ordinary SFT that is cheap and stable. The price is that the generator only learns to imitate the critic's labels, so its ceiling is bounded by the quality of the critic's (and hence GPT-4's) judgments.
Interview questions
- ★★ How is Self-RAG trained?
- ★ Why does Self-RAG use an offline critic instead of an RLHF-style online reward?
- ★ Why are retrieved passages masked out of the loss when training the generator?
Inference ★★¶
At inference, reflection tokens let us control the model's behavior without retraining. The procedure is:
- Decide whether to retrieve. Before each segment, check whether the probability of Retrieve=Yes (normalized over the Retrieve values) exceeds a threshold \(\delta\) (0.2 by default in the paper). The threshold can be tuned per task: lower for fact-heavy tasks to retrieve more, higher for creative writing to retrieve less.
- Process several documents in parallel. When retrieval is needed, fetch K documents and generate one candidate segment conditioned on each, giving K candidates, each with the model's predicted IsRel, IsSup and IsUse.
- Segment-level beam search. Score each candidate with the formula above. \(y_t\) is the candidate for segment \(t\), \(d\) is the document it used, and \(p(y_t \mid x, d, y_{<t})\) is the segment's generation probability; \(\mathcal{S}\) is the critique score, a weighted sum over the three critique token types. Here \(s_t^G\) is the probability of the "most desirable value" \(\hat{r}^G\) of type \(G\) (e.g. fully supported for IsSup), normalized over the \(N^G\) values of that type; \(w^G\) is the weight, by default 1.0 for IsRel and IsSup and 0.5 for IsUse. The highest-scoring candidates are kept (beam width 2 by default) and generation continues to the next segment.
- Soft vs hard constraints. The weighted score above is a soft constraint that only affects ranking; one can also use hard constraints and discard any candidate that outputs an undesirable token, for example every candidate with IsSup=no support.
The weights \(w^G\) can be changed at inference, which is a very practical feature of Self-RAG: if a task stresses accurate citation (e.g. every sentence must have a source), raise \(w^{\text{IsSup}}\); if fluent, complete answers matter more, raise \(w^{\text{IsUse}}\). The same model can switch between "faithful" and "useful" just by changing the weights.
Interview questions
- ★★ How does Self-RAG use reflection tokens to choose its output at inference?
- ★ How can you make Self-RAG care more about citation accuracy without retraining?
Strengths and limitations ★¶
Self-RAG's strength is that one model handles retrieval decisions, document filtering and self-checking, and its behavior is tunable at inference. It also decides "when to retrieve" differently from FLARE: FLARE uses token probability, a by-product signal with no dedicated training, while Self-RAG directly trains the model to predict "retrieval needed", so the signal is learned.
Its limitations come down to four points:
- It needs dedicated training. Reflection tokens have to be learned through finetuning, so closed API models can't use it, and switching base models means retraining.
- Its judgments are bounded by the critic. The labels come from a critic distilled from GPT-4, so the critic's biases are learned as they are.
- It grades its own work (a potential risk worth considering). At inference, IsSup and IsUse are scores the generator gives, in the same generation, to what it has just written. It is reasonable to worry that it may be lenient toward its own output, much like self-preference in LLM-as-judge. This is a risk to keep in mind, though, not a finding reported in the paper: in the paper's small human evaluation on 50 samples, the predicted IsRel and IsSup tokens mostly agreed with human judgments. Where citation accuracy matters a lot, a safer setup re-checks support with an independent model.
- Inference is expensive. Generating for K documents in parallel multiplies generation roughly by K, and with segment-level beam search on top, latency and compute are well above ordinary RAG.
Interview questions
- ★ How do Self-RAG and FLARE differ in deciding when to retrieve?
- ★ What are Self-RAG's limitations?
4.6 CRAG: Corrective RAG ★★¶
Motivation¶
FLARE and Self-RAG are mainly concerned with "when to retrieve", and both assume that what comes back is basically usable. Self-RAG's IsRel can judge document relevance, but it can only choose among the documents already retrieved; if all of them are wrong, it can't help. CRAG (Corrective RAG, Yan et al. 2024) specifically addresses "what to do when retrieval fails": first assess the quality of the retrieved results, then decide based on that quality whether to refine and use them, discard them and switch to another knowledge source, or combine both. Another motivation is that a static knowledge base (such as a Wikipedia snapshot from one point in time) has limited coverage, so when retrieval comes up empty there needs to be a broader fallback source.
The retrieval evaluator and three actions ★★¶
The core of CRAG is a lightweight retrieval evaluator: a finetuned T5-large (about 0.77B parameters) that takes "question + one document" and outputs a relevance score \(s_i \in [-1, 1]\). Each retrieved document is scored separately, and two thresholds, \(\tau_{\text{upper}}\) and \(\tau_{\text{lower}}\), decide the action:
- Correct: if at least one document scores above the upper threshold, retrieval is considered basically successful, and the system moves on to knowledge refinement, removing noise from these documents before using them.
- Incorrect: if every document is below the lower threshold, retrieval has completely failed. All retrieved results are discarded, and web search is used to get external knowledge instead.
- Ambiguous: in between, the evaluator isn't sure. The system hedges: the refined internal knowledge and the external knowledge from web search are combined and given to the generator.
Why three levels instead of a binary choice? Because the evaluator itself makes mistakes. A middle zone that keeps both sources when the evaluator is unsure reduces the damage from misjudgments: useful documents aren't thrown away because of a false "incorrect", and the generator isn't left with only irrelevant content because of a false "correct".
Why use a small evaluator instead of letting the LLM judge? First, it's cheap: a 0.77B model scoring each document is much faster than calling a large model. Second, it's focused: it does only one thing, "is this document relevant to the question", so it can be trained and swapped independently without touching the generator at all.
Interview questions
- ★★ What are CRAG's three actions, and how is each triggered?
- ★ Why does CRAG have an "Ambiguous" middle category?
Knowledge refinement and web search ★¶
Knowledge refinement (decompose-then-recompose). Even when a document is relevant as a whole, often only one or two sentences in it are actually useful, and the rest is noise. CRAG first splits documents into small strips (a few sentences each; a very short document counts as one strip), scores each strip with the same evaluator, filters out the low-scoring ones, and joins the rest back together in their original order. This removes noise and shortens the context at the same time.
Web-search fallback. When the action is Incorrect or Ambiguous, an LLM first rewrites the question into at most three keywords (search engines work better with keyword queries), then a search API retrieves web pages, with Wikipedia pages preferred because web quality varies widely and Wikipedia is relatively reliable. The retrieved web content goes through the same refinement process.
Web search fixes the limited coverage and staleness of a static knowledge base, but it brings new risks: web content is noisier and may contain errors or even malicious information (see Chapter 5), and search calls add noticeable latency.
Interview questions
- ★ How does CRAG's knowledge refinement work, and why is it needed?
Cost and positioning ★¶
CRAG is plug-and-play: it only changes the step between retrieval and generation, and the generator can be any model. The paper attaches it to both standard RAG and Self-RAG (the latter called Self-CRAG), with gains on PopQA and other datasets. The extra cost is mainly the evaluator calls: on PopQA, average execution time per example rose from 0.363 to 0.512 seconds. But the paper notes this is only a rough estimate of the generation phase that leaves out the retrieval and data-processing stages, and in a real system web-search latency is often the bigger factor. Its limitations are that the evaluator needs dedicated finetuning, and the two thresholds are set by hand per dataset and may need retuning for a new domain.
The difference between CRAG and Self-RAG can be summarized this way: CRAG uses an external small evaluator to judge retrieval quality before generation, needs no LLM training, and can switch to another knowledge source on failure; Self-RAG has the model itself judge, assessing both documents and its own outputs, but it can only choose among the documents it already has and has no fallback source. The two can be combined.
Interview questions
- ★★ How does CRAG differ from Self-RAG, and can they be combined?
4.7 Comparing the Methods ★★¶
| Method | Decision it makes | Signal | When decided | Training needed | Extra cost |
|---|---|---|---|---|---|
| Popularity gating (Mallen et al. 2022) | Whether to retrieve | Entity popularity | Before generation | Threshold tuning only | Negligible |
| Uncertainty threshold | Whether to retrieve | Token probability, entropy or sample consistency | Before or during generation | None | One draft, or several samples |
| FLARE | When to retrieve (per sentence) and what to query | Token probabilities of the drafted next sentence | During generation | None | Draft + regenerate for each triggered sentence; sequential latency |
| Adaptive-RAG | How much: none / single-step / multi-step | Query-complexity classifier | Before generation | Small classifier (auto-labeled) | One cheap classifier call + the chosen strategy |
| Strategy routing (bandit, Self-Route) | Which pipeline to run | Learned reward, or the model saying "unanswerable" | Before generation, or as a cascade | Bandit router, or none | Router call, or a failed first attempt |
| Self-RAG | When to retrieve, which passage, which output | Reflection tokens (Retrieve, IsRel, IsSup, IsUse) | During generation | Generator + critic finetuning | K parallel generations + segment-level beam search |
| CRAG | Whether to trust, refine or replace the retrieval | Evaluator relevance scores | After retrieval, before generation | Retrieval evaluator | Evaluator calls + possible web search |
A few threads stand out in the table. First, signals move from "by-products" to "dedicated learning": popularity and token probability are readily available and need no training but aren't very accurate; Adaptive-RAG, Self-RAG and CRAG all train dedicated models to make the judgment, which is more accurate but needs labeled data and transfers less well. Second, the later the decision, the more information and the higher the cost: decisions before generation are cheapest; decisions during generation can see where the model is unsure; decisions after retrieval can see the retrieved results themselves. Third, they solve different subproblems and can be stacked: a production system could use a router to set retrieval depth, then a CRAG-like evaluator to check retrieval quality, and finally an IsSup-style check to verify the output.
All these methods share one trait: the control flow is designed by hand, and the model only makes choices at predefined decision points. Agentic RAG in Chapter 6 goes further, letting the LLM decide through tool calls when to search, what to search for and how many times, and this behavior can be trained end to end with reinforcement learning.
Interview questions
- ★★ Compare FLARE, Adaptive-RAG, Self-RAG and CRAG: what decision does each make, with what signal, at what cost?
-
★ If you had to design adaptive retrieval for a production QA system, how would you combine these methods?
A sensible approach is to gate in layers from cheap to expensive: first use rules and a lightweight router to catch obvious cases (force retrieval for time-sensitive or private-data questions, skip it for chitchat), then choose single-step or multi-step by complexity; after retrieval, use a small evaluator to filter or trigger a fallback source; finally check the output's citations and support (see Chapter 5). Before launch, compare against "always retrieve" on the accuracy-versus-cost curve, and keep monitoring whether the routing distribution drifts.
4.8 Open Problems ★¶
Calibrating the "need to retrieve" decision ★¶
Every adaptive retrieval method ultimately depends on one judgment: does the model need external knowledge? For this judgment to be reliable, the signal must be calibrated: the higher the signal value \(s\), the higher the probability that retrieval actually helps. But current signals struggle to achieve this in several places:
- Overconfidence. Models after RLHF are generally overconfident, and "confident but wrong" cases never trigger retrieval, which is exactly the most dangerous situation.
- Stale knowledge. The model is confident about facts from its training data, but the world has changed. Signals internal to the model simply cannot detect this, so the question's time sensitivity has to be judged separately.
- Out-of-distribution failure. Moskvoretskii et al. (2025) found that when moving to a new domain, every method's ability to judge "whether I know" drops markedly.
- The signal measures the wrong thing. Most signals measure the model's uncertainty, not the expected gain from retrieval. Ideally one should jointly consider whether the model knows, whether the knowledge base contains the answer, and whether the retriever can find it.
Interview questions
- ★ Why is the "need to retrieve" decision hard to calibrate?
Evaluation ★¶
How to evaluate an adaptive retrieval method is itself an unsolved problem:
- Report quality and cost together. Reporting accuracy alone is meaningless, since "always multi-step" usually has the highest accuracy. One should report the number of retrievals, LLM calls, tokens or latency, ideally drawing an accuracy-versus-cost curve and comparing methods at equal cost.
- "Needs retrieval" has no objective ground truth. It depends on the specific model, knowledge base and retriever. Adaptive-RAG's automatic labels come from running a specific model, so they don't hold for another model, and the labels are noisy as well.
- Downstream accuracy can hide poor judgment. A method may score well on QA while its retrieval decisions have little to do with whether the model actually knows the answer. So self-knowledge needs to be measured separately, for example by treating the signal as a predictor of "will the model get this wrong" and computing its AUROC.
- Benchmarks are narrow. Most evaluation focuses on short-answer factoid QA (EM/F1), while long-form generation, multi-turn dialogue and time-sensitive questions are studied far less. Also, benchmark data may already appear in the pretraining corpus, which blurs the judgment of whether the model "already knew" the answer.
So a new method should at least be compared against two simple baselines: always retrieving, and a simple uncertainty threshold.
Interview questions
- ★ How would you evaluate an adaptive retrieval method?
- ★ What problems in adaptive RAG remain unsolved?