Skip to content
Cyber Science Lab

Diagnosing and Repairing Factual Errors in RAG under Budget Constraints

Retrieval-Augmented Generation (RAG) improves the factuality of large language models by grounding responses in external evidence, yet real-world deployments remain fragile: failures often stem from missing or weakly relevant retrieved evidence, and from generation that does not faithfully reflect the retrieved context. This paper proposes D2R-RAG (Diagnose-to-Repair RAG), a model-agnostic and resource-aware framework that combines lightweight failure diagnosis with adaptive repair. D2R-RAG derives interpretable failure signatures from observable signals in the query, retrieved evidence, and generated response, then selects from a small set of corrective actions under explicit latency and VRAM constraints. Experiments on the FEVER and HotpotQA benchmarks show that D2R-RAG improves reliability over recent baselines and achieves better accuracy-efficiency trade-offs across multiple compute budgets.