Abstract
One of the inherent limitations of large language models (LLMs) is their propensity to generate hallucinated content, as the accuracy of generated texts cannot be solely guaranteed by the parametric knowledge they encapsulate. While retrieval-augmented generation (RAG) offers a practical complement to LLMs, its reliance on the relevance of retrieved documents raises concerns about how the model behaves when retrieval fails. In this paper, we propose a novel approach called Iterative Prompt Refining for Retrieval Augmented Generation (IPRAG) for enhancing the robustness of text generation. Our proposed approach comprises two key components: (1) a multi-dimensional evaluator designed to assess the overall quality of retrieved documents, and (2) an iteratively prompt refinement method that optimizes the generator’s prompts. In contrast to existing approaches, our IPRAG framework can be seamlessly integrated with various RAG-based methods, enabling a more comprehensive evaluation of their performance. The experiments conducted on public datasets covering short- and long-form generation tasks demonstrate that IPRAG can significantly enhance the performance of RAG-based approaches, thereby improving the quality and reliability of generated texts.
Introduction
Retrieval-Augmented Generation (RAG) has become the gold standard for grounding Large Language Models (LLMs) in factual data. By fetching relevant documents from an external corpus, we can theoretically stop models from "hallucinating" and keep them updated with the latest information.
However, RAG has a "garbage in, garbage out" problem. If the retriever returns irrelevant or noisy documents, the LLM often gets confused, leading to even more sophisticated hallucinations. Standard RAG systems are often "naive": they take whatever the retriever provides and incorporate it into the prompt without deep evaluation. If the retriever brings back a document that is only tangentially related or contains conflicting information, the generator struggles to discern the truth.
The IPRAG Framework
IPRAG introduces a two-stage framework to handle retrieved information more intelligently by treating prompt engineering as an iterative, learnable process.
Multi-dimensional Evaluator
Instead of a simple binary relevance check, IPRAG uses a backbone model (Flan-T5-Large) to score documents across 10 different metrics, including Directness, Factuality, Objectivity, and Creativity. This provides a granular "confidence score" for each piece of retrieved knowledge, allowing the model to distinguish between a document that is "grammatically correct but irrelevant" and one that is "factual but poorly formatted."
Iterative Prompt Refinement
This component uses a smaller model (DeBERTa) as a Prompter. Instead of using static text, it generates continuous virtual tokens—mathematical representations that act as a "catalyst" to steer the generator toward the most relevant parts of the retrieved text. The authors found that modeling prompts as vectors is more effective than using discrete words, as it captures subtle nuances in the context.
The Stopper Module
To prevent infinite loops and maintain efficiency, IPRAG includes a Recurrent Neural Network (RNN)-based "Stopper." It monitors the refinement process and decides when the accumulated evidence is sufficient to answer the query or if the system should trigger a web search.
Experimental Results
The authors evaluated IPRAG on two primary benchmarks: PopQA (short-form question answering) and Biography (long-form factual generation). Performance was measured using Accuracy for PopQA and FactScore for the Biography dataset.
- PopQA (Short-form): IPRAG achieved an accuracy of 57.9%. For context, LLaMA2-7B without RAG scored only 14.9%, and standard RAG scored 38.3%. It even outperformed the more complex CRAG (approx. 48%).
- Biography (Long-form): IPRAG reached a FactScore of 88.9%, significantly higher than Alpaca-13B with RAG (approx. 78%) and ChatGPT (approx. 72%).
- Ablation Success: When the iterative refinement module was removed, performance dropped significantly (from 57.9% to 42.6% on PopQA), proving that the iterative "tuning" of the prompt is critical to the system's success.
Discussion and Limitations
IPRAG demonstrates that robust RAG doesn't require massive overhead; the evaluation and refinement components are much smaller than the generator (LLaMA2-7B). However, the system currently has a few hurdles:
- Iteration Limit: The system is capped at 10 iterations to maintain efficiency, which may limit performance on complex multi-step reasoning.
- Computational Latency: Iterative refinement takes more time than a single-shot RAG pass, potentially increasing "time-to-first-token."
- Prompter Scale: There appears to be a "minimum intelligence" required for effective prompt refinement; while BERT-small worked well, smaller versions failed.
Conclusion
IPRAG offers a novel approach to enhancing the robustness of text generation by optimizing the generator's prompts through iterative refinement and multi-dimensional evaluation. The framework can be seamlessly integrated with various RAG-based methods, significantly improving the quality and reliability of generated texts across both short- and long-form tasks.
Paper Citation: Zhu, J., Chen, Z.Z., Huang, C.Q., et al. (2025). IPRAG: Iterative Prompt Refining for Retrieval Augmented Generation. Data Intelligence, Vol.
Summary updated