MaFeRw: Query Rewriting with Multi-Aspect Feedbacks for Retrieval-Augmented Large Language Models

Yujing Wang, Hainan Zhang, Liang Pang, Binghui Guo, Hongwei Zheng, Zhiming Zheng

Introduction

Conversational Retrieval-Augmented Generation (RAG) systems often struggle with user queries that are not self-contained. In multi-turn dialogues, users frequently use anaphora (e.g., "it", "that") or ellipsis, relying on previous context. To effectively retrieve relevant information, these ambiguous queries must be rewritten into standalone search terms.

Overview of the query rewriting process in a conversational RAG system.

While query rewriting is essential, training these models is challenging. Supervised learning requires expensive manual rewrites. Reinforcement Learning (RL) offers an alternative, but standard "sparse" rewards—such as final answer correctness—provide insufficient guidance for the complex multi-step pipeline of retrieval, ranking, and generation. This leads to training instability and suboptimal performance.

The MaFeRw Framework

To address these challenges, the authors introduce MaFeRw (Multi-aspect Feedback Rewriter). This framework utilizes multi-faceted "dense" rewards to guide a T5-based rewriter more effectively.

Multi-Aspect Feedback

MaFeRw decomposes feedback into four distinct metrics to provide granular guidance to the rewriter:

  1. Gold Document Similarity ($m_{d+}$): Measures the semantic proximity of the rewritten query to the known "gold" document.
  2. Ranking Metric ($m_D$): Evaluates how well the rewritten query helps the retriever prioritize relevant documents.
  3. Generation Quality ($m_G$): Assesses the final RAG-generated response against the ground truth using ROUGE scores.
  4. Reference Similarity ($m_q$): Compares the model's rewrite to human-authored reference rewrites.

Reinforcement Learning from AI Feedback (RLAIF)

Executing a full RAG pipeline for every RL training step is computationally expensive. MaFeRw employs a Reinforcement Learning from AI Feedback (RLAIF) approach to mitigate this.

The MaFeRw training architecture, featuring reward models and the PPO-based rewriter optimization.

The system trains three lightweight T5-based reward models to predict scores for the first three metrics. These models provide near-instantaneous feedback during the Proximal Policy Optimization (PPO) phase, significantly accelerating training and enhancing stability by decoupling the rewriter from the latency of the full RAG pipeline.

Experimental Evaluation

The model was evaluated on three key datasets: QReCC (14k conversations), TopiOCQA (challenging topic-switching), and WSDM@24 Multi-Doc QA (transferability testing).

Key Results

MaFeRw consistently outperformed both raw RAG (without rewriting) and standard T5-based rewriters across multiple metrics:

  • Retrieval Performance: On TopiOCQA, MaFeRw achieved a Mean Reciprocal Rank (MRR) of 0.3802, compared to 0.2664 for raw RAG.
  • Generation Quality: On QReCC, MaFeRw reached a ROUGE-1 score of 37.05, surpassing the T5-base rewriter (35.73) and the RL-base baseline (35.47).
  • Transferability: The model demonstrated robust performance on the WSDM@24 dataset, indicating that multi-aspect feedback helps the model learn generalizable rewriting principles rather than just memorizing specific dataset patterns.

Discussion and Future Work

The success of MaFeRw highlights two critical insights. First, dense rewards are essential; intermediate feedback from retrieval and ranking steps prevents model "drift" during RL training. Second, balancing retrieval and generation is key. By including generation-based rewards ($m_G$), MaFeRw ensures that rewrites are not only optimized for search engines but are also "LLM-friendly" for final answer generation.

Despite its strengths, the authors identify several areas for future research. Integrating document re-ranking into the feedback loop could further refine the information provided to the LLM. Additionally, reconstructing prompts for queries with multiple complex intents remains a challenge. While reward models reduce training time, the initial overhead of training these models themselves is a factor to consider in deployment.

Reference: Wang, Y., Zhang, H., et al. (2025). MaFeRw: Query Rewriting with Multi-Aspect Feedbacks for Retrieval-Augmented Large Language Models. The Thirty-Ninth AAAI Conference on Artificial Intelligence (AAAI-25).

Summary updated

BibTeX
@inproceedings{wang2025maferw,
  author = {Yujing Wang and Hainan Zhang and Liang Pang and Binghui Guo and Hongwei Zheng and Zhiming Zheng},
  title = {{MaFeRw: Query Rewriting with Multi-Aspect Feedbacks for Retrieval-Augmented Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i24.34732},
}
Figure