← Latest papers
💻 computer science

Diagnosing and Repairing Factual Errors in RAG under Budget Constraints

This paper introduces D2R-RAG, a model-agnostic and resource-aware framework that enhances the reliability of Retrieval-Augmented Generation under budget constraints by diagnosing failures through interpretable signatures and adaptively selecting corrective actions within explicit latency and VRAM limits.

Original authors: Soroush Hashemifar, Havva Alizadeh Noughabi, Fattane Zarrinkalam, Ali Dehghantanha

Published 2026-06-30
📖 4 min read☕ Coffee break read

Original authors: Soroush Hashemifar, Havva Alizadeh Noughabi, Fattane Zarrinkalam, Ali Dehghantanha

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a very smart, but slightly forgetful, assistant (the AI) who is trying to answer your questions. To help them, you give them a stack of reference books (the "Retrieval" part). This system is called RAG (Retrieval-Augmented Generation).

The problem is, sometimes the assistant gets it wrong. Why?

  1. The books were wrong: They didn't find the right page in the stack.
  2. The assistant misread the books: They found the right page but wrote a story that didn't match what was actually written.

In the real world, you can't just throw infinite money or time at fixing these mistakes. You have a budget (limited time and computer memory). If you try to fix every mistake by re-reading the whole library or asking a super-expensive expert, you run out of money or time before you get an answer.

This paper introduces D2R-RAG, a new "fix-it" system designed to work within these tight budgets. Here is how it works, using simple analogies:

1. The Detective (Diagnosis)

Before trying to fix the answer, D2R-RAG acts like a quick detective. It looks at three things:

  • The question you asked.
  • The pages the assistant found.
  • The answer the assistant wrote.

It asks two simple questions:

  • "Did the assistant find the right evidence?" (If not, the problem is the search).
  • "Did the assistant write the truth based on that evidence?" (If not, the problem is the writing).

It creates a "failure signature," which is like a specific code telling the system exactly what went wrong, without needing to peek inside the assistant's brain (which is often a "black box" we can't see into).

2. The Smart Shopper (Adaptive Repair)

Once the detective identifies the problem, the system has to choose how to fix it. It has a menu of options, but each costs something different:

  • Rewrite the question: Make it clearer (Cheap, fast).
  • Re-read the books: Look at more pages or different types of books (Medium cost).
  • Call a super-expert: Use a heavy-duty tool to check the facts (Expensive, slow).

The system uses a strategy called a "Contextual Bandit." Think of this like a smart shopper who has a limited amount of cash.

  • If the shopper knows the store usually has the item on the top shelf, they grab it quickly (low cost).
  • If they know the item is usually in the back, they spend a bit more time walking there.
  • They learn from every trip: "Hey, I spent too much time on that last one; next time, I'll try a different aisle first."

The goal is to pick the cheapest fix that actually works, rather than just throwing the most expensive tool at every problem.

3. The Results (What they found)

The authors tested this on two types of tasks: checking facts (like verifying news headlines) and answering complex questions that require connecting multiple dots.

  • Better Accuracy: D2R-RAG got more answers right than systems that just guess or use a "one-size-fits-all" approach.
  • Better Efficiency: It didn't waste money. When the problem was just a bad search, it didn't pay for a super-expensive re-write. It fixed the search instead.
  • Budget Control: Even when they forced the system to be very strict with its time and memory limits, it still managed to find good answers, whereas other systems either crashed or gave up.

The Bottom Line

Think of D2R-RAG as a mechanic for AI. Instead of replacing the whole engine (which is expensive and requires fine-tuning) every time a car makes a weird noise, this mechanic listens to the noise, figures out if it's a loose belt or a bad spark plug, and uses the smallest, cheapest tool needed to fix it. This keeps the car running smoothly without draining your wallet.

The paper concludes that this "diagnose-then-repair" approach is the best way to make AI reliable when you are working with limited resources and cannot see inside the AI's internal code.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →