Papers
Topics
Authors
Recent
Assistant
AI Research Assistant
Well-researched responses based on relevant abstracts and paper content.
Custom Instructions Pro
Preferences or requirements that you'd like Emergent Mind to consider when generating responses.
Gemini 2.5 Flash
Gemini 2.5 Flash 188 tok/s
Gemini 2.5 Pro 49 tok/s Pro
GPT-5 Medium 39 tok/s Pro
GPT-5 High 39 tok/s Pro
GPT-4o 78 tok/s Pro
Kimi K2 207 tok/s Pro
GPT OSS 120B 446 tok/s Pro
Claude Sonnet 4.5 35 tok/s Pro
2000 character limit reached

Rewrite-Retrieve-Read Framework

Updated 10 October 2025
  • The rewrite-retrieve-read framework is a modular approach that transforms user queries to align with retrieval engines, enhancing evidence relevance and response quality.
  • It integrates explicit query rewriting, diverse retrieval mechanisms, and LLM-based reading to effectively bridge query-document discrepancies and support domain-specific applications.
  • Empirical results show significant improvements in accuracy, retrieval precision, and performance in domains such as open-domain QA, code rewriting, and scientific computing.

The rewrite-retrieve-read framework is a modular approach designed to address limitations inherent to traditional retrieval-augmented generation (RAG) and retrieve-then-read pipelines. By introducing an explicit query rewriting stage, the framework seeks to align a user's original input with the requirements of the retrieval engine and downstream readers—often LLMs—thereby improving both the precision of retrieved evidence and the final response quality. This strategy has been empirically validated across multiple domains, including open-domain and domain-specific question answering, expository text generation, commercial search, code rewriting, and scientific computing agents.

1. Core Structure and Workflow

A standard rewrite-retrieve-read pipeline integrates three main modules:

  1. Rewrite: Transforms the initial question or input (x) into an optimized query (x~\tilde{x}), typically using either a prompted LLM or a trainable smaller model. The goal is to bridge gaps between user phrasing and corpus language, disambiguate ambiguous inputs, or target domain-specific vocabulary.
  2. Retrieve: Uses the rewritten query to search an external knowledge source—such as web search engines, dense/sparse indices, or specialized memory modules—to collect relevant context or supporting documents.
  3. Read: Processes the retrieved context (in combination with either the original or rewritten query) with an (often frozen) LLM or reader model to generate the final answer or output.

This structure directly addresses the query–document discrepancy, a challenge in retrieval-centric pipelines where the user's question may not match the granularity, terminology, or structure of knowledge base entries (Ma et al., 2023).

2. Query Rewriting Strategies

The rewriting step is central to the framework, with several principal methodologies:

  • Rule-based and Few-shot Prompting: Off-the-shelf LLMs are prompted via demonstrations to generate more effective search queries, often using a "think step-by-step" paradigm.
  • Trainable Rewriters: Smaller models (e.g., T5-large) are fine-tuned end-to-end on rewriting tasks, sometimes assembled from outputs that yield correct downstream answers.
  • Reinforcement Learning (PPO): The rewriter is optimized using rewards based on final task metrics (e.g., Exact Match, F1, hit rate), with KL-regularization to prevent policy drift:

R(s,a)=RlmβKL(πθπ0)R(s, a) = R_{lm} - \beta \cdot KL(\pi_\theta \| \pi_0)

  • Structurally Informed Rewriting: Multi-step processes, such as "Crafting the Path" (Baek et al., 17 Jul 2024), decompose rewriting into Concept Comprehension, Type Identification, and Expected Answer Extraction to minimize reliance on LLM parameters and reduce hallucinations.
  • Continual Pre-training (CPT): The rewriter is further pre-trained on professional or domain documents, equipping it with explicit in-domain knowledge before fine-tuning for query reformulation (Wang et al., 1 Jul 2025).

3. Retrieval and Integration Mechanisms

Rewritten queries are used to drive various retrieval modules:

  • Web Search Integration: Instead of static indices, a web search engine (e.g., Bing) serves as the retriever, allowing immediate access to a broad, up-to-date knowledge base (Ma et al., 2023).
  • BM25 and Dense Retrievers: Rewrites are tailored for both sparse (BM25) and dense retrieval systems, with custom prompt designs for each (Martinez et al., 20 Jun 2025).
  • Hybrid and Structure-aware Retrieval: Especially in code or SQL rewriting, structural and semantic signatures are fused for retrieval (e.g., query parse tree templates, one-hot rule indicators combined with recipe embeddings) (Sun et al., 2 Dec 2024).
  • Knowledge Graph and Memory Stores: In knowledge graph link prediction, retrieval focuses on extracting a relevant subgraph, while in RET-LLM, salient knowledge triplets are retrieved from a persistent, updatable store (Pahuja et al., 2022, Modarressi et al., 2023).

Integration with readers typically involves concatenating the retrieved context, the rewritten query, and possibly the original input as prompt to a frozen LLM. Feedback from the reader (e.g., correct/incorrect answer) may inform RL-style training of the rewrite module.

4. Specialized Variants and Domain-Specific Adaptations

The rewrite-retrieve-read approach has seen bespoke designs and successes in specialized domains:

  • Medical Question Answering: MedGENIE (Frisoni et al., 4 Mar 2024) optionally bypasses retrieval altogether, generating multi-view, artificial contexts directly using domain-tuned LLMs, and demonstrates that generated passages often outperform retrieved contexts for multiple-choice medical QA.
  • SQL Optimization and Code Rewrite: R-Bot (Sun et al., 2 Dec 2024) and related frameworks prepare multi-source rewrite evidences offline (from code and forum Q&A), retrieve these via hybrid structure-semantics search, and iteratively guide rule ranking and application via LLMs, incorporating self-reflection to avoid hallucinations.
  • E-commerce Search: IterQR (Chen et al., 16 Feb 2025) adopts an iterative pipeline, incorporating chain-of-thought prompting, domain-augmented RAG, online signal collection (using user clicks as feedback), and multi-task post-training for continuous evolution of the rewrite module.
  • Scientific Computing and Autonomous Agents: The Re4 framework (Cheng et al., 28 Aug 2025) introduces an extended "rewriting–resolution–review–revision" chain, employing distinct LLMs for contextual augmentation, code generation, review, and iterative refinement to autonomously improve bug-free code and physical validity.

5. Empirical Performance and Comparative Evaluation

Empirical evaluations consistently demonstrate that rewrite-retrieve-read systems offer measurable improvements across domains:

  • Open-domain QA: On benchmarks such as HotpotQA and AmbigNQ (Ma et al., 2023), methodologically rewritten queries boost exact match and F1 metrics significantly over both direct retrieval and parametric LLMs alone.
  • Specialized QA: In professional or financial contexts, domain-pretrained rewriters (CPT + SFT) improve accuracy metrics by up to 19.4 percentage points over vanilla rewriters (Wang et al., 1 Jul 2025).
  • Retrieval Precision: Query rewriting improves retrieval metrics such as mean reciprocal rank (MRR) by 13–14% on single-document questions (Martinez et al., 20 Jun 2025).
  • Code Optimization: R-Bot achieves latency reductions (up to 94% on p90) and query improvement ratios significantly above GPT-3.5/4 baselines due to systematic evidence-guided rewriting (Sun et al., 2 Dec 2024).
  • Conversational QA: Frameworks such as SELF-multi-RAG (Roy et al., 23 Sep 2024) show a ~13% improvement in retrieval and response quality on multi-turn datasets, owing to the learned ability to decide when to retrieve, what to rewrite, and how to critique the answer.
  • Scientific Code Generation: Multi-LLM agent chains increase bug-free code execution rates from 59–66% to 82–87%, with iterative reviews enabling selection of more accurate numerical solution methods (Cheng et al., 28 Aug 2025).

6. System Design Considerations and Challenges

Direct evidence-based rewriting reduces the risk of hallucination and enhances interpretability, but several challenges remain:

  • Search Space Complexity: The rewrite phase introduces a combinatorial search over possible reformulations. Strategies to mitigate this include evidence pre-selection, fusion-based retrieval ranking, and step-wise decomposition.
  • Integration Overhead: Modular pipelines require efficient offline preparation of evidences, fast online retrieval, and bounded latency for real-world deployment.
  • Domain Adaptation: Continual pre-training, evidence curation, and structured prompting are critical in low-resource or rapidly evolving domains.
  • Self-Reflection and Robustness: Iterative, self-critic mechanisms (e.g., reflection tokens, review–revision loops) help catch and rectify hallucinations, incorrect rule application, or non-physical outputs.

7. Future Directions and Applications

Prospective advancements and new applications for the rewrite-retrieve-read framework include:

  • Dynamic, Context-Aware Rewriting: Leveraging reinforcement learning, error detection, and error correction to adapt rewriting strategies over time and across topics.
  • Multimodal and Multilingual Generalization: Adapting structured rewriting to settings involving non-textual queries, multimodal corpora, or low-resource languages (Baek et al., 17 Jul 2024).
  • Deeper Integration with External Tools: Connecting rewriting steps to structured memory, external logic engines, or real-time feedback from user interaction logs.
  • Comprehensive Evaluation: Emerging evaluation packages (e.g., SCARF (Rengo et al., 10 Apr 2025)) enable end-to-end, black-box benchmarking of complete pipelines, facilitating robust, plug-and-play deployment.

In summary, the rewrite-retrieve-read framework provides a flexible, interpretable, and empirically validated architectural paradigm for enhancing retrieval-augmented generation across a wide spectrum of language processing and reasoning tasks. Its layered, modular structure allows fine-grained optimization of each stage, supports domain adaptation, and demonstrates clear performance improvements relative to prior monolithic or retrieve-then-read approaches, as substantiated in large-scale experiments and real-world deployments.

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to Rewrite-Retrieve-Read Framework.