Evaluate a retriever¶
muscari eval-retriever evaluates any Sentence Transformers SparseEncoder: a model saved by examples/train_retriever, an untrained SAE head (--sae), or a published sparse retriever. examples/train_retriever runs the same evaluation with the options prefixed --eval-.
muscari eval-retriever --model runs/ruri-v3-30m-retriever-trial/model \
--benchmark jqara --split test \
--retrieval mteb/MIRACLJaRetrievalLite mteb/JaCWIRRetrievalLite \
--caps full 64/256 64/128 64/64 --out runs/ruri-v3-30m-retriever-trial/eval.json
- Reranking ranks each query's own candidates. For JQaRA a document is
"{title} {text}", as in the benchmark's own evaluator (--without-titledrops the title); all queries of the split are used unless--queriesdraws a sample. Thedevsplit serves for choosing settings,testfor the final numbers. - Retrieval ranks a whole corpus in the MTEB layout (configurations
corpus,queries,qrels, or a directory with those three.jsonlfiles) and reports nDCG@10, MRR@10 and recall@100. A set whose id column is named_idis read as well. The corpus is streamed through the encoder and merged into a running top-100 per query, so neither the corpus vectors nor the full score matrix are kept. --caps QUERY/DOCUMENTkeeps the largest weights of each vector at inference time;fullkeeps them all. The example uses the grid of the SPARSEUP paper: queries capped at 64 terms, documents at 64, 128, 256 or not at all. Every metric comes with the active dimensions per query and per document and the FLOPS,sum_j p_q(j) p_d(j).
Every result also holds the value of each query, keyed by its id. A published model whose modules are not part of Sentence Transformers needs --trust-remote-code, which runs code from its repository; read that code first. A local directory saved by these scripts loads without it, unless it contains Python files.
muscari compare-runs compares two arms on the same queries. An arm may have several result files, for example one per training seed. The script reports both means, the mean of every run and the spread between the runs of an arm, the difference, a 95% bootstrap interval and the p-value of a paired sign-flip randomization test. The interval resamples the queries and, for an arm with more than one run, its runs, so it also covers the variation between seeds; with three seeds that part is coarse. --resample queries keeps the runs fixed.