Skip to main content
QUICK REVIEW

[Paper Review] RQ-RAG: Learning to Refine Queries for Retrieval Augmented Generation

Chi-Min Chan, Chunpu Xu|arXiv (Cornell University)|Mar 31, 2024
Topic ModelingComputer Science15 citations
TL;DR

RQ-RAG trains a 7B Llama2 model to rewrite, decompose, and disambiguate queries for retrieval-augmented generation, achieving state-of-the-art on single-hop QA and strong gains on multi-hop QA.

ABSTRACT

Large Language Models (LLMs) exhibit remarkable capabilities but are prone to generating inaccurate or hallucinatory responses. This limitation stems from their reliance on vast pretraining datasets, making them susceptible to errors in unseen scenarios. To tackle these challenges, Retrieval-Augmented Generation (RAG) addresses this by incorporating external, relevant documents into the response generation process, thus leveraging non-parametric knowledge alongside LLMs' in-context learning abilities. However, existing RAG implementations primarily focus on initial input for context retrieval, overlooking the nuances of ambiguous or complex queries that necessitate further clarification or decomposition for accurate responses. To this end, we propose learning to Refine Query for Retrieval Augmented Generation (RQ-RAG) in this paper, endeavoring to enhance the model by equipping it with capabilities for explicit rewriting, decomposition, and disambiguation. Our experimental results indicate that our method, when applied to a 7B Llama2 model, surpasses the previous state-of-the-art (SOTA) by an average of 1.9\% across three single-hop QA datasets, and also demonstrates enhanced performance in handling complex, multi-hop QA datasets. Our code is available at https://github.com/chanchimin/RQ-RAG.

Motivation & Objective

  • Motivate the need to improve retrieval-augmented generation by addressing ambiguity and complexity in user queries.
  • Develop a training framework that enables explicit query rewriting, decomposition, and disambiguation.
  • Create a dataset and training regime that teaches the model to refine queries and use retrieved documents effectively.
  • Demonstrate empirical gains over prior SOTA methods on multiple QA benchmarks.

Proposed method

  • Construct a dataset transforming origin input-output pairs into sequences with refinement actions and retrieved documents (rewrite, decompose, disambiguate).
  • Use ChatGPT to automate annotation to generate refined queries and contextually grounded answers.
  • Train a 7B Llama2 model with an autoregressive objective to maximize p(y|q1,d1,...,x).
  • Implement a tree decoding sampling strategy with three trajectory-selection methods: perplexity-based, confidence-based, and ensemble-based.
  • Assess an upper bound by tracking whether any trajectory yields the correct answer.

Experimental results

Research questions

  • RQ1How can a model learn to rewrite, decompose, and disambiguate queries to improve retrieval-augmented generation?
  • RQ2Do refined-query trajectories improve QA performance over baselines on single-hop and multi-hop tasks?
  • RQ3What data sources and sampling strategies yield the best results for query refinement in RAG?
  • RQ4What is the upper-bound potential of query-refinement trajectories for answering complex questions?

Key findings

  • RQ-RAG outperforms Self-RAG and SAIL on single-hop QA tasks, with an average improvement of 1.9% across ARC_C, POPQA, and OBQA over prior SOTA baselines.
  • On multi-hop QA tasks, RQ-RAG yields a substantial average gain of 22.6% over strong baselines and surpasses Chain-of-Thought/Chain-of-Note approaches even with a smaller 7B backbone.
  • Regenerating answers based on retrieved contexts (0% retention of original answers) provides higher gains than retaining portions of original answers.
  • RQ-RAG shows robustness to data sources during inference, with minimal performance variance when using DuckDuckGo, Wikipedia, or Bing as retrieval sources, unlike some baselines.
  • The approach demonstrates a high potential upper bound, indicating that if the correct trajectory is selected, the system can achieve substantially higher accuracy.

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.