Skip to content

Silent RAG Failures

A benchmark that breaks a retrieval pipeline in the ways production systems break, at controlled severity, and grades label-free monitors on whether they notice real damage and stay quiet on harmless changes. Northeastern capstone, team of four.

Case study4 min read

The project page. Drag the slider to re-embed part of the index with another model and watch retrieval change; the numbers are real NFCorpus runs of the F1 injector.
Role
Capstone, team of four. Mine: the retrieval pipeline, embedding cache and experiment runner, the re-embedding detector and the project page, among other parts.
When
September – December 2026
Stack
Python, FAISS, sentence-transformers, BEIR, pandas, Ollama, pytest, GitHub Actions, Next.js

The problem

When a RAG system's retrieval gets worse, nothing errors. The service stays up and latency looks normal while answers get worse, and production systems have no relevance labels to track. Teams lean on drift statistics and score signals without knowing which ones catch real damage.

What I built

A benchmark that injects realistic failures (half-finished embedding upgrades, stale distractor documents, config mistakes) at 10 to 90% severity, plus harmless changes as controls, and scores 16 label-free detectors on accuracy, earliness, false alarms and cost. Tuning happens on NFCorpus; SciFact and FiQA are held out, and the code refuses them without a flag.

What happened

The benchmark runs end to end from a fresh clone in CI, and the held-out run on SciFact and FiQA is done and in the team's final report. This page covers the design and my parts; the detector results will be added once they're public in the repo.

  • 16

    label-free detectors graded

  • 100

    queries per scored window

  • 0.546

    clean nDCG@10 on SciFact (95% CI 0.496–0.595)

  • 120 s → 0 s

    second run of a setup, from the embedding cache

01

The problem

A RAG system embeds the question, finds the most similar documents in a vector index, and hands them to an LLM. If that retrieval step gets worse, nothing fails loudly. It happens in ordinary ways: an embedding model is upgraded but only part of the corpus is re-embedded, outdated documents sit next to their replacements, or a setting such as vector normalisation changes in one place and not another.

Production systems don't have relevance labels, so nobody can track nDCG on live traffic. Teams watch label-free signals instead: drift statistics such as PSI and the Kolmogorov–Smirnov test, retrieval-score signals, canary queries, an LLM judge. Our question was which of those catch real damage, how early, and how often they cry wolf.

02

How the benchmark works

We build one standard retriever (multi-qa-MiniLM-L6, title plus text truncated at 256 tokens, exact cosine search in FAISS), break it in a controlled way, and give each detector only what a production system would have: queries, embeddings and similarity scores. Relevance labels are used for one thing, measuring how much damage each condition did. A window of 100 queries counts as harmed when its nDCG@10 drop is significant under a paired bootstrap test.

Each detector is graded four ways: AUROC for separating harmful windows from clean and harmless ones, the earliest severity it catches at a 5% false-alarm rate, how often it fires on harmless changes, and cost per check. Everything is tuned on NFCorpus. SciFact and FiQA are held out, and the runner refuses them unless the final flag is passed, from frozen, tagged code.

  • F1, partial embedding upgrade: a fraction of the index re-embedded with a second model (all-MiniLM-L6 or bge-small), queries still on the first.
  • F2, stale distractors: off-topic documents from ArguAna added to the corpus.
  • F5, config mismatch: index vectors built without normalisation.
  • Harmless controls: a full re-index with another model, mixed truncation at 512 tokens, queries without normalisation, and a shift in query topics. A good detector stays quiet on these.
  • Chunking changes (F3) run only on long documents (MLDR), and query drift (F4) was left out of scope.

03

What I built

The retriever and its embedding cache. The cache key covers the model, its revision, normalisation, maximum length, the document text format and a hash of every document, so changing any setting re-embeds instead of reusing old vectors. A second run of the same setup went from 120 seconds to 0.

The experiment runner: it loops over dataset, failure, severity, seed and trial, fits each detector on a clean reference window that never overlaps the scored ones, scores the same query windows under every condition, and writes one results table. I added multiple seeds under one run ID, deeper score lists, the guard that runs held-out data only from tagged code, and a CI smoke run from a fresh clone on every pull request.

The re-embedding detector. It re-embeds a sample of stored documents with the model the system is supposed to be running and measures how far the stored vectors have moved. Re-encoding the same text moves a vector by about 1e-7 in cosine, so distances under a noise floor count as zero and a clean index scores exactly 0. By design it measures "these vectors don't come from the expected model", which a harmless full re-index with a different model also triggers, and it can't see stale documents or anything on the query side.

Later pieces: the harmless controls and the F2 distractors, a free local LLM relevance judge, a combined detector that weights the cheap score signals, a two-stage monitor that runs the expensive judge only when the cheap alarm fires, the held-out configuration, and the project page.

04

What my teammates built

This was a team of four, and the detectors and analysis are as much theirs. Alekhya Bulusu built the KS, PSI and score-based detectors, the canary queries and the default alarm thresholds, reran the baseline and the window-size analysis, and made the report figures. Jenna built the dataset loader checks, the detector evaluation metrics, the domain-classifier detectors, the severity analysis and the permutation tests. Shane built the partial-upgrade (F1) and config-mismatch (F5) injectors and the exploratory notebooks. I reviewed several of their pull requests, including the KS detector, the F1 injector, the notebooks and the severity analysis.

05

The baseline

Before breaking anything we fixed the clean numbers. Truncating documents at 256 tokens instead of 512 made no significant difference on any dataset, and a window of 100 queries is enough for the paired bootstrap to catch an nDCG@10 drop of about 0.06 in 80% of windows while staying under a 5% false-alarm rate. Windows of 25 or 50 queries only reliably catch drops of 0.10 to 0.13.

DatasetTest queriesClean nDCG@1095% bootstrap CI
NFCorpus (tuning)3230.2920.259–0.325
SciFact (held out)3000.5460.496–0.595
FiQA (held out)6480.3600.332–0.387

Exact cosine search in FAISS with multi-qa-MiniLM-L6, title plus text truncated at 256 tokens, no chunking. From the repository README.

What I'd carry forward

  1. 1Grade a monitor on harmless changes too. A detector that fires on every change notices change, not harm.
  2. 2Put everything that changes a vector into the cache key, or the cache serves stale vectors with no error.
  3. 3Hold out the evaluation data in code, not by convention, so nobody tunes on it by accident.

Get in touch

Questions about my work, a role, or a project idea. Send a message here or email me directly.

Srikarmks@gmail.com