AI State of the Art
SOTA/Retrieval Augmented Generation (RAG)/38 min
Section 138

Reranking: Cross-encoders and ColBERT

Listen as a podcast →

The Problem: Initial Retrieval Ranks Badly

You've done your retrieval: embeddings, vector database, maybe some BM25 (Retrieval methods). You get back 20 candidate passages. The problem? Their ordering is approximate. The most useful passage for your question might sit at position 8 instead of position 1.

A reranker takes those 20 candidates and reorders them with a costlier model that is more reliable about ordering. Result: the right passage moves to the top, and the LLM gets what helps it most, first.

It's a two-stage architecture: first a fast, coarse retrieval (20-100 candidates), then a slow, fine reranking (top 5-10).

Recall and Precision, Applied to a Result List

Both words run through this whole page, and here they name two opposing goals. They come from classification, where they are defined in Evaluation metrics; here is how they transpose to a list of search results.

  • Recall answers: out of every passage in the corpus that should have been found, how many are in my list? You improve it by casting a wider net, hence the 20 to 100 candidates of the first stage.
  • Precision answers: out of the passages in my list, how many are genuinely useful? You improve it by being selective.

The two work against each other: widening the list raises recall and hurts precision. Hence the two-step design. The first stage buys recall by accepting a lot of junk; the second buys precision back by sorting that junk, but on 50 candidates only, which is what makes it affordable.

Two-stage diagram. Stage 1, recall: the query goes through a retriever based on embeddings and vector search, producing a list of numbered candidate documents with no reliable score. Stage 2, precision: the cross-encoder scores each query-document pair and returns the reordered documents with scores 0.98, 0.91 and 0.84, which are then fed into the RAG.
The two stages described above. The first stage aims at recall: cast a wide net, fast, without worrying about order, hence the question marks next to the candidates. The second aims at precision: the cross-encoder assigns a real score to each pair, and document 27, only third after retrieval, moves to the top.Source : LocalAI (Reranker documentation)
ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT (Khattab & Zaharia, 2020)
The Fundamental Speed-Precision Tradeoff

Bi-encoder (retrieval): question and document are turned into vectors separately, then compared by cosine similarity (the angle between the two vectors, see norms and distances). Very fast, because every document was converted ahead of time, once and for all. But coarse: the two texts never meet, only their numerical summaries are compared.

Cross-encoder (reranking): question and document are handed together to the same transformer, which reads them as one block. Much slower, since the model has to run once per question-document pair. But far more reliable: the model can relate every word of the question to every word of the document.

The two-stage design takes the best of both: the bi-encoder's speed for the coarse sort, the cross-encoder's discrimination for the refinement.

Cross-Encoders: Discrimination at the Cost of Speed

A cross-encoder receives the question and the document glued end to end:

[CLS] your_question [SEP] the_document [SEP]

Those two labels are service tokens inherited from BERT (BERT): [SEP] (separator) marks the boundary between the two texts, and [CLS] (classification) is a reserved slot at the front whose output serves as a summary of the whole. It is that [CLS] output vector that a final layer reduces to a single number: the relevance score for this pair.

Why is that more reliable than a bi-encoder? Because the model sees both texts at the same time, so its reading of the document can depend on what the question asks. Example: the question is about "Python the language" and the document about "python the snake". A bi-encoder's two vectors sit close together, since both texts share the word. The cross-encoder reads "programming language" on one side and "reptile" on the other in the same pass, and assigns a low score.

Why You Can't Use It Everywhere

The price is easy to quantify. A cross-encoder produces no reusable vector: its score holds for one question-document pair, so nothing can be precomputed. On a corpus of a million documents, answering a single question would mean a million passes through the model. Whereas the bi-encoder needs one (for the question), the rest already sitting in the database.

Hence the strategy: only run the cross-encoder on the top 20 to 50 candidates from the initial retrieval. The cost then comes back down to 20-50 passes per question, which is manageable.

Common Models

Sizes are in parameters; vendor-published quality scores are left out here, for lack of a comparable protocol across models.

ModelSizeWhat you pick it for
ms-marco-MiniLM~22 millionThe historic small model, fast enough to run on an ordinary CPU, mostly for English
bge-reranker-v2-m3 (BAAI, 2024)~570 millionThe most widespread open multilingual choice in 2024-2025
mxbai-rerank-v2 (Mixedbread, 2025)0.5 and 1.5 billionOpen models built on an LLM (Qwen2.5), Apache 2.0 licence
Qwen3-Reranker (Alibaba, 2025)0.6, 4 and 8 billionOpen family (Apache 2.0), 32,000-token context, multilingual
jina-reranker-v3 (Jina AI, 2025)0.6 billionReads up to 64 documents at once together with the question (see below)
Cohere Rerank 3.5, then 4 (December 2025, Fast and Pro versions)not publishedAPI service; Rerank 4 accepts 32,000-token documents
Voyage rerank-2.5 and other servicesnot publishedServices that also accept an instruction ("favour documents less than a year old")

Two trends show in this table. First, rerankers have moved onto LLMs of a few hundred million to a few billion parameters, rather than BERT models of a few tens of millions: they are better, multilingual, accept long documents, and cost more to run. Second, the announced gaps between the best models are small: on the BEIR benchmark, the figures Jina published for its own model, Mixedbread's and Alibaba's fit within one point, and every vendor publishes a table in which it comes first. With closed services, your corpus leaves your premises on every request.

What Reranking Costs, by Reasoning Rather Than Numbers

You will find precise latency figures everywhere; they depend so much on hardware, passage length and model that they don't transfer. The reasoning does transfer: the cost of reranking is proportional to the number of candidates, since one model pass is needed per candidate, and proportional to model size.

Two practical consequences. Doubling the candidate count doubles the overhead, that is the first knob to turn when latency slips. And a small model over few candidates stays negligible next to the LLM's own generation time, whereas a large model over a hundred candidates can become the dominant cost. Measure on your own setup: that is the only figure worth having.

ColBERT: In Between the Two

ColBERT sits between the bi-encoder and the cross-encoder. Its idea: instead of summarising a whole document into one vector, produce one vector per token of the document. Same for the question. The comparison is thus pushed down to the word level, while the document vectors can still be computed in advance, hence the name late interaction.

The relevance score is computed with MaxSim (maximum similarity):

score=∑imax⁡jsim(query_tokeni, doc_tokenj)\text{score} = \sum_i \max_j \text{sim}(\text{query\_token}_i,\ \text{doc\_token}_j)

Every symbol, in words. i indexes the question's tokens, j the document's. sim is the proximity measure between two vectors (a cosine similarity). max_j means: across all the document's tokens, keep the highest value. The sigma ∑ adds those values across all the question's tokens.

So the formula reads: for each word in my question, find the word in the document that best matches it, note how well it matches, and add up those notes. A document scores well if it has something to offer for every piece of the question, not if it vaguely resembles the whole of it.

ColBERT architecture. The query goes through one BERT producing three green vectors, the documents go through another BERT producing three purple vectors. Each query vector is linked to all document vectors through a MaxSim box, and the three MaxSim boxes feed a Sum box that produces the final score.
The MaxSim computation described just above. The two BERTs run separately, which is what lets you index documents ahead of time; the fine-grained interaction is pushed all the way to the top, into the MaxSim boxes, where each question token looks for its best match in the document. Summing those best matches gives the score.Source : Weaviate (An Overview of Late Interaction Retrieval Models)

The advantages:

  • Document vectors are computed ahead of time, as with a bi-encoder: a question requires no new pass of the model over the corpus
  • The comparison happens word by word, as in a cross-encoder, not between two summaries
  • The whole thing therefore remains usable on a large corpus

The downsides:

  • Storage explodes. The arithmetic is immediate: a corpus of one million documents at 200 tokens each means 1,000,000 × 200 = 200 million vectors to store, instead of one million. At a few hundred bytes per vector, you go from a few hundred megabytes to tens of gigabytes.
  • Indexing and search get correspondingly more complex.

ColBERTv2 and RAGatouille

ColBERTv2 attacks exactly that storage problem, through residual compression: instead of storing each vector in full, you store a nearby reference vector picked from a small shared codebook, plus the deviation from that reference, encoded in very few bits. The paper reports a storage footprint reduced by 6 to 10 times at no loss of quality.

ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interaction (Santhanam et al., 2021)

The same late-interaction idea is also used to search pages read as images (ColPali, presented in RAG: principle and architecture). On the code side, the RAGatouille library makes it straightforward to use:

from ragatouille import RAGPretrainedModel

RAG = RAGPretrainedModel.from_pretrained("colbertv2.0")
RAG.index(documents, index_name="my_index")
results = RAG.search("my question", k=10)

LLM-Based Rerankers

Since a large language model can judge whether a text answers a question, why not simply ask it to rank? That idea has transformed reranking since 2023. There are three ways to go about it.

Pointwise. Give the model a (question, document) pair and ask, in essence, "does this document answer the question, yes or no?". The score is the probability it assigns to "yes." It is a cross-encoder with an LLM at its core: the Qwen3-Reranker family works this way. You keep the advantage of scoring each candidate independently, hence in parallel.

Listwise. Give the model the question and a numbered list of passages, and ask it to produce the order: "[3] > [1] > [7] > ...". The RankGPT paper (2023) showed that a general-purpose chat model used this way rivalled specialised rerankers. The advantage: the model compares candidates with one another instead of scoring each in a vacuum. The drawback: the list must fit in the context window, hence a sliding-window technique that reranks twenty passages at a time while moving up the list, and generation is slower than a plain score.

Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agents

A recent compromise. jina-reranker-v3 (2025) places the question and up to 64 documents in a single input, lets the model read them all, then reads one vector at the end of each document and compares it with the question's. Its authors call this "last but not late" interaction: as in a listwise approach, each document is read in the presence of the others, but you get one score per document in a single pass, without having the model write out a ranking.

jina-reranker-v3: Last but Not Late Interaction for Listwise Document Reranking

Rerankers that reason. The latest development comes from reasoning models: have the reranker think before scoring, by writing a short argument about the passage's relevance. Rank1 (2025) was trained on more than 600,000 such reasoning traces produced by a large model; it improves mostly on questions that require reasoning or following a precise instruction, and its reasoning can be shown to the user. The price is obvious: every candidate now costs a generation of several hundred tokens.

Rank1: Test-Time Compute for Reranking in Information Retrieval

This is the logic of test-time compute applied to ranking: more computation per question in exchange for a better answer. Whether the gain is worth the cost on your questions can only be measured on your own data.

The Full Production Chain: Three Stages

  1. The question arrives
  2. Hybrid retrieval (BM25 + dense) → top 50-100 candidates
  3. Cross-encoder reranking → top 5-10
  4. The LLM writes the answer from those

Stage 1: Hybrid Retrieval (fast)

You combine word-based search (BM25) and vector-based search (embeddings). The two miss different things, so putting them together covers more cases, the subject of Retrieval methods. This stage targets recall: the right passage should be in the list, never mind where.

Stage 2: Reranking (fine)

The cross-encoder scores each candidate and reorders them. This stage targets precision: the top of the list should actually hold the right ones.

Stage 3: Generation

The LLM writes from the top five. Two reasons ordering still matters here, when you might think the model just reads everything: the context has a size limit, so those slots had better be filled with useful material; and over a long context, models exploit what sits in the middle less reliably than what sits at either end (Long context vs RAG).

from sentence_transformers import CrossEncoder

reranker = CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")

pairs = [(query, doc) for doc in retrieved_docs]
scores = reranker.predict(pairs)
reranked = sorted(zip(retrieved_docs, scores), key=lambda x: -x[1])

What Reranking Buys You, and What Can Be Said About It

The effect of reranking is well established in its direction: given the same corpus and the same candidates, reordering with a model that reads pairs improves the ordering. Its magnitude, though, depends on the corpus, the questions and the models involved, and no general figure has any value. The chart below is one example, published by a vector-database vendor on one particular dataset: it shows the shape of the result well (reranking produces the largest jump), but its values do not transfer.

Bar chart of NDCG@10 on TREC. Lexical search alone, pinecone-sparse-v0, around 40; dense search alone, multilingual-e5-large, around 46; score fusion of the two around 52; and cascading retrieval with reranking over dense plus sparse around 65.
Four configurations measured as NDCG@10 on the TREC sets. Combining word-based and vector-based search already gains a few points, but it is adding reranking on top of the fused candidates (rightmost bar) that produces the widest jump. Caveat: these are Pinecone's measurements, on Pinecone's own models, on these specific datasets.Source : Pinecone (Introducing cascading retrieval)
NDCG, Since the Chart Uses It

NDCG stands for normalized discounted cumulative gain. The name is opaque, the idea less so; take it backwards, in three pieces.

  • Cumulative gain: each result earns points according to how useful it is (not merely "relevant or not", but possibly "very useful", "somewhat useful", "useless") and you add up the points of the top K.
  • Discounted: a point earned low in the list counts for less than a point earned high. Each rank is divided by a factor that grows with position. This encodes the fact that a reader, human or model, pays more attention to the first results.
  • Normalized: the total is divided by the total the best possible ordering of the same documents would have given. The final score therefore lives between 0 and 1, which makes two questions comparable even if one has ten good documents available and the other only one.

So NDCG@10 means: over the first ten results, how close is my ordering to the ideal ordering? It is the finest of the four usual metrics and the most apt for judging a reranker, since reranking changes nothing about what was found, only the order.

The Best Effort-to-Result Ratio

Of all the refinements to a RAG chain, reranking is the lightest to put in place: a few lines of code, an off-the-shelf model, no reindexing of the corpus. Compare that with switching embedding model, which forces you to recompute every vector, or changing the chunking, which forces a full reindex.

It is this asymmetry (small effort, real effect on result ordering) that explains how widespread it became, more than any particular quoted gain. If you do only one thing, start here.

Practical Considerations

How Many Candidates to Rerank?

  • 20-30: small cross-encoder, minimal overhead. The default choice.
  • 50-100: heavier model, finer ordering. For cases where the order really matters.
  • beyond 100: diminishing returns, for a simple reason. Reranking can only reorder what retrieval already brought back. A candidate ranked 300th by the first stage is unlikely to be the right one, and you pay to examine it anyway. Going wider only makes sense if you observe that the right passages often land past rank 100, and in that case it is the first stage that needs fixing, not the second.

Cost and Latency: Which Reranker to Choose?

The reasoning in the opening box extends simply: cost is proportional to the number of candidates and to the model's size. Sizes range from 22 million parameters to several billion, a ratio of several hundred. An 8-billion-parameter reranker does, per pair, roughly 360 times more computation than MiniLM (8 billion divided by 22 million) and needs a GPU.

FamilyExampleWhere it runsLatency for a few dozen candidatesWhen to choose it
Small cross-encoderMiniLM, bge-reranker-v2-m3CPU or small GPULowTight latency constraints, mostly English or simple multilingual corpus
Open LLM rerankerQwen3-Reranker, mxbai-rerank-v2, jina-reranker-v3Your own GPUMediumHigh quality without the corpus leaving your premises
Reranking serviceCohere Rerank 4, Voyage rerank-2.5At the providerMedium, network includedHost nothing, accept that the corpus transits
General LLM listwise, or reasoning rerankerRankGPT, Rank1GPU or APIHigh (text generation)Hard questions, low volume, need to explain the ranking

Services often offer two versions (fast and precise) for the same reason. And the most effective setting remains the one from the previous section: cut the number of candidates before changing the model.

Watch Out for the Bottleneck

Reranking can become the slowest step in the chain. If it eats most of the response time, three levers: cut the candidate count, take a smaller model, or process the pairs in parallel.

Monitor End-to-End Latency

Adding a slow step to a fast chain gets you a slow chain. Always measure reranking's effect on total response time, and adjust candidate count and model choice accordingly.

Reranking has become routine in production RAG systems. Keep in mind its structural limit, though, the one that recurs at every stage of this module: reranking fixes the order, never the absences. If the right passage was never retrieved in the first place, no reranker will conjure it up. That is why the two are measured separately, the first stage's recall, the second stage's precision (RAG evaluation).

Check your understanding0 / 6

1. The question is about Python the language, a document is about python the snake. Why does a cross-encoder tell them apart where a bi-encoder fails?

2. Why not apply the cross-encoder to the whole corpus directly, since it ranks better?

3. What is ColBERT's idea, and what price do you pay for it?

4. After reranking, the right passage still does not appear in the top five results. In which case can the reranker do nothing about it?

5. Why does the first stage cast a wide net (20 to 100 candidates) while the second keeps only 5 to 10?

6. A « listwise » reranker receives the question and twenty numbered passages, and outputs an order such as [3] > [1] > [7]. What is its advantage, and its drawback?