Skip to content
RAG Explained Better

FLARE: Forward-Looking Active Retrieval

Retrieving mid-generation whenever the model is about to say something it is not confident about.

FLARE (Forward-Looking Active REtrieval augmented generation) is an active RAG method that predicts the next sentence, retrieves when that draft contains low-confidence tokens, and regenerates the sentence with the new documents instead of retrieving once from the user query only. Jiang et al. introduce FLARE in Active Retrieval Augmented Generation (EMNLP 2023; arXiv:2305.06983) as an inference-time loop for long-form knowledge-intensive generation. The price is multiple language-model calls per answer and a need for token probabilities to drive the gate, which is why the pattern sits beside published cost and non-gain settings rather than as a default on every query. Among the named patterns under RAG architectures, FLARE owns mid-generation forward-looking retrieve; a pre-answer skip-or-retrieve gate lives on adaptive retrieval.

How does FLARE decide when to retrieve mid-generation?

FLARE decides mid-generation by drafting the next sentence first, then retrieving only if that draft looks under-confident: a forward-looking gate, not a fixed retrieve-every-N-tokens schedule. Conditioned on the user input and text already accepted, the language model generates a temporary next sentence, as Jiang et al. (2023, Figure 1 / section 3.2) describe. If every token probability is at least θ, the draft is kept. If any token falls below θ, retrieval fires. θ = 0 never retrieves; θ = 1 retrieves every sentence.

When retrieval fires, FLARE builds a query from the temporary sentence, fetches documents (BM25 over Wikipedia, or Bing for WikiAsp in the paper setup), prepends them, and regenerates that sentence before accepting it into the answer. The loop repeats until generation ends. The paper default reported system is FLAREdirect (confidence-triggered). FLAREinstruct instead teaches the model to emit [Search(query)] tokens (section 3.1); on 2WikiMultihopQA Table 1 it scores lower than Direct (EM 42.4 vs 51.0).

That timing is the design point. Single-time RAG spends its only retrieve on the user question, so later sentences that need new facts never get a second look. FLARE pays for another retrieve when the model is about to say something uncertain, which is why Learn Prompting FLARE / Active RAG write-up and the Weaviate YouTube explainer of Active Retrieval Augmented Generation (FLARE) both stress the temporary-sentence gate before search.

A five-step loop. One, draft the next sentence: conditioned on the user input and text already accepted, the LM drafts a temporary next sentence. Two, check token probabilities against theta: if every token probability is at least theta keep the draft, if any token falls below theta trigger retrieval. Three, build a query from the draft: mask low-confidence tokens or generate explicit search questions from the draft. Four, retrieve and regenerate: fetch documents, prepend them, and regenerate the sentence with the new evidence. Five, repeat until the answer ends: each accepted sentence becomes context for the next draft. A dashed return arrow marks that the loop repeats.
FLARE loop closes on itself: the fifth step feeds the first, so a new sentence is drafted, gated on token confidence, and only retrieved-and-regenerated when the draft looks under-confident.

Once the gate fires, the open question is how the temporary sentence becomes a search query that matches what the model was about to claim rather than only the original user wording.

How does FLARE turn a low-confidence sentence into a retrieval query?

FLARE forms the retrieval query from the temporary sentence so the search matches what the model is about to say, not only the original user question. Jiang et al. (2023 section 3.2.2) give two formulations. Implicit masking replaces tokens with probability below β with masks so erroneous low-confidence spans do not dominate the query; higher β masks more aggressively. Explicit question generation asks the language model to turn uncertain spans into natural-language search questions.

Table 5 in the paper shows β = 0 (full sentence as query) underperforms mild masking on 2WikiMultihopQA, because a confidently wrong entity can still pollute the search. Table 6 finds implicit and explicit performance similar on ASQA-hint and WikiAsp. Paper Table 9 (dev-tuned) sets β = 0.4 on all four datasets; θ = 0.8 for 2WikiMultihopQA, ASQA/ASQA-hint, and WikiAsp, and θ = 0.4 for StrategyQA. The paper running example is why masking matters: a draft that wrongly sends Joe Biden to the University of Pennsylvania can retrieve the wrong school unless uncertain tokens are stripped or re-queried before search.

Emergent Mind FLARE topic restates the same algorithmic frame: the query is derived from the forward-looking draft, so vocabulary in the upcoming claim drives retrieval. That is a different failure class from vocabulary mismatch on a static user query, because the mismatch can appear mid-answer after the first retrieve already ran.

How well does FLARE perform on published benchmarks?

FLARE published gains are from Jiang et al. (2023) few-shot runs with text-davinci-003, at most 500 examples per dataset, and BM25 or Bing retrieval as listed in the paper Table 7. Those numbers are not a transfer promise on a private corpus or a newer chat model.

Jiang et al. (2023): selected primary metrics (Tables 1 to 2)
Setting 2Wiki EM StrategyQA EM ASQA EM ASQA-hint EM WikiAsp UniEval
No retrieval 28.2 72.9 33.8 40.1 47.1
Single-time retrieval 39.4 68.6 40.0 43.2 52.4
Question decomposition (2Wiki only) 47.8 n/a n/a n/a n/a
FLAREdirect / FLARE 51.0 77.3 41.3 46.2 53.4

On 2WikiMultihopQA, FLAREdirect EM of 51.0 beats question-decomposition 47.8 and single-time 39.4 (Table 1). StrategyQA Table 2 shows FLARE EM 77.3 versus single-time 68.6. ASQA EM moves from 40.0 single-time to 41.3 FLARE, ASQA-hint from 43.2 to 46.2, and WikiAsp UniEval from 52.4 to 53.4. Learn Prompting Results section and Emergent Mind Empirical Evaluation restatement track the same primary columns.

Ablations in the same paper show next-sentence queries beat previous-sentence queries (Table 3), and that retrieving on roughly 40 to 80% of sentences is usually a good operating range. Past 50% retrieval on StrategyQA can hurt (Figure 5 discussion), which is why θ is a tunable spend knob rather than a fixed always-on schedule.

What does FLARE cost?

FLARE cost is structural multi-call generation: each sentence may require a draft call plus a regenerate call after retrieval, so API spend and latency scale with output length and how often θ fires. The official FLARE repository (jzbjyb/FLARE) warns that experiments are relatively expensive because FLARE calls the OpenAI API multiple times for a single example.

Jiang et al. (2023 section 9) note that a naive interleaving implementation increases overhead and cost: the language model is activated once per retrieval step, and a caching-free stack recomputes prior activations after each retrieve. Beancount May 2026 research note on FLARE repeats the same practical limit: the method holds where later sentences need new evidence, and the bill is repeated generation.

No universal dollar or latency figure appears in the paper as a product SLA. Exact spend depends on model price, sentence count, and retrieval rate, so teams measure on their own stack rather than inventing a latency number from the EMNLP tables.

When should you use FLARE, and when should you avoid it?

FLARE is built for long-form generation where later sentences need facts the initial retrieve never saw. Jiang et al. (2023 section 9) also document settings where it did not help, which ranking blogs often skip.

Use it for long, knowledge-intensive outputs. Multihop QA, long-form QA, and open-domain aspect summarization are the paper positive tasks (2WikiMultihopQA, ASQA, WikiAsp, StrategyQA). Expect little gain on short dialogue turns: on Wizard of Wikipedia, outputs average about 20 tokens, and the paper reports no significant FLARE gains (section 9). Expect little gain on ELI5-style open-ended long answers either; the paper found no significant gains for FLARE or single-time retrieval over no retrieval on ELI5, citing grounding and evaluation difficulties (section 9).

Skip FLARE if the stack cannot expose token probabilities or cannot afford multi-call generation. The Direct gate needs per-token confidence; without that signal, paper-faithful θ triggering is undefined. If the product only needs a once-per-query skip-or-retrieve decision before answering starts, that problem is a skip-or-retrieve gate, not FLARE.

How is FLARE different from adaptive retrieval or IRCoT?

FLARE is one active-retrieval design among several that share the “retrieve more than once” slogan but trigger on different events. Adaptive retrieval gates whether to call the retriever for the query at all (classifier, confidence, or Retrieve-token). That decision is usually made before or as the answer starts, which is the mechanism on the adaptive gate.

IRCoT interleaves retrieval with chain-of-thought steps so each thought can fetch what the next needs, which is the mechanism on IRCoT. Single-time RAG retrieves once from the user input, then generates the whole answer. Fixed-interval multi-time retrieval retrieves every N tokens or every sentence without checking confidence: the passive baselines FLARE beats in Jiang et al. (2023 section 4 / Tables 1 to 2). Learn Prompting “How FLARE Differs” table makes the same single-time versus active contrast at overview depth.

Self-RAG trains reflection tokens for retrieve-and-critique behaviour and belongs on Self-RAG. General multi-hop control-loop depth lives on multi-hop RAG. FLARE distinctive claim remains the forward-looking temporary sentence plus confidence gate at generation time.

How do you implement FLARE?

Implementing FLARE is a handoff checklist: expose token probabilities, loop sentence drafts, apply θ/β, retrieve, regenerate, and re-tune thresholds when the generator model changes. Direct FLARE is undefined without logprobs or an equivalent confidence signal. The loop is draft, gate on θ, optional retrieve, accept the regenerated sentence, then continue.

Wire a retriever behind the same query step. The paper uses BM25 on a Wikipedia dump or Bing; production stacks swap in a vector index. Stores with native hybrid search such as Weaviate, Qdrant, and Pinecone can serve the retrieve call with BM25F-plus-vector fusion when the draft query is lexical and semantic at once; hybrid search configuration as of September 2026 is documented on docs.weaviate.io for Weaviate relative-score fusion path. LanceDB FLARE blog and the Medium republish under EtoAI show a LangChain-style notebook against LanceDB, which is an example path rather than the only store.

Start from published configs, then re-measure. Table 9 θ/β values were tuned for text-davinci-003 (the paper notes API access as of April 2023). Official code is the jzbjyb/FLARE repository. Full runnable pipeline assembly, including chunking and serving, belongs on building a RAG pipeline.

FLARE is mid-generation active retrieval: draft the next sentence, retrieve when token confidence falls below θ, query from that draft with masking or explicit questions, regenerate, and repeat. Jiang et al. (2023) show the largest published lifts on 2WikiMultihopQA and StrategyQA under text-davinci-003, document multi-call cost, and report little gain on Wizard of Wikipedia and ELI5. Choose FLARE when long answers need evidence the first retrieve missed and the stack can afford confidence-gated multi-call generation; choose adaptive retrieval or IRCoT when the trigger should sit before answering or on chain-of-thought steps instead.