Optimizing Query Generation for Enhanced Document Retrieval in RAG
Hamin Koo, Minseon Kim, Sung Ju Hwang
TL;DR
This work tackles hallucinations in retrieval-augmented generation by focusing on query quality. It introduces Query Optimization using Query Expansion (QOQA), which uses a top-k query-document alignment score to iteratively refine LLM-generated rephrasings and select highly aligned queries for retrieval. The approach leverages BM25, dense embeddings, and a hybrid score to guide query optimization, and is evaluated on BEIR datasets (SciFact, Trec-Covid, FiQA), showing consistent retrieval improvements and an average accuracy gain of $1.6\%$. The findings underscore the importance of precise, alignment-aware query generation for reducing hallucinations and improving the reliability of RAG-based systems in practical applications.
Abstract
Large Language Models (LLMs) excel in various language tasks but they often generate incorrect information, a phenomenon known as "hallucinations". Retrieval-Augmented Generation (RAG) aims to mitigate this by using document retrieval for accurate responses. However, RAG still faces hallucinations due to vague queries. This study aims to improve RAG by optimizing query generation with a query-document alignment score, refining queries using LLMs for better precision and efficiency of document retrieval. Experiments have shown that our approach improves document retrieval, resulting in an average accuracy gain of 1.6%.
