Replies: 2 comments
|
Thanks for opening this discussion. Adding retrieval metrics has been on our roadmap, so we welcome PRs that push us in this direction. |
0 replies
|
@potoos please go ahead and create a PR for this in our repo, we will fast follow with a review there. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The current eval framework grades generation accuracy and latency, but doesn't directly measure retrieval quality — i.e. whether the engine actually surfaced the right sources, independent of the synthesis step. Two metrics that fill this gap on top of the existing per-query pipeline:
1. NDCG@k (URL-binary) — always-on, free
Score each predicted URL list against the dataset's
metadata.urls(SimpleQA already ships this) with binary relevance and the canonical TREC NDCG@k formulation: IDCG runs over all gold URLs, so missed gold reduces the score. Addsndcg_at_5/ndcg_at_10columns next toaccuracy_scoreand the latency p50s. No new dependencies, no extra API calls.2. Recall@k (LLM-judged, UMBRELA) — opt-in library
When ground-truth URLs are unavailable or too sparse (FRAMES, internal benchmarks, etc.), grade retrieved chunks with an LLM-as-a-judge using the canonical UMBRELA
qrel_zeroshot_bingprompt + parser (Apache-2.0, castorini/umbrela, basis of the TREC 2024 RAG track). Per-query Recall@k =1if any chunk in top-k has graded relevance ≥ threshold (default 2, TREC DL convention), else0.Library only — not wired into
eval_runner.pyso cost is opt-in and providers withoutextract_chunkssupport are unaffected. Upstream UMBRELA is vendored (prompt + parser, ~50 LOC) rather than installed because the[cloud]extra pulls ~500MB of unrelated deps and requires Python ≥ 3.12, which would tighten this repo's>=3.10,<3.14support range.Implementation shape
BaseSampler.extract_chunks(raw_results)hook returning a common{url, title, description, extra_snippets, position}schema. Five providers override (you_search, exa, tavily, parallel, google/SerpAPI). The per-row CSV gains achunks_jsoncolumn the LLM judge consumes.gold_urlsthrougheval_runner.py;eval_results_analyzer.pyaggregates the new columns when present.LLM_JUDGE_MODELinconstants.py. UMBRELA's published methodology usesgpt-4o; a smaller alternative (gpt-5-mini) works for routine eval runs.)\n/ end-of-string so Wikipedia disambiguation slugs (Bug_(Breaking_Bad)) and similar parenthesised paths stop being silently truncated. Locked in by tests.Diff
Two semantic commits (URL metric, then LLM-judged library), 13 files, +1111 / -32, branched from
main:https://github.com/Nimbleway/web-search-api-evals-fork/compare/main...feat/url-ndcg-llm-recall-metrics
Tests pass (
pytest tests/test_retrieval_metrics.py), and a smokeeval_runnerrun on SimpleQAn=10populates the new columns end-to-end.Question for maintainers
Would a PR along these lines be welcome here, or would you prefer a different shape (e.g. URL-NDCG only, LLM-judge as a separate optional package, different judge default)? Happy to open a draft PR for inline review if there's interest.
All reactions