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.
| Dataset | Test queries | Clean nDCG@10 | 95% bootstrap CI |
|---|---|---|---|
| NFCorpus (tuning) | 323 | 0.292 | 0.259–0.325 |
| SciFact (held out) | 300 | 0.546 | 0.496–0.595 |
| FiQA (held out) | 648 | 0.360 | 0.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.