Cookie Preferences
We use cookies to enhance your experience, analyse site traffic, and support our marketing. You can customise your preferences or accept all cookies. See our Privacy & Cookie Policy for details.

AI & Intelligent Systems

Why Your RAG Pipeline Is Confidently Wrong and How to Catch It

AI & Intelligent Systems

7 min read

RAG was sold as the fix for hallucination: ground the model in real documents and it can only say true things. In practice it produces a more dangerous failure mode — answers that look grounded, cite a real source, and are still wrong.

The retrieval step does not guarantee relevance, and the generation step does not guarantee the retrieved text was used correctly. Both gaps need their own detection, separately.

Two failure modes, not one

Retrieval failure happens when the wrong document is surfaced but looks topically plausible; the model then answers fluently from irrelevant context. Generation failure happens when the right document is retrieved but the model subtly misstates, over-generalises or combines it incorrectly with another source.

Most teams instrument only overall answer quality, which conflates these two causes and makes it nearly impossible to know which part of the pipeline to fix.

Instrument retrieval and generation separately

Track retrieval precision against a labelled evaluation set independent of generation quality — does the system surface the right document, regardless of what it then says. Separately, score generation faithfulness: does the answer's claims actually follow from the retrieved text, checked by a dedicated grounding check rather than assumed.

This separation turns a vague 'the AI gave a wrong answer' bug report into an actionable one: a retrieval bug and a generation bug need completely different fixes.

Build the adversarial test set, not just the happy-path one

Most evaluation sets only test questions the system is expected to answer well. Add deliberately adversarial cases: questions with no good answer in the corpus, questions where two retrieved documents conflict, and questions that are topically close to a strong match but actually require a different document entirely.

A system that performs well on happy-path questions but confidently answers the adversarial set anyway is not a reliable system — it's an unreliable one that has not yet been asked the right question.

Grounded is not the same as correct. It only means the model had something real to misread.MNB AI Practice

Key actions

  • Score retrieval precision independently of generation quality
  • Run a dedicated faithfulness/grounding check on generated claims
  • Build an adversarial evaluation set, not just a happy-path one
  • Re-evaluate whenever the retrieval corpus or model version changes

Sources & further reading

  1. NIST AI Risk Management Framework

Discuss this with an architect →