AI GitHub
mxbai-rerank for ranking search candidates
Score query-document pairs with supported Mixedbread reranking checkpoints.
Key Takeaways
- A reranker reads each candidate with the query and assigns a relevance score.
- Choose the exact reranker checkpoint and use candidate texts with stable IDs.
- Take the top results from a baseline search, rerank them and compare changes on a labeled test set.
- A reranker cannot recover documents that the first stage missed.
How it works
A reranker reads each candidate with the query and assigns a relevance score. It typically runs after a cheaper retriever has reduced the candidate pool.
What you need
Choose the exact reranker checkpoint and use candidate texts with stable IDs. Verify the maximum input length for each query-document pair before comparing results.
What to try first
Take the top results from a baseline search, rerank them and compare changes on a labeled test set. Vary candidate count while holding the initial retrieval method fixed.
Include two candidates that express conflicting facts with similar wording. Evaluate which one is ranked first rather than judging by lexical overlap.
Where to look for failures
A reranker cannot recover documents that the first stage missed. Long inputs and large candidate sets can add latency, so measure the entire request.
Related Franklin pages
Save the first-stage retrieval results and reuse them for reranking tests. A shared candidate set shows whether changes come from the scoring model or from which documents reached it.
- Use a common Python interface to try different reranking implementations. rerankers for comparing relevance models
- Encode inputs for semantic search or score query-document pairs with a cross-encoder. Sentence Transformers for embeddings and reranking
For the role of the encoder in a search stack, read Franklin’s model guide. Embedding models
Project documentation
Try it for your workflow
Explore the project’s documentation for setup and usage, or save this page to a collection for later.
Read the project documentation ↗