Query Rewriting in Retrieval-Augmented Large Language Models (EMNLP 2023)
Source: https://aclanthology.org/2023.emnlp-main.322/
Key points
- Problem: In retrieval-augmented generation (RAG), raw user queries are frequently ill-formed or ambiguous as search inputs, leading to irrelevant retrieval results and hallucinated or incorrect LLM answers.
- Proposed solution: The paper introduces the Rewrite-Retrieve-Read (RRR) framework, which adds an explicit query rewriter module between the user input and the web search API used by the retrieval-augmented LLM.
- Trainable rewriter: Unlike previous pipeline designs where the rewriter is frozen, RRR treats rewriting as the bottleneck of the pipeline and makes it trainable: 1. The rewriter is fine-tuned on query rewriting data to learn the rewriting task. 2. It is then aligned with the frozen downstream reader LLM via reinforcement learning, optimizing the rewritten query for final answer quality.
- Results: In experiments using a search-augmented GPT-3.5 setup on open-domain QA benchmarks, RRR achieves consistent improvements over standard retrieval-augmented prompting, including in few-shot settings.
- Conceptual contribution: The work reframes RAG as a flexible, reconfigurable pipeline in which the query—not just the reader—can be adapted.
- Query rewriting and expansion sit in the broader query understanding space of search and retrieval systems, alongside related directions such as aligned query expansion, LLM-based query expansion, conversational query rewriting (e.g., Few-Shot Generative Conversational Query Rewriting, SIGIR 2020), and query decomposition for retrieval.
- The work is frequently cited as an early, systematic demonstration that optimizing the query side of the RAG pipeline yields measurable end-task gains, anticipating later agentic approaches where retrieval strategy itself is learned.
- Experiments rely on a web search API and GPT-3.5-class readers; results may vary with different retrievers, local corpora, or stronger reader models.
- Quantitative results should be verified against the original PDF tables before citation.
- Reinforcement learning over rewriters adds training complexity and depends on a reliable reward signal from the reader.
- Original paper: *Query Rewriting for Retrieval-Augmented Large Language Models*, EMNLP 2023. https://aclanthology.org/2023.emnlp-main.322/
Method overview
The framework follows a four-stage inference path:
1. Rewrite: A trainable rewriter transforms the original user query into a search-friendly query. 2. Retrieve: The rewritten query is issued to a web search API (e.g., a commercial search engine) to fetch relevant passages. 3. Read: The reader LLM conditions on the original question, retrieved passages, and few-shot examples to generate the answer. 4. Optimize: Training alternates between supervised fine-tuning of the rewriter and reinforcement learning that uses reader feedback (answer correctness) as the reward signal, while keeping the large reader LLM frozen.