Skip to content
← All concepts
Concept

Reranker

A cross-encoder model that re-scores retrieval candidates for higher precision.

Two-stage retrieval: fast recall, then precise reranking

Step 1 of 4

Vector search

A bi-encoder search over the whole index is fast but coarse. It returns a wide set, for example the top 20 chunks.

The cross-encoder is accurate but slow, so it only sees the shortlist.

Simple explanation

Vector search is fast but imprecise. A reranker reads the query and each candidate document together and scores relevance more accurately. Retrieve top-20 with vector search, rerank to top-5.

Engineering explanation

Rerankers use cross-encoders (e.g., Cohere Rerank, sentence-transformers CrossEncoder) that jointly encode query+document, producing a relevance score. This is more accurate than bi-encoder cosine similarity but too slow to run over the whole index. Two-stage retrieval: fast ANN for candidates, slow cross-encoder for the shortlist.

Example

Vector search returns 20 chunks → Cohere Rerank scores each against the query → top 5 are more relevant than the original top 5.

When to use it

Any production RAG where precision matters. Especially when vector-only search returns semantically-similar-but-irrelevant chunks.

Common misconception

Reranking is not a nice-to-have in production RAG. Without it, the top-k by cosine similarity is often wrong. Add a reranker and measure the difference on your own eval set.