Open-Source Reproduction and Explainability Analysis of Corrective Retrieval Augmented Generation

This paper presents a fully open-source reproduction of the Corrective Retrieval Augmented Generation (CRAG) system using Wikipedia and Phi-3-mini, demonstrating comparable performance to the original while providing the first SHAP-based explainability analysis that reveals the evaluator's reliance on named entity alignment and identifies key failure modes.

Surya Vardhan Yalavarthi

Published 2026-03-18
📖 5 min read🧠 Deep dive

Imagine you are a brilliant but slightly forgetful student named LLM (Large Language Model). LLM is great at writing essays and answering questions, but sometimes it gets things wrong because it's making things up out of thin air (a problem called "hallucination").

To fix this, LLM has a study partner called RAG (Retrieval-Augmented Generation). Before answering a question, RAG runs to the library, grabs a few books, and hands them to LLM to help write the answer.

The Problem:
Sometimes, RAG grabs the wrong books. Maybe it grabs a book about "Apples" when the question is about "Apple the company." If LLM reads the wrong book, it gets confused and gives a wrong answer.

The Original Solution (CRAG):
The original researchers created a super-smart "Librarian" (called a Retrieval Evaluator) to check the books before LLM reads them.

  • If the book looks perfect, the Librarian says, "Correct!" and LLM uses it.
  • If the book is totally wrong, the Librarian says, "Incorrect!" and sends LLM to the internet (Google) to find better info.
  • If the book is okay but not great, the Librarian says, "Ambiguous!" and LLM uses both the library book and the internet.

The Catch:
The original "Librarian" and the "Internet" were locked behind paywalls. You needed a credit card for Google Search and special, expensive software to run the Librarian. This meant regular researchers couldn't test or improve the system.


What This Paper Did: The "Open-Source" Makeover

The author, Surya, decided to rebuild this entire system using only free, open-source tools, like swapping a private, paid library for a public one.

Here is the simple breakdown of their work:

1. The Swap (Reproduction)

Surya replaced the expensive parts with free alternatives:

  • The Internet: Instead of paying for Google Search, they built a clever robot that searches Wikipedia (the free online encyclopedia).
  • The Brain: Instead of using a heavy, expensive AI model, they used a smaller, free, and very smart model called Phi-3.
  • The Librarian: They kept the original "Librarian" (the T5 model) but made sure it could run on the new, free setup.

The Result: The new, free system worked almost exactly as well as the expensive, original one. It proved you don't need to spend a fortune to get smart AI results.

2. The Detective Work (Explainability)

This is the most interesting part. The researchers wanted to know: How does the Librarian actually decide if a book is good or bad?

They used a tool called SHAP (think of it as an X-ray machine for AI brains) to see what the Librarian was looking at.

The Big Discovery:
They expected the Librarian to be reading the meaning of the sentences (Semantic Understanding).

  • Example: They thought the Librarian understood that "The President of France" and "Emmanuel Macron" mean the same thing.

But the X-ray showed something else:
The Librarian is actually just a Name Matcher. It's not really reading for meaning; it's just checking if the names in the question match the names in the book.

  • If the question asks about "Henry" and the book has "Henry," the Librarian says "Correct!"
  • If the question asks about "Henry" and the book is about "Mitochondria," the Librarian says "Incorrect!"

The Metaphor:
Imagine a security guard at a club. You expect him to check your ID to see if you are a good person. But instead, he just checks if your name is on a list.

  • If your name is "John," he lets you in.
  • If your name is "Jane," he lets you in.
  • But if you are a famous actor named "Titanic" (a weird name), and the list doesn't have "Titanic," he kicks you out, even if you are a good person.

3. The Failure Modes (Where it breaks)

Because the Librarian is just a "Name Matcher," it fails in two funny ways:

  1. The "Science" Problem: The Librarian was trained mostly on questions about people (like "Who is the President?"). When asked a science question like "Why is the sky blue?", there are no specific names to match. The Librarian gets confused and says, "I don't know, let's search the internet," even if the answer is simple.
  2. The "Movie" Problem: If you ask about a movie like "Titanic," the Librarian gets confused because it doesn't recognize "Titanic" as a person's name in its training list. It rejects good answers just because the name didn't match its specific list.

The Takeaway

This paper is like a DIY guide for the AI world.

  1. It showed that you can build a top-tier AI system without paying for expensive tools.
  2. It revealed that the "smart" part of the system is actually a bit "dumb"—it's just matching names, not really understanding the world.
  3. It warned us that if we want AI to be good at science or movies, we need to teach the "Librarian" to look beyond just names.

In short: The author built a free, open-source version of a smart AI helper, and then used an X-ray to show us that the helper is actually just a very literal name-checker, not a deep thinker. This helps us understand how to make the next generation of AI smarter.

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 →