Reranking is a retrieval stage in which a system takes an initial candidate set of retrieved documents or chunks and reorders them using a stronger scoring model, called a reranker, to improve relevance before passing context to a language model. In retrieval-augmented generation (RAG), reranking is used to increase the probability that the final context contains the most answer-supporting evidence.
What is Reranking (RAG Reranker)?
Many RAG pipelines use a fast retriever, such as embedding-based vector search or BM25 keyword search, to fetch top-k candidates. These first-stage retrievers are optimized for speed and scale, but their ranking can be imperfect, especially for complex queries, long documents, or domain-specific language.
A reranker performs a second-stage scoring step over the candidate set. Commonly, it uses a cross-encoder model that reads the query and each candidate passage together and outputs a relevance score. Because the cross-encoder sees both texts jointly, it can model fine-grained interactions, such as whether a passage actually answers the question, not just whether it is semantically similar. The reranker then sorts candidates by this score and returns the top-n passages to include in the LLM prompt.
Reranking improves precision of the context, which can reduce hallucinations and improve citation quality. The tradeoff is extra latency and cost, since reranking requires scoring multiple candidates per query.
Where it’s used and why it matters
Reranking is used in enterprise search, customer support RAG, legal and compliance assistants, and technical documentation copilots. It matters because the generator can only be grounded in what it receives. If the retrieved context is noisy or misses key facts, the LLM may answer incorrectly. Rerankers are a practical way to improve retrieval quality without changing the underlying knowledge base.
Types
- Cross-encoder rerankers: highest accuracy, highest cost.
- Bi-encoder rerankers: lighter models that approximate cross-encoder behavior.
- LLM-as-reranker: uses an LLM to score candidates with a rubric.
FAQs
- How is reranking different from retrieval?
Retrieval finds candidates quickly. Reranking reorders them using a stronger relevance model. - How many candidates should be reranked?
Common ranges are 20 to 200, depending on latency and quality needs. - Does reranking reduce hallucinations?
It can, by improving context precision, but you still need citation and verification controls. - Can I use an LLM as a reranker?
Yes, but it can be expensive and less consistent than trained reranker models.