Reranking

Reranking is a second search step in which a more precise model re-scores a shortlist of candidate results against the query, so the most relevant passages move to the top before they reach a user or a language model.

Also known as: Re-ranking, cross-encoder reranking

Related terms in this glossary

How it works

First-stage retrieval, whether keyword, vector or hybrid, is built for speed across millions of items. It returns a broad shortlist, say the top 50 or 100. A reranker then examines each candidate together with the query and assigns a new relevance score.

  • Cross-encoders read the query and passage together in one model pass, which captures relevance more accurately than comparing two separate embeddings, but costs more per item. That is why they run only on the shortlist.
  • Hosted rerank APIs such as Cohere Rerank and Voyage AI's rerankers, and open models such as the BGE reranker family, are common choices.
  • LLM rerankers ask a language model to order or score passages; flexible but slower and more costly.

Why it matters

In retrieval-augmented generation, the model can only use what lands in its context. If the right passage sits at position 23, it is effectively missing. Reranking lifts it into the top few, which improves answer quality and lets you send fewer passages, cutting tokens and latency. It is usually one of the cheapest quality gains in a RAG pipeline. The trade-off is added latency for every query, so measure the improvement with retrieval metrics such as precision at k and NDCG on your own queries before adopting it. See AI-powered search.

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:

  1. Retrieve a candidate set with hybrid search, combining keyword (BM25) and vector results from a vector database, with permission filters applied at this stage.
  2. Pass the query and each candidate passage to the reranker, which returns a relevance score.
  3. Sort by the new score and keep only the top few, or those above a score threshold.
  4. 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:

MetricWhat 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 qualityWhether better ranking improves the final answer
Added latency at high percentilesCost 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.

Questions about Reranking

Something else? Send us your question and an engineer replies with next steps.

How much latency does a reranker add?

It depends on the model size, the number of candidates, passage length and hardware. A small cross-encoder on a GPU can score dozens of passages quickly, while an LLM-based reranker over the same list is much slower. Hosted APIs add network time. Measure on your own setup at high percentiles, and tune the candidate count: reranking 30 passages instead of 100 often keeps most of the quality gain.

Can reranking help keyword search without embeddings?

Yes. A reranker only needs a list of candidates, wherever they come from. Adding a cross-encoder on top of an existing keyword search engine, such as Elasticsearch or OpenSearch with BM25, can improve result order without building a vector index. It will not find passages the keyword search missed, so if users often phrase questions differently from the documents, adding semantic retrieval is the next step.

Articles that mention Reranking

All articles

Jump to

↑↓ to move↵ to open