Benchmarks/Evals
Golden-set evals in CI: catching retrieval regressions
Can a small golden set in CI catch retrieval regressions?
3 of 4injected regressions caught
Short answer: A 30-question golden set gated in pytest flagged 3 of 4 injected regressions. A hit@1-only gate would have missed one that cut hit@5 from 0.933 to 0.800.
- hit@1
- hit@5
- MRR
What the numbers say
- Gate on several metrics: shrinking chunks to 200 characters raised hit@1 but dropped hit@5 by 13.3 points.
- The change that passed (chunks of 3,000) stayed inside the tolerance.
- No model or API calls: a full eval runs in seconds on CPU.
Results (change vs baseline, in points)
| Baseline | 0.367 | 0.933 | 0.583 | pass |
| chunk size 800 to 200 | 0.500 (+13.3) | 0.800 (-13.3) | 0.628 (+4.5) | fail (hit@5) |
| chunk size 800 to 3000 | 0.367 (0.0) | 0.900 (-3.3) | 0.601 (+1.8) | pass |
| heading prefix off | 0.300 (-6.7) | 0.867 (-6.7) | 0.513 (-7.0) | fail (all 3) |
| lowercase off | 0.400 (+3.3) | 0.733 (-20.0) | 0.553 (-3.0) | fail (hit@5) |
Setup
Python 3.12.14, pytest 9.1.1, stdlib-only BM25 retriever (no model, no API calls). Corpus: FastAPI English docs (151 Markdown files). Golden set: 30 hand-written questions, each mapped to one expected doc. Runner CPU only; a full eval takes about 0.2 s. Scripts and raw output are in the Experiment files box.