Add KB Arena retrieval strategies as a custom BEIR runner#214
Open
xmpuspus wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
examples/retrieval/evaluation/custom/evaluate_kb_arena.pyshowing how to run KB Arena's nine retrieval strategies against BEIR datasets using BEIR's canonical IR metrics (NDCG, MAP, Recall, Precision).What it does
Strategy(BM25, naive vector, contextual vector, QnA pairs, knowledge graph, hybrid RRF, RAPTOR, PageIndex, rerank-vector) as a BEIRBaseSearchbackendcorpusdict into KB Arena'sDocument/Sectionmodel{query_id: {doc_id: score}}mapping thatEvaluateRetrieval.retrieveexpectsDefault run
Downloads SciFact (smallest BEIR split) and evaluates KB Arena's
BM25Strategyend-to-end with no embedding-provider or LLM keys required. The script header documents how to swap in any of the eight other strategies; vector strategies require an embedding provider per KB Arena's README.Why this matters
KB Arena's value-add over BEIR's existing dense and lexical examples is comparing architectures rather than embedding models. Wiring it up here lets BEIR users score (e.g.) RAPTOR vs PageIndex vs hybrid RRF on standard BEIR splits, with KB Arena handling the architectural-strategy differences and BEIR's evaluator providing the canonical metrics.
About KB Arena
kb-arena, archived on Zenodo (concept DOI 10.5281/zenodo.20319678)Strategy,Document, andSectiontypes plus a single retriever-lab helperHappy to iterate on naming, file location, or to expose the LLM-stub context manager as a fully public API on the KB Arena side if reviewers prefer.