Optimization of RAG multi query rewrite generation strategy based on markov decision process
Junwen Yang, Yanci Zhou, Yijin Li, Guohua Zhu · 2025
The Large Language Model (LLM) has some limitations in dealing with illusion problems, acquiring the latest knowledge, and dealing with complex tasks. Retrieval Enhanced Generation (RAG) combines retrieval based and generation based models, utilizing massive external data to assist the LLM in generating more informative, accurate, and contextually relevant responses. Query rewriting solves the above problem by generating new retrieval queries from the user's original queries to obtain external knowledge. The RAG framework MQRF-RAG, based on multiple query rewrites, constructs four different styles of query problems, enabling it to obtain more comprehensive and accurate retrieval documents. Based on Markov decision process optimization rewriter and lightweight prompt adaptive rewriting strategy selection, it better handles complex tasks. The test results show that MQRF-RAG outperforms existing rewriting methods in document retrieval, and the retrieved documents provide accurate external knowledge for the response model, significantly improving its response performance.