Reranking strategies
There are two common approaches for reranking search results from multiple sources.- Score-based: Calculate final relevance scores from the individual search algorithm scores. Examples: Reciprocal Rank Fusion (the default in LanceDB), and weighted linear combination of semantic & keyword-based search scores.
- Relevance-based: Discards the existing scores and calculates the relevance of each search result-query pair. Example: Cross Encoder models
If you call
.rerank() on a hybrid query without passing a reranker, LanceDB defaults to
RRFReranker() — a score-based reranker that uses Reciprocal Rank Fusion. This is the
score-based path most readers encounter first; LinearCombinationReranker is an alternative
score-based strategy you opt into explicitly._relevance_score. Pass return_score="all" when a reranker
supports it, and you also need the original vector or FTS scores for debugging.
Evaluation code can rely on returned rows being ordered by descending _relevance_score. Empty
reranked result sets still include the _relevance_score column.
The hybrid rerank(...) method also accepts a normalize argument that controls how the raw
vector and FTS scores are made comparable before reranking:
normalize="score"(the default) — normalizes the raw vector and FTS scores directly.normalize="rank"— converts each result list to ranks first, then normalizes.
LinearCombinationReranker), so
when you evaluate score-based strategies, treat normalize as a tunable hyperparameter
alongside the reranker itself.
Even though there may many more strategies for reranking, there are no “universally best”
ones that work well for all cases, because they be dataset or application specific.
Evaluating whether a reranking strategy is a good one, is also a challenge. In the next
section, we discuss an example evaluation of different reranking strategies on a sample dataset.