Reranking in depth
Adding a reranker to a retrieval pipeline
A reranker sits between first-stage retrieval and whatever consumes the results. A typical setup:
- Retrieve a candidate set with hybrid search, combining keyword (BM25) and vector results from a vector database, with permission filters applied at this stage.
- Pass the query and each candidate passage to the reranker, which returns a relevance score.
- Sort by the new score and keep only the top few, or those above a score threshold.
- Send the survivors to the language model or show them to the user.
Two settings matter most: how many candidates go in, and how many come out. More candidates improve the chance the right passage is present but add latency. Fewer outputs save tokens, but too few risks dropping a needed passage. Tune both on your own queries.
Example: a policy assistant that missed obvious answers
Example: an HR assistant answers employee questions from policy documents. Users complain that it misses answers that are clearly in the handbook. Investigation shows the right passage is usually retrieved, but at positions 8 to 20, while only the top 5 go to the model. The team adds a cross-encoder reranker over the top 50 candidates and keeps the best 5. On a labeled set of real employee questions, the share of questions with the correct passage in the final 5 rises noticeably, and answer quality scored by reviewers improves. Added latency is measured and stays within the assistant's response target.
Measuring retrieval and reranking
Build a set of real queries, each labeled with the passages that answer it. Then measure:
| Metric | What it tells you |
|---|
| Recall at k (first stage) | Whether the right passage is in the candidate set at all |
| Precision at k, MRR, NDCG (after reranking) | How well the reranker orders what it receives |
| End-to-end answer quality | Whether better ranking improves the final answer |
| Added latency at high percentiles | Cost to the user experience |
If first-stage recall is low, a reranker cannot help; fix chunking, embeddings or hybrid search first.
Choosing a reranker
- Hosted rerank APIs: quick to adopt, multilingual options, data leaves your environment.
- Open cross-encoders: self-hosted, controllable, need a GPU or patience on CPU for long candidate lists.
- LLM-based reranking: flexible and able to follow instructions, but slower and more costly; useful for small candidate sets or offline jobs.
For Indian-language content, check that the reranker was trained on multilingual data and test it on Hindi and mixed-language queries.
Rerankers can also enforce simple business preferences after scoring, such as preferring the latest policy version or the user's own product line, but keep such rules few and visible, so the ranking stays explainable when someone asks why a passage appeared.
Typical mistakes are reranking without permission filters already applied, using a reranker that truncates long passages so key text is never seen, and judging the change on a handful of queries. Reranking is a standard stage in semantic search and RAG. Gepton builds search pipelines in AI-powered search and knowledge management agents.