Skip to main content
QUICK REVIEW

[Paper Review] Query Rewriting for Retrieval-Augmented Large Language Models

Xinbei Ma, Yeyun Gong|arXiv (Cornell University)|May 23, 2023
Topic ModelingComputer Science10 citations
TL;DR

This paper introduces Rewrite-Retrieve-Read, a framework that adds a trainable query rewriter in front of a frozen retriever and LLM reader to improve retrieval-augmented LLM performance, with reinforcement-learning fine-tuning of the rewriter.

ABSTRACT

Large Language Models (LLMs) play powerful, black-box readers in the retrieve-then-read pipeline, making remarkable progress in knowledge-intensive tasks. This work introduces a new framework, Rewrite-Retrieve-Read instead of the previous retrieve-then-read for the retrieval-augmented LLMs from the perspective of the query rewriting. Unlike prior studies focusing on adapting either the retriever or the reader, our approach pays attention to the adaptation of the search query itself, for there is inevitably a gap between the input text and the needed knowledge in retrieval. We first prompt an LLM to generate the query, then use a web search engine to retrieve contexts. Furthermore, to better align the query to the frozen modules, we propose a trainable scheme for our pipeline. A small language model is adopted as a trainable rewriter to cater to the black-box LLM reader. The rewriter is trained using the feedback of the LLM reader by reinforcement learning. Evaluation is conducted on downstream tasks, open-domain QA and multiple-choice QA. Experiments results show consistent performance improvement, indicating that our framework is proven effective and scalable, and brings a new framework for retrieval-augmented LLM.

Motivation & Objective

  • Motivate and address the gap between input text and the knowledge needed for retrieval in retrieval-augmented LLMs.
  • Propose a Rewrite-Retrieve-Read pipeline that front-loads a query rewriting step before retrieval.
  • Introduce a trainable rewriter (based on a small language model) trained with reinforcement learning to align with a frozen reader and retriever.
  • Demonstrate effectiveness and scalability of the approach on knowledge-intensive tasks.

Proposed method

  • Define the Rewrite-Retrieve-Read pipeline with three steps: rewrite the input into a query, retrieve relevant context with a web search engine, and read to predict the answer.
  • Implement a trainable rewriter G_theta (initialized from T5-large) that is warmed up on pseudo data and then fine-tuned via reinforcement learning using a reward derived from LLM reader performance.
  • Use a few-shot prompt to elicit queries from an LLM as a baseline rewriter and compare against the trainable rewriter.
  • Train the rewriter with PPO-based policy optimization, including a value network and KL regularization to stay near initialization.
  • Evaluate using open-domain QA datasets (HotPotQA, AmbigNQ, PopQA) and multiple-choice QA (MMLU) with ChatGPT and Vicuna-13B as readers.
  • Utilize Bing as the retriever and BM25 for document filtering, with both snippet-based and URL-based retrieval variants.

Experimental results

Research questions

  • RQ1Can adding a query rewriting step improve retrieval-augmented LLM performance beyond standard retrieve-then-read pipelines?
  • RQ2How does a trainable rewriter, optimized via reinforcement learning, compare to a frozen LLM rewriter and direct prompt-based rewriting?
  • RQ3What is the impact of query rewriting on open-domain QA and multiple-choice QA accuracy when using black-box LLM readers?

Key findings

  • Query rewriting consistently improves retrieval-augmented LLM performance on open-domain QA datasets compared to direct or standard retrieve-then-read baselines.
  • A trainable rewriter often surpasses the standard retrieve-then-read setup, and can approach or match the performance of an LLM-based rewriter on several tasks.
  • In multi-dataset evaluation, benefits vary by task and reader; for some datasets, the LLM rewriter remains superior, while the trainable rewriter offers competitive gains with lower resource usage.
  • On multiple-choice QA (MMLU), the rewriting approach yields gains across most categories, with stronger improvements when using Vicuna-13B as the reader than with ChatGPT.
  • Learned rewriters, trained with reinforcement learning, can better tailor queries to the frozen retriever and reader than prompt-based baselines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.