Reranking is the stage in a retrieval system in which candidate documents returned by an initial search are re-scored for relevance to the query and reordered. The initial search uses fast but coarse methods such as vector similarity or keyword matching to collect many candidates, and reranking applies a more precise and expensive model, called a reranker, to evaluate a smaller set carefully. Cross-encoder models that take the query and a document together and output a relevance score are widely used.
In RAG systems, reranking serves as the final step for selecting the documents passed to the LLM, preventing irrelevant documents from entering the context and degrading answers. Commercial and open-source rerankers are available, such as Cohere Rerank and the reranking models in NVIDIA NeMo Retriever.