Reranking

Authors 6 articles 68 min total read
Definition
Reranking is the second stage of a two-stage retrieval pipeline: a fast retriever returns a candidate set of documents for recall, then a slower, more accurate model — typically a cross-encoder transformer — rescores them and returns the top results for precision.
Also called: rerank, re-ranking, second-stage retrieval

What reranking is

If you have ever used a RAG-powered chatbot — a retrieval-augmented generation system that grounds a language model in your own documents — or an enterprise search tool, and wondered why the most relevant document showed up third instead of first, reranking is the missing piece. Vector search and keyword search are good at fishing the right answer out of millions of documents, but they are mediocre at deciding which of the top fifty is actually best. Reranking exists to close that gap before the answer reaches the user — or the language model writing the answer.

The mechanics are simple to picture. A retrieval pipeline runs in two stages. Stage one is fast and cheap: a vector search, a BM25 keyword search, or a hybrid of both pulls back a candidate set — usually the top fifty to two hundred documents. This stage is tuned for recall, meaning it tries to make sure the right answer is somewhere in the pile. Stage two is the reranker. It looks at the query and each candidate document together as a pair, scores how well they match, and reorders them. The top five to twenty go forward to the language model or the user.

The reason reranking works comes down to how the model reads the data. Standard vector search uses a bi-encoder: it compresses the query into one vector, compresses each document into another, and compares them with cosine similarity. Fast, but the query and document never meet inside the model. A cross-encoder — the architecture used by almost every reranker — feeds the query and document into a transformer together, letting self-attention compare every query word against every document word at every layer. According to Sentence Transformers Docs, that joint encoding is what gives cross-encoders their precision edge: the model sees term interactions a bi-encoder cannot.

This pattern is not new. According to arXiv, the foundational paper Passage Re-ranking with BERT by Nogueira and Cho, published in January 2019, showed that a BERT cross-encoder reranker delivered a sizeable jump on MS MARCO — a standard passage-ranking benchmark — over the previous state of the art. That result is the reason reranking is now a default layer in production retrieval systems.

A reranker sharpens precision on what retrieval already found; it cannot rescue a document that never made the list. · More AI cheat sheets
  • Reranking is a precision pass between retrieval and the LLM: it reorders candidates, it never recovers documents the first retrieval missed.
  • Open-weight rerankers now rival closed APIs — a 4B open model already leads the Agentset ELO board — but licence terms matter as much as the score, since some ship CC-BY-NC and quietly block commercial use.
  • Cost scales with candidate count and token length, not with traffic, so the same architecture that sharpens precision on a shortlist becomes a latency wall past a certain scale.
  • Cross-encoders trained on general benchmarks like MS-MARCO can drift on legal, financial, and argument-heavy text — verify on your own domain, not the leaderboard.

How reranking is used in practice

Most product managers and developers encounter reranking inside a RAG pipeline. The chatbot is grounded in a knowledge base — support tickets, product docs, internal wikis. A user asks a question. Vector search returns the fifty most semantically similar chunks. The reranker rescores those fifty using a cross-encoder hosted by Cohere, Voyage, Jina, or run locally with an open-weight model like BGE or MixedBread. The top five chunks land in the prompt, and the model writes an answer using only the highest-precision context.

The same pattern shows up in code search inside tools like Cursor or Claude Code, in legal e-discovery, in customer support deflection, and in recommendation systems. Anywhere precision at the top of the list matters more than raw retrieval speed, a reranker is doing work between the index and the user.

Start with a hosted reranker — Cohere Rerank or Voyage rerank — before you self-host. The hosted versions are tuned, well-documented, and let you measure whether reranking actually helps your data before you invest in serving infrastructure. If it moves your offline NDCG, then optimize for cost and latency.

The reranking reading path: from mechanism to market

Start with what reranking is and how cross-encoders rescore retrieved documents — the shortest path to the mechanism every later article assumes: a second, heavier model reading each query-document pair together instead of separately. Then read the prerequisites behind cross-encoders, bi-encoders, and listwise scoring in the same sitting — it maps the three reasoning shapes a reranker can take, which decides how much latency you are actually buying. Before you wire one into a pipeline, the hard technical limits of cross-encoder reranking is worth the ten minutes: latency scales quadratically with token length, and relevance learned on general benchmarks drifts on specialized domains.

When you are ready to add one, the integration guide for Cohere Rerank-4-Pro, Voyage Rerank-2.5, and Zerank-2 compares the managed APIs against self-hosting and flags the licence restriction on one of them. For where the market moved since, the open-vs-closed reranker race on the 2026 Agentset leaderboard tracks how fast open-weight models closed the quality gap. Close with the ethical cost of outsourcing search ranking to a closed API — if a vendor’s scoring decides what your users see, read it before the contract renews, not after.

MAX asks: 'My reranker scores every candidate the same way it did in the demo — why is production three times slower?' MONA answers: 'A cross-encoder reads the whole pair every time. Cost rises with candidates and token length, not with your traffic.' — comic dialog.
A reranker's cost model is architectural, not a scaling problem you can patch.

How reranking differs from hybrid search and contextual retrieval

Two neighbours get folded into “reranking” in planning docs, and the confusion changes which fix a team reaches for.

  • Reranking is not hybrid search. Hybrid search runs before reranking and decides what gets recalled — fusing dense and sparse retrieval so relevant documents make the candidate list at all. Reranking never widens that list; it only reorders what hybrid search already found. A team that adds a reranker to fix a recall problem is solving the wrong stage.
  • Reranking is not contextual retrieval. Contextual retrieval acts before indexing, prepending context to a chunk so it is findable in the first place. Reranking acts after retrieval, on chunks that were already found. Fixing missing context with a heavier reranker treats the symptom one stage too late.

When reranking fits — and when it doesn't

ScenarioUseAvoid
RAG chatbot grounded in a knowledge base where wrong context produces wrong answers✅
Sub-100ms latency budget on every query and recall is already excellent❌
Heterogeneous corpus (docs, tickets, code) where vector similarity alone misranks results✅
Tiny corpus (fewer than a few hundred documents) where the retriever already returns near-perfect order❌
Long-document search where queries hit different sections than retrieval keys✅
Cost-sensitive workload with millions of low-stakes queries per day❌

Common questions about reranking

Q: Should I use a hosted reranking API or self-host an open-weight model? A: Self-hosting BGE Reranker v2-m3 or mxbai-rerank-large-v2 only pays off once you have measured retrieval quality and have the serving budget to run it; otherwise a managed API is the faster path. The integration guide compares both.

Q: Are open-weight rerankers now as good as Cohere or Voyage? A: On the Agentset leaderboard, yes — a 4B open-weight reranker now leads the ELO ranking ahead of Cohere’s flagship, and the absolute quality gap on nDCG@10 has closed too. The 2026 leaderboard race tracks the shift.

Q: Does a reranker’s licence matter if I only call it through a hosted API? A: Yes — hosted access does not erase the underlying licence. Zerank-2 ships under a CC-BY-NC licence that blocks commercial use even through a paid endpoint, exactly the kind of fine print outsourced ranking decisions hide from procurement.

Q: Why does a reranker that scored well in benchmarks misrank my legal or financial documents? A: Most cross-encoders are trained on MS-MARCO-style web queries, and that relevance judgment drifts on legal, financial, and argument-heavy text with a different notion of “relevant.” The hard limits of cross-encoder reranking covers this wall alongside latency.

Part of the retrieval-augmented generation theme · closest neighbour: hybrid search. Coming to RAG pipelines from classical software engineering? Start with the story: Debugging RAG Failures: Why Developers Need a New Diagnostic Model.

Sources

1

Understand the Fundamentals

Reranking sits between fast initial retrieval and the LLM, scoring each candidate document against the query with far more precision. Understanding why this two-stage design beats single-stage search is the foundation.

2

Build with Reranking

Adding a reranker is one of the highest-leverage changes you can make to a RAG pipeline. These guides walk through API integration, latency budgeting, and trade-offs between hosted and self-hosted rerankers.

4

Risks and Considerations

Outsourcing ranking decisions to a third-party model means trusting opaque scoring on user-facing results. Consider licensing, data flow, vendor lock-in, and what happens when the API behind your search changes overnight.