Skip to content
Back to the AI glossary
Workflows

Reranking

Re-sorting search results more precisely by relevance before the AI answers.

Explanation

Reranking is a second sorting step in search: from a larger set of results, a specialized model selects the truly relevant ones and puts them in the right order. In RAG systems this often improves answer quality significantly.

How it works

First, a fast search based on embeddings or keywords returns, say, 50 candidates. A reranker then scores each pair of question and text passage more precisely and assigns a relevance score. Only the top five to ten passages are passed to the language model.

Example

For the question “What warranty applies to spare parts after a repair?”, vector search finds many passages about warranties in general. The reranker recognizes the one paragraph that specifically covers repaired parts and moves it to the top.

Why it matters

A RAG system can only answer as well as the documents it finds. Reranking is often the step with the best ratio of effort to quality gain, especially for large document collections with similar wording.

Why does RAG need a reranker?

The first retrieval stage in a RAG system has to be fast and search large collections. To achieve that, the question and the documents are converted into embeddings separately, and only the vectors are compared. This is efficient but imprecise: subtle differences, negations or the exact subject of a statement get lost. As a result, passages that sound similar but do not fit often rank high.

The reranker compensates by examining only the small candidate set more closely. The first stage can therefore be set generously so nothing relevant is missed, while the reranker provides precision. In 2024, Anthropic showed that combining context-enriched chunks with reranking substantially reduces retrieval failures.

Cross-encoder vs. ColBERT: which reranking methods exist?

A cross-encoder reads the question and the text passage together and computes a relevance score. This is very accurate but compute-intensive, because every pair is scored individually, so it is applied only to a few dozen candidates. Examples include the rerank models from Cohere and open-source models such as the BGE rerankers.

ColBERT and related late-interaction methods store a separate vector for every token of a document and compare them token by token with the question at search time. This is more accurate than a single vector per passage and faster than a cross-encoder, but it needs more storage. LLMs can also be used as rerankers, which is flexible but comparatively expensive and slow.

Frequently asked questions

What is reranking?

Reranking is the renewed, more precise sorting of search results by relevance. In RAG systems it ensures that the passages that really fit are the ones passed to the language model.

How much latency does reranking add?

For a few dozen candidates, typically a few hundred milliseconds or less, depending on model and hardware. Compared with the time the LLM needs to generate an answer, this rarely matters.

Do I always need a reranker?

Not always. For small, well-structured knowledge bases, good hybrid search is often enough. When answer quality suffers because the wrong passages are retrieved, reranking is usually one of the first measures to try.

Ready to make AI actually work?

Book your free 30-minute consultation — no strings attached, fully confidential.

Book a free consultation