Re-ranking is the re-ordering of retrieved documents from [[Lexical Search]] or [[Semantic Search]] based on their relevance to the query, typicall done by a [[Cross-encoder]].
Once the top `k` documents are retrieved, use the **original query** for reranking the results.
[[Reranking Methods]]
After retrieving relevant docs by text similarity, either by measuring nearest neighbors with [[Dense Vectors ("Embeddings")]] or [[Sparse Vectors ("Embeddings")]]—the initial step done by a [[Bi-encoder]] and lexical similarity scorer like [[Okapi BM25]], respectively, in [[Hybrid Search]]—there are a few ways to re-calculate relevancy, including one of the following or a combination thereof:
- Document Features:
- click-through rate
- dwell time
- document quality
- redundancy
- popularity
- User Context:
- location
- previous searches
- preferences
- Company strategic priorities
- Query properties:
- language
- entities named
- user intent
- [[monoT5]] (performance)
- [[TILDEV2]] (efficiency)
- [[Learning to Rank (LTR)]]
[Searching for Best Practices in Retrieval-Augmented Generation](https://arxiv.org/abs/2407.01219) recommends hybrid (semantic + lexical) scoring or "weighting" sparse vs "dense" retrieval like this:
```
0.3 x (TF-IDF + BM25)
+
0.7 x (Dense Vector Similarity)
```