Rerankers and late interaction: cross-encoders, ColBERT, LLM rerankers

The second stage of retrieval: cross-encoders, how they are trained, how deep to rerank and how to evaluate it, what the scores mean, LLM rerankers, late interaction (ColBERT, PLAID) and learned sparse retrieval (SPLADE). Measured on the topic's SciFact running example on an Apple M1 Pro; published results kept apart. A child of Topic: rag-and-retrieval. Data as of October 2026. Reading: 34 min, plus 8 in closed details.

The idea in one screen

A first stage must score every document, so it summarises each one before the query exists; a reranker spends real compute on only the top K by reading query and document together. Late interaction and learned sparse vectors are the middle points: they keep more of the document, still precomputed.

Fig. 1: the more a scorer lets the query meet the document, the less it can precompute. Four scorers side by side; orange is the query and where it meets the document, white is what is stored before any query exists.

  1. Bi-encoder: apart, then one dot product. The abstract is encoded on its own, offline, into 1 vector (4,096 bytes for Qwen3-Embedding's 1,024 float32 numbers); the claim is encoded on its own at query time; per candidate they meet in 1 dot product. SciFact nDCG@10: 0.700 alone.
  2. Learned sparse (SPLADE): weighted words. A model writes a weight for about 239 vocabulary terms per abstract, kept in an inverted index (bars: the 20 heaviest terms of a real abstract, section 10; purple ones are not in its text). A candidate's score is a sum over the terms it shares with the query. 0.708 alone (in-domain, section 10).
  3. Late interaction (ColBERT): one vector per token. Each abstract stores 236 token vectors of 96 numbers, 45,245 bytes; each query token finds its best document token (MaxSim, about 1.4 MFLOP per candidate). 0.743 alone, 0.758 reranking. Which token matches which is drawn schematically here; Fig. 4 in section 8 has the real matches.
  4. Cross-encoder: one pass over both. Query and document go through every layer together (glass plates), so every query token reads every document token. Nothing is stored; each candidate costs a full forward pass, 8.9 GFLOP (MiniLM) to 416 (Qwen3-Reranker). 0.782 reranking the hybrid top 20.
  5. The trade. All four, with storage per abstract drawn to scale as the white blocks at the back (4,096, about 1,910, 45,245 and 0 bytes). Left: more precomputed, cheaper per candidate, can scan the corpus. Right: more query-document interaction, dearer, top K only.

Numbers are SciFact (5,183 abstracts, 300 test claims), measured here except the SPLADE-style row, which the Retrieval pipeline page measured on the same data. Tokens and query terms in the figure are schematic; the sparse weights are real. The idea of drawing scorers by where interaction happens is the ColBERT paper's Figure 2 (Khattab and Zaharia, 2020), redrawn.

You need: how a bi-encoder (embedding model) is trained and pooled (Embedding models), BM25 and hybrid fusion (The retrieval pipeline), and IVF and quantisation for PLAID (Vector indexes). Page-image late interaction (ColPali) is on Document ingestion and multimodal retrieval; judged answer metrics on RAG and retrieval evaluation; production latency budgets on RAG in production; the parent Topic: rag-and-retrieval places reranking in the whole pipeline (its sections 2 to 4).

Reranker
a second, slower model that re-orders the first stage's top K (10 to 100) before the top k (3 to 10) go to the LLM.
Cross-encoder
one transformer pass over [CLS] query [SEP] document [SEP], one relevance score out.
Late interaction
one stored vector per document token, scored against the query's token vectors with MaxSim.
Learned sparse
a model writes a weight for each vocabulary term (plus expansion terms the text lacks), searched with an inverted index.
nDCG@10
normalised discounted cumulative gain over the top 10: 1.0 when the relevant abstract is first, about 0.63 when second, 0 when missing. Most SciFact claims have one relevant abstract, so it mostly measures how high that abstract sits.
Recall@K
the share of relevant abstracts inside the first stage's top K: the ceiling of any reranker.
How to read the numbers
measured here: run on an Apple M1 Pro (16 GB, shared with other jobs) on the running example, script in src/scripts; published: a paper, model card or vendor page, dated, vendor or independent; derived: computed with the formula shown. Quality numbers are deterministic and transfer to any machine running the same model; milliseconds are this laptop's, and only their ratios transfer. SciFact (BEIR): 5,183 abstracts, 300 test claims, binary labels.

1. Why a second stage

A first stage looks at every document for every query, so it can only afford a cheap comparison. A bi-encoder encodes query and document separately: documents once, offline; a query costs one pass plus N dot products. Its weakness is the same fact: the document vector was fixed before the query existed, so about a thousand numbers must summarise everything the document might be asked. BM25 is cheaper still and only counts shared words. A cross-encoder puts query and document in one input, so every query token attends to every document token in every layer: it sees "MDA5" in the claim next to "RIG-I, MDA5, and LGP2" in the abstract, rather than two summaries. Nothing can be precomputed, so it runs only on the top K. Fig. 2 follows one real pair both ways.

Fig. 2: the bi-encoder ranks the right abstract 7th; reading the pair together puts it 1st.

  1. Two separate texts. Claim 1180 (front, orange) and the abstract that supports it (back; its first 48 tokens drawn).
  2. Offline, once per corpus. The abstract goes through the encoder (glass plate) on its own and is summarised into one vector of 1,024 numbers (Qwen3-Embedding keeps the final state of the last token), stored with the other 5,183 before any query exists.
  3. At query time. The claim goes through the same encoder on its own: one model pass per query, one more vector.
  4. One dot product. Two unit vectors meet once: cosine 0.572. The model never saw the two texts together; work per candidate is one dot product of 1,024 numbers.
  5. Ranked by cosine. The claim's top 10 by cosine: the relevant abstract (green) ranks 7; five near-miss abstracts about RIG-I and MDA5 score higher.

Claim 1180 of the SciFact test set and its relevant abstract (PubMed 31272411). Bi-encoder: Qwen3-Embedding-0.6B vectors stored by the setup, cosine 0.572, rank 7 among that claim's top 10. Cross-encoder: ms-marco-MiniLM-L6-v2 on CPU, 231 tokens, score 5.68 (rank 1 of the same 10); streams are its real last-layer attention (mean of 12 heads) from each claim token to its strongest abstract tokens, final [SEP] excluded. Token blocks are tokens, not their values; the stored vectors are drawn empty because their numbers are not shown. measured here (e_ce_manual.py)

What it costs

Reranking all 5,183 abstracts for one claim would take 22 s with the 22 M MiniLM cross-encoder and 17 minutes with Qwen3-Reranker-0.6B. That is why K is small.

Per query, SciFact, this laptop (MPS)Model passesTimeSource
Bi-encoder: encode the claim (Qwen3-Embedding-0.6B) + exact search over 5,183 vectors151 ms + under 1 msmeasured here (setup, query p50)
Cross-encoder MiniLM-L6 on the top 3030157 msmeasured here, one batch of 30 (e_time.py)
bge-reranker-v2-m3 on the top 30302,442 msmeasured here
Qwen3-Reranker-0.6B on the top 30307,499 msmeasured here
MiniLM-L6 on all 5,183 abstracts5,18322 sderived: 5,183 / 236.8 pairs/s
Qwen3-Reranker-0.6B on all 5,183 abstracts5,18317 minderived: 5,183 / 5.0 pairs/s
The root page timed the same rerankers (agreement check)

The root's Pipeline lab timed the same models on 40 other claims (p50): MiniLM 155 ms at K = 30 and 590 ms at K = 100, bge-reranker-v2-m3 2,179 ms and Qwen3-Reranker 6,618 ms at K = 30. The K = 100 MiniLM batch varied most between repeats here (946, 994, 736 ms per-repeat medians).

The cost of one pair is close to a formula: a forward pass costs about

FLOP per pair ≈ 2 × (parameters outside the embedding table) × tokens  (+ an attention term in tokens²)

A SciFact pair is about 354 tokens for MiniLM: 8.9 GFLOP. Qwen3-Reranker also reads its chat template (425 tokens) through 0.44 B non-embedding parameters: 416 GFLOP per pair, 47 times more. Measured pairs per second give an achieved 2.1, 3.7 and 2.1 TFLOP/s for the three models on this GPU (third-party estimates put the M1 Pro 16-core GPU's float32 peak at about 5.2 TFLOP/s; Apple does not publish it). Divide by your hardware's achieved FLOP/s to estimate rerank time anywhere; the Depth chooser tab does it for every reranker and K. measured here (e_tokens.py)

Predict: you rerank K = 50 candidates of about 400 tokens with a 0.6 B reranker on a GPU that sustains 200 TFLOP/s. Roughly how long?

2. Cross-encoders

A BERT-style cross-encoder takes one sequence, [CLS] query [SEP] document [SEP], with a segment id of 0 on the query and 1 on the document, runs the encoder (6 layers for MiniLM-L6, 24 for bge-reranker-v2-m3), and maps the final [CLS] vector through dense, tanh and one linear layer to one number, the relevance logit (unbounded; higher is more relevant). This is the 2019 recipe of Nogueira and Cho ("the [CLS] vector as input to a single layer neural network", query cut to 64 tokens, pair to 512). Reranking BM25's top 1,000 on MS MARCO, it moved dev MRR@10 from 16.7 (BM25) to 36.5 (BERT Large) (Table 1; published, independent academic, 2019).

Same call, different numbers. sentence-transformers' CrossEncoder.predict applies the activation the model's config names: ms-marco-MiniLM-L6-v2 sets Identity, so it returns raw logits (here from -11.5 to 10.1); bge-reranker-v2-m3 names none and has one label, so the library applies Sigmoid and returns 0 to 1; a decoder LLM such as Qwen3-Reranker returns logit("yes") - logit("no") at the last position (section 7). Three scales from one function: never compare raw scores across models (section 6). predict also sorts pairs by length before batching, so measured pairs per second depend on it.

What MiniLM reads for claim 1180: one sequence, the claim in segment 0

The first 60 of 231 tokens; segment 0 in orange. SciFact pairs average 354 tokens, and 12% hit the 512 cap and silently lose the end of the abstract; Qwen3-Reranker's 1,024 cap cuts 0.5%. With long chunks, rerank shorter chunks or use a long-context reranker.

Read it in the code (transformers 5.19.0, sentence-transformers 6.1.0; and the four-way check)

transformers 5.19.0, models/bert/modeling_bert.py, lines 457-463 (BertPooler) and 1104-1107 (BertForSequenceClassification.forward)

def forward(self, hidden_states): first_token_tensor = hidden_states[:, 0] # the [CLS] position pooled_output = self.dense(first_token_tensor) # 384 x 384 for MiniLM pooled_output = self.activation(pooled_output) # tanh return pooled_output ... pooled_output = outputs[1] pooled_output = self.dropout(pooled_output) logits = self.classifier(pooled_output) # nn.Linear(hidden, num_labels=1)

XLM-RoBERTa (inside bge-reranker-v2-m3) does the same with its own head (modeling_xlm_roberta.py lines 895-902: first token, dense, tanh, out_proj). Nogueira and Cho: "we feed the query as sentence A and the passage text as sentence B".

sentence-transformers 6.1.0, cross_encoder/model.py, lines 245-274 (abridged)

if (... config.architectures[0].endswith("ForCausalLM")): # a decoder LLM, e.g. Qwen3-Reranker transformer_model = Transformer(..., transformer_task="text-generation", ...) true_token_id = transformer_model.tokenizer.convert_tokens_to_ids("yes") false_token_id = transformer_model.tokenizer.convert_tokens_to_ids("no") post_processing = LogitScore(true_token_id=true_token_id, false_token_id=false_token_id) return [transformer_model, post_processing], {} # Otherwise, assume sequence-classification transformer_model = Transformer(..., transformer_task="sequence-classification", ...)

same file, lines 704-736 (predict, abridged) and 425-426 (default activation)

activation_fn = activation_fn or self.activation_fn length_sorted_idx = np.argsort([-self._input_length(pair) for pair in inputs]) # longest first: little padding ... scores = activation_fn(scores) pred_scores = [pred_scores[idx] for idx in np.argsort(length_sorted_idx)] # back to input order ... if self.num_labels == 1: return nn.Sigmoid() # used only when the model's config names no activation

Checked. e_ce_manual.py scores ten real pairs four ways on CPU: CrossEncoder.predict, the transformers model, the head written out by hand, and the score the setup recorded on the GPU. All four agree to within 0.0001 on every pair (scores from -0.16 to 5.68). measured here

3. How rerankers are trained: labels, hard negatives, distillation

Almost every open English reranker starts from MS MARCO passage ranking (8.8 M Bing passages, about one marked relevant passage per question), so many "negatives" are relevant passages nobody marked (false negatives). Three training signals, in the order they appeared:

  1. Pointwise labels: binary cross-entropy on each (query, passage, 0 or 1), as Nogueira and Cho did.
  2. Hard negatives: negatives from a retriever's top results instead of at random. A cardiology abstract is trivially irrelevant to a claim about MDA5; the abstract about RIG-I signalling that mentions MDA5 but does not support the claim is what the model must learn to rank second. The risk: a mined "negative" may be an unlabelled positive.
  3. Distillation: a small student learns a strong teacher's scores instead of 0/1 labels, on many unlabelled pairs, which also smooths over missing labels (the teacher says "this unmarked passage is quite relevant"). The common loss is Margin-MSE (Hofstätter et al., 2020): the student's margin between a positive and a negative should equal the teacher's, so it learns relative judgements without the teacher's scale.
LMargin-MSE = ( [sstudent(q, d+) − sstudent(q, d−)] − [steacher(q, d+) − steacher(q, d−)] )2

A tiny real run: in-domain training helps, and mined hard negatives can hurt

Fine-tuning the MS MARCO MiniLM cross-encoder on SciFact's 809 training claims, one epoch, binary cross-entropy, 1 relevant : 7 negatives per claim, then reranking the 300 test claims' top 30. Predict before reading the table: do BM25-mined hard negatives beat random ones?

Three minutes of in-domain training lift the hybrid top 30 from 0.702 to 0.74 to 0.75; BM25 hard negatives did worse than random

Zero-shot (the MS MARCO model as released, scored in this run): 0.687 on BM25's top 30, 0.702 on the hybrid top 30 (the recorded-score sweep gives 0.687 and 0.702). Fine-tuned with hard negatives: 0.726 and 0.738; with random negatives: 0.734 and 0.750 (means of 2 seeds). Training took about 182 s per run on MPS. Both fine-tunes beat the released model: three minutes of in-domain training bring the 22 M model on the hybrid top 30 level with the 568 M bge-reranker-v2-m3 (0.749), though not with Qwen3-Reranker (0.778). Hard negatives did not beat random ones here. Likely reasons, not tested here: SciFact's labels are sparse, so some BM25 'hard negatives' are unlabelled relevant abstracts (false negatives, which RocketQA-style denoising and teacher scores address), and the MS MARCO starting point already ranks near misses; at one epoch and one learning rate the comparison is tiny. In practice: filter mined negatives with a stronger model, or distil from its scores. measured here on MPS, 2 seeds each (e_train.py); tiny: one learning rate, one epoch.

Who distilled from whom, with the reported results (published; none of these trainings run here)

MS MARCO in numbers: 8,841,823 passages and 1,010,916 anonymised questions (Bajaj et al., v3), 532,761 training relevance labels and 39,780,811 training triples in the small file (dataset page, read 2026-10-14). Hard negatives in 2019 were BM25's top 1,000; later ones come from dense retrievers.

StudentTeacher and signalLossReported result
BERT-dot, ColBERT, TK, PreTT (6-layer DistilBERT students)ensemble of BERT-base, BERT-large and ALBERT-large cross-encoders (scores averaged)Margin-MSE"significantly improves re-ranking effectiveness without compromising their efficiency"; teacher scores released (Hofstätter et al., 2020)
MiniLM cross-encoders (sentence-transformers)the same teacher ensemble's logits: "we use knowledge distillation with a small & fast model and learn the logits scores from the teacher ensemble"pointwise MSE on logits (examples/training/ms_marco/train_cross-encoder_kd.py, sentence-transformers v2.2.2)model card (vendor, read 2026-10-14): MiniLM-L6-v2 74.30 nDCG@10 on TREC DL 2019 and 39.01 MRR@10 on MS MARCO dev at 1,800 docs/s on a V100, against 74.31 and 39.02 at 960 docs/s for the 12-layer version. The card only says it "was trained on the MS Marco Passage Ranking task": which script produced the released checkpoint is unconfirmed.
ColBERTv2a 22 M MiniLM cross-encoder reranking ColBERT's own top k, 64 passages per exampleKL divergence between score distributions, plus in-batch negativesMS MARCO dev MRR@10 39.7 (Santhanam et al., Table 4)
DeBERTa 70 M to 435 MGPT permutations of BM25's top 20 for 10,000 MS MARCO querieslistwise ranking losses on the teacher's order435 M student 53.03 BEIR average against 51.36 for monoT5-3B (RankGPT, Table 13)
RankVicuna 7 B, RankZephyr 7 BRankGPT-3.5 orders (about 100 K queries), then RankGPT-4 (up to 5 K) for RankZephyrnext-token loss on the permutation text, shuffled inputsRankZephyr 0.7420 / 0.7086 nDCG@10 on DL19 / DL20 over BM25's top 100 (Pradeep et al., Table 5)
answerai-colbert-small-v1 (33 M, the ColBERT used here)BGE-M3 reranker scores (JaColBERTv2.5 recipe), three runs averagedscore distillationBEIR average 53.79 against 50.02 for the 110 M ColBERTv2 (Answer.AI blog; ColBERTv2 is still ahead on Touche2020)

The Qwen3 report's own reranker table (MTEB-R, the authors' runs over Qwen3-Embedding-0.6B's top 100) puts Qwen3-Reranker-0.6B at 65.80 against 57.03 for bge-reranker-v2-m3; on SciFact here, independently, the two score 0.778 and 0.749 at K = 30 on the hybrid list: the same order, a smaller gap.

4. Where the reranker goes, and how deep

The reranker sits after the first stage (BM25, vectors, or their fusion) and before prompt assembly: corpus (5,183) → first stage → top K (10 to 100) → reranker → top k (3 to 10) → LLM. It sees only the top K. Too small a K and the relevant abstract never reaches it; too large and you pay for pairs that almost never matter and give a weak reranker more chances to promote a wrong abstract. Two curves decide K: the first stage's recall@K (the ceiling: 0.862 at K = 10 and 0.921 at K = 30 for the hybrid list), and the reranker's quality as K grows.

Predict: the hybrid list (BM25 and Qwen3-Embedding fused) scores 0.724 nDCG@10 on its own. You rerank its top 100 with the small MiniLM cross-encoder, which lifts BM25 from 0.679 to 0.688. What happens?

On the hybrid list Qwen3-Reranker-0.6B reaches 0.782 at K = 20 and stays flat (0.782 at K = 100); bge-reranker-v2-m3 (568 M, multilingual) peaks at K = 20 (0.757) and slides to 0.738, although recall keeps rising from 0.912 to 0.953: extra relevant abstracts deep in the list are rare (most claims have one), and extra candidates are extra chances for a confident mistake. The MiniLM cross-encoder helps BM25 a little, helps dense retrieval only at small K, and hurts the hybrid list.

A strong reranker flattens past K = 20; a weak one gets worse the deeper it reads

nDCG@10 after reranking the top K (log scale), the rest of the list left in first-stage order; the grey dashed line is the first stage's recall@K (same axis; from K = 3), the most a reranker could ever surface. 300 test claims, recorded scores. measured here (e_depth.py; the 62 cells the root's shared runs also report are identical). The two large rerankers were scored to K = 100 on the hybrid list only (24,418 extra pairs, e_rerank_deep.py).

Averages hide losses. At K = 30 on the hybrid list Qwen3-Reranker improves 68 claims and worsens 34 (the rest unchanged); MiniLM improves 48 and worsens 67. Fig. 3 is one real candidate list, reranked: pick a case, a first stage, a reranker and K, and the figure replays.

  1. The first stage's top 30. One bar per abstract, rank 1 on the left, height its first-stage score scaled within the list; relevant abstracts are green.
  2. Only the top K go on. The glass plate marks K; the rows behind it keep their first-stage places.
  3. The reranker reads each pair. One stream from the claim to each of the K candidates: K model passes (or K MaxSim sums for ColBERT). Each bar becomes the reranker's recorded score, scaled within the list.
  4. Re-sorted. The top K re-sort by the reranker's recorded score and slide to their new places; the rest stay put.
  5. What changed. The relevant abstract's rank before and after, this claim's nDCG@10 both ways, and the top five after reranking (below).

Rows: the first stage's real top 30 for the claim; the reranker re-sorts the top K by the reranker's recorded score, the rest keep their place. Scores: MiniLM raw logit, bge-reranker sigmoid (0 to 1), Qwen3-Reranker log-odds of yes over no, ColBERT MaxSim sum; bars scaled within the list. measured here

How the six claims were chosen (fixed rules, not by hand)

Written in e_examples.py: the first claim in id order where Qwen3-Reranker rescues a relevant abstract from BM25 rank 10 or lower, where it demotes BM25's correct first result, where MiniLM and Qwen3-Reranker disagree, where no first stage finds anything, one with three or more relevant abstracts, and claim 1180.

How to choose K on your data. Plot your first stage's recall@K on a labelled sample (a few hundred queries is enough), take the smallest K where it flattens, measure the reranker's quality at a few K around it, and check the latency at that K on your hardware (Depth chooser tab). If recall@K is low, fix retrieval (hybrid, query rewriting, chunking), not the reranker. The root's shared runs (src/pipe of Topic: rag-and-retrieval) measured the same sweep inside the whole pipeline, with generation.

5. Evaluating a reranker, and timing it

Everything above is one evaluation, and the same recipe works on any corpus:

  1. Freeze the first stage and score it alone: nDCG@10 and recall@K on a labelled sample from your own data. Recall@K is the reranker's ceiling.
  2. Rerank at the K you will use and compare with the first stage alone, not with nothing. A reranker can lower quality (MiniLM on the hybrid list: 0.724 to 0.689).
  3. Count wins and losses per query, not only the mean (68 better and 34 worse for Qwen3-Reranker above), and read a few losses.
  4. Time a whole query's batch, all K pairs together, several repeats, under realistic load. Per-query latency depends on batching, padding and length sorting: timing one pair and multiplying by K is wrong both ways (section 1's predict box: 6.0 s predicted, 7.5 s measured).
  5. Check the scores you will threshold on target data (section 6), and the instruction or template the reranker expects (section 7).

Sparse labels make every number here a lower bound: an unlabelled relevant abstract promoted to first counts as a miss. Judged answer metrics (faithfulness, groundedness) belong to RAG and retrieval evaluation; nDCG, MRR and AUROC are defined on Evaluation metrics.

6. What a reranker score means: calibration, thresholds, abstaining

A RAG system often has to decide whether anything relevant was found, to say "I could not find it" instead of answering from the wrong abstract. A threshold on the reranker score needs the score to mean the same thing across queries. The three models here return three quantities (MiniLM a raw logit, bge a sigmoid, Qwen3 log-odds of "yes" over "no"); mapped onto one logit scale (bge: log(p / (1 - p))), their distributions on the same 15,076 pairs are:

Calibration means that among pairs scored 0.7, about 70% are relevant. Of the pairs whose raw sigmoid is above 0.9, only 35%, 66% and 57% are labelled relevant (MiniLM, bge, Qwen3; the truth is somewhat higher because of missing labels). Thresholds do not transfer either: the same MiniLM puts relevant pairs at a median logit of 2.6 on SciFact and -1.1 on NFCorpus (medical questions, graded labels); 69% against 41% score above 0. Recalibrate on a labelled sample of the target data.

Expected calibration error before and after Platt scaling (measured)

Reading each logit through a sigmoid, the expected calibration error (ECE: the average gap between predicted and observed relevance over ten score bins) is 0.070, 0.042 and 0.040; after Platt scaling (fitting p = sigmoid(a · score + b) on half the claims, testing on the other half) it drops to 0.011, 0.002 and 0.002. Those ECEs look small only because 2.1% of the pairs are relevant; the top bin above is the real story.

Relevant and unlabelled pairs overlap, and the raw top scores are over-confident

Pool: each test claim's BM25 top 30 plus Qwen3-Embedding top 30 (15,076 pairs, 323 labelled relevant). "Unlabelled" includes some relevant abstracts nobody marked. measured here (e_scores.py)

Abstaining when nothing relevant was retrieved

A constructed test: each claim is ranked twice, once with its candidate pool as is (285 claims have a relevant abstract in it) and once with every relevant abstract removed, so the best remaining candidate is a near miss. A good "nothing here" signal gives the top candidate a lower score in the second case; AUROC is the chance that a random answerable claim's top score beats a random unanswerable one's. Predict: is the reranker's top score a better signal than the retriever's cosine?

The large rerankers beat the first stage's scores; the small MiniLM is no better than the cosine. At a threshold that keeps 90% of answerable claims, 65% of the "nothing relevant" claims are still answered (Qwen3-Reranker). Use the score as one input to abstaining, together with a check that the passage supports the answer (groundedness: RAG and retrieval evaluation).

A strong reranker's top score is the best "nothing here" signal, and still far from clean

AUROC: Qwen3-Reranker 0.80, MiniLM 0.71, cosine 0.72, BM25 0.66. Thresholds on each model's logit scale. measured here (e_scores.py)

7. LLM rerankers: pointwise, pairwise, listwise

A decoder language model can rerank in three ways, which differ in what one call sees:

Pointwise: one call per candidate, "relevant? yes or no", read P(yes). Independent scores: parallel calls, thresholdable. K calls.
Pairwise: "which of A and B is more relevant?" inside a sort. Robust to score scale, but all pairs is K(K-1) calls; a sliding bubble sort is about 2 × passes × K with both orders asked.
Listwise: one call sees many candidates and writes "[3] > [1] > [2]". Sees the competition; long prompts, output to parse, position bias; long lists go through a sliding window. A few long calls.

Pointwise done properly: Qwen3-Reranker. A Qwen3 decoder fine-tuned to answer one question in a fixed chat template, with an empty thinking block pre-filled so the very next token is the answer. The score is the difference of two next-token logits, because a softmax restricted to the two tokens gives

P(yes) = ey / (ey + en) = sigmoid(y − n),   score = logit("yes") − logit("no")

so the stored score is the log-odds of "yes" against "no". The idea is monoT5's (Nogueira et al., 2020), which ranked by the softmax over only "true" and "false". Load it as its model card says (sentence-transformers CrossEncoder with prompts): a raw (query, document) pair through a generic causal-LM path, without the instruction and template, gives different scores.

The template and the scoring code (Qwen3-Reranker chat_template.jinja, sentence-transformers 6.1.0)
<|im_start|>system Judge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be "yes" or "no".<|im_end|> <|im_start|>user <Instruct>: {{ instruction }} <Query>: {{ query_text }} <Document>: {{ document_text }}<|im_end|> <|im_start|>assistant <think> </think>

cross_encoder/modules/logit_score.py, lines 42-54 (abridged)

def forward(self, features, **kwargs): logits = features[self.module_input_name][:, -1] # next-token logits at the last position if self.false_token_id is None: scores = logits[:, self.true_token_id] else: scores = logits[:, self.true_token_id] - logits[:, self.false_token_id] # "yes" (9693) minus "no" (2152) features["scores"] = scores.unsqueeze(1)

The Qwen3 report says the reranker gets supervised fine-tuning and model merging, with no weakly supervised pre-training stage, unlike the embedding models (Qwen3 Embedding report: "the reranking model's training process does not include a first-stage weakly supervised training phase").

A general LLM, prompted: measured

Predict first: does a general 4 B model, about seven times the trained reranker's parameters, rank better in any of the three styles? The run: Qwen3-4B (Q4_K_M, llama-server on this laptop's GPU, temperature 0, thinking off). Pointwise uses Qwen3-Reranker's exact template and reads the "yes" and "no" log-probabilities; pairwise uses the PRP prompt (Qin et al., 2023) in both orders, swapping two passages only when both orders agree, 2 bubble passes over the top 10; listwise uses the RankGPT prompt (Sun et al., 2023), a window of 10 sliding by 5 from the back of the top 20 to the front. Passages in pairwise and listwise prompts cut to 80 words; first stage BM25. measured here (e_llm.py)

Listwise with a 10-candidate window did not beat BM25 here; pointwise yes/no gained little without the training; pairwise was the best prompted style but the two orders disagreed in about 40% of comparisons (position bias), which is why PRP asks both. The training, not the architecture or the size, makes Qwen3-Reranker good. Parse listwise output with a fallback: models skip or repeat identifiers, so deduplicate, append missing candidates in input order, and count it (0 identifiers missing over 300 calls here).

The trained 0.6 B reranker beats the prompted 4 B model in every style, at a fraction of the time

nDCG@10 0.681 pointwise and 0.668 listwise, against 0.743 for the trained reranker and 0.671 for BM25 alone, at about 20.3 and 13.9 seconds per claim against 4.83; pairwise comparisons on 50 claims did best of the three (0.764 against 0.747 for BM25 and 0.782 for Qwen3-Reranker on the same claims, top 10).

Run details: failures, repairs, position bias, timing (measured)

Same 100 claims (every third test claim), same BM25 candidates. Pointwise: 100 of the 2000 calls lacked a yes or no log-probability among the top 20 and were scored at the floor. Listwise: 0 identifiers missing over 300 calls (0 calls had to be repaired); 5 of 300 calls returned the input order unchanged. Pairwise: the two orders disagreed on 338 of 850 comparisons (position bias), kept as ties. Seconds are wall time on this laptop with llama-server's prompt cache on (the shared system prompt and claim are reused between calls); the trained rerankers' seconds are one batch of 20 on MPS.

Listwise reranking slides a window from the back, so a good candidate can climb one window at a time

One real claim (324): each step is one call to Qwen3-4B with ten candidates; bars are the BM25 order going in and the model's returned order coming out, the relevant abstract highlighted. measured here

Fig. 5: listwise reranking slides a window from the back, so a good candidate can climb one window at a time. Qwen3-4B, BM25's top 20, a window of 10 sliding by 5.

  1. BM25's order goes in.
  2. Call 1: ranks 11 to 20.
  3. Call 2: ranks 6 to 15.
  4. Call 3: ranks 1 to 10.

Published at scale, RankGPT Table 1 (published, academic, 2023): GPT-4 listwise over BM25's top 100 reached 75.59 nDCG@10 on TREC DL 2019, against 71.83 for the trained monoT5-3B and 50.58 for BM25; gpt-3.5-turbo reached 65.80, below monoT5. A frontier LLM can beat a trained reranker; a mid-size one usually does not; the trained small reranker is far cheaper per pair either way.

More published LLM reranking: PRP, Setwise, FIRST (published)

PRP with the open FLAN-UL2 (20 B) reached 72.42 to 72.65 on TREC DL 2019 depending on the variant. Setwise (Zhuang et al.) picks the best of three per call inside a sort (about 62% fewer inferences than pairwise heapsort in their Table 2). FIRST (Reddy et al., 2024) reads the order from the logits of the first generated identifier instead of generating the whole permutation ("accelerates inference by 50%").

8. Late interaction: ColBERT and MaxSim

A bi-encoder squeezes a document into one vector; a cross-encoder precomputes nothing. Late interaction keeps the document side precomputable but much richer: the encoder outputs one small vector per token, stored offline, and query and document meet only at the end, through a cheap score. ColBERT (Khattab and Zaharia, 2020) defines it as MaxSim: each query token takes its highest dot product with any document token, and the maxima are added up. On claim 1180, "md ##a ##5" finds the same three word pieces in the abstract (similarities 0.96, 0.97 and 0.96), "sensor" finds "sensing" (0.92), and "rna", "virus" and "infection" find themselves. Fig. 4 follows that pair token by token.

Fig. 4: each claim token finds its own best match; one vector averages those matches away.

  1. Stored apart. The abstract's token vectors (the white row at the back, one per stored token), computed offline; the claim's tokens down the left side (orange): [CLS], the query marker and the word pieces.
  2. Every claim token meets every abstract token. One row per claim token, one column per abstract token; the colour is their dot product, shaded within each row from its lowest to its highest value.
  3. Each row keeps its maximum. A pillar rises on each row's best abstract token; its height is that similarity. The readout below names each token's best match.
  4. The maxima are summed. The pillars stream into the score tower on the right: the sum over the real claim tokens.
  5. [MASK] expansion rows. Queries are padded to 32 tokens with [MASK] (front rows); each takes its maximum too, on the abstract's [CLS] or [SEP] marker at about 0.97 to 0.99 for both pairs here, so the tower grows by nearly the same amount for every abstract.
  6. Against one vector. The claim's Qwen3-Embedding top 10 rescored both ways: by MaxSim (back row) and by the single-vector cosine (front row), best on the left; the relevant abstract is green.

Real ColBERT vectors (answerai-colbert-small-v1, 96 dimensions per token, stored by the setup); single vector: Qwen3-Embedding's cosine. Similarities are cosines from the stored float16 vectors; re-encoding on CPU in float32 reproduces them (minimum cosine between the two encodings 0.9999). The ranking in step 6 is the claim's Qwen3-Embedding top 10 rescored both ways. measured here (e_maxsim_pair.py)

score(q, d) = ∑i ∈ query tokens maxj ∈ document tokens qi · dj

Query augmentation. Queries start [CLS] [Q] and documents [CLS] [D] (unused vocabulary slots), so one encoder embeds both differently, and queries are padded with [MASK] to a fixed 32 tokens whose vectors are scored like real ones: a learned soft expansion. SciFact claims have 22.7 real tokens on average, so about 29% of each query is [MASK]. They carry 30% of the top abstract's score, but nearly the same amount for every abstract (they all match the document's [CLS] at about 0.97), so MaxSim totals sit close together (30.25 to 30.91 for claim 1180's top 10) and the real tokens decide the order: dropping the masks at search time moves nDCG@10 only from 0.744 to 0.739. Punctuation vectors are dropped from documents (a skiplist), so an abstract stores fewer vectors than it has tokens.

Read it in the code (pylate 1.6.0)

scores/colbert.py, lines 189-200 (the plain torch path)

scores = torch.einsum("ash,bth->abst", queries_embeddings, documents_embeddings) # every query token x every doc token if queries_mask is not None: scores = scores * queries_mask.unsqueeze(1).unsqueeze(3) if documents_mask is not None: scores = scores * documents_mask.unsqueeze(0).unsqueeze(2) scores = scores.max(axis=-1).values.sum(axis=-1) # max over doc tokens, sum over query tokens

In models/colbert.py: the markers are [unused0] and [unused1]; the pad token is set to the mask token (lines 411-412) and queries are padded to max_length (lines 1173-1178); the punctuation skiplist mask is lines 750-757.

What it costs: storage up, compute down

SciFact, 5,183 abstractsVectorsBytes per abstractCorpusSource
bge-small, one 384-d float32 vector5,1831,5368.0 MBderived: 384 × 4
Qwen3-Embedding, one 1,024-d float32 vector5,1834,09621.2 MBderived: 1,024 × 4
ColBERT-small, 96-d float16 per token1,221,38845,245234.5 MBmeasured here: 235.7 vectors per abstract × 192 bytes
ColBERT-small in a PLAID index, 2 bits per dimension1,221,3889,20247.7 MBmeasured here (section 9)

That is 45 KB per abstract, 29 times bge-small's single vector. Compute goes the other way: MaxSim for one abstract is 32 × 236 × 96 multiply-adds, about 1.4 MFLOP, against 8.9 GFLOP for the MiniLM cross-encoder on the same pair, 6,168 times more. The ColBERT paper reports the same shape on MS MARCO: reranking 1,000 candidates took 10,700 ms and 97 TFLOP per query with BERT-base, 61 ms and 7 GFLOP with ColBERT (Table 1, a 13,900-fold FLOP reduction; published, academic, 2020). Measured here on one CPU thread, MaxSim over the hybrid top 100 takes 1.0 ms per claim; over all 5,183 abstracts the setup measured 62 ms per claim on the GPU.

As a first stage or as a reranker

Because document vectors are precomputed, ColBERT does both jobs. As a first stage ColBERT-small (0.743, 33 M parameters) beats Qwen3-Embedding-0.6B (0.700). Reranking BM25's top 100 (0.745) matches exhaustive late interaction (0.744), because that list already holds 0.913 of the relevant abstracts; the hybrid top 20 is ColBERT's best setting here (0.758), and the cross-encoder Qwen3-Reranker still beats it (0.782).

Different encoders for documents and queries. The two sides of late interaction run at different times: documents are encoded once, offline, and queries on every request, inside the latency budget. If two models write token vectors into one shared space, each side can get its own size. Perplexity's pplx-embed-v2-late does this: a 0.6 B and a 9 B multilingual, multimodal late-interaction model, both distilled from an 18 B teacher into one embedding space, so "documents can be indexed with the 9B model and queried with the low-latency 0.6B model" (arXiv 2610.29523). It buys the large model's document vectors at the small model's query latency, and costs a pair trained together: a query model from another family cannot read the index. The report claims state-of-the-art results within each size class on text, image and visual-document retrieval vendor; not run here.

ColBERT alone beats the 0.6 B bi-encoder; as a reranker it peaks on the hybrid top 20

nDCG@10, 300 test claims. Exhaustive = MaxSim against every abstract (recomputed in float32 from the stored float16 vectors: 0.744; the setup's GPU run 0.743). Rerank = MaxSim over a first stage's top K. measured here (e_colbert.py)

9. PLAID: compressing and searching token vectors

One vector per token multiplies storage by the tokens per document (236 here), and exhaustive MaxSim reads all of them. ColBERTv2 stores each token vector as the id of its nearest k-means centroid plus the residual (vector minus centroid) quantised to 1 or 2 bits per dimension: "this total of 20 or 36 bytes per vector" at 128 dimensions against 256 in float16, a 6 to 10 times smaller index. PLAID then searches without decompressing everything, the same IVF idea as Vector indexes, applied per token:

  1. each query token picks its nearest centroids; documents with tokens in them become candidates;
  2. candidates are scored with centroid interaction: MaxSim with every token replaced by its centroid;
  3. centroids that score low for every query token are pruned, and the survivors rescored;
  4. only the best few are decompressed and scored exactly.

PLAID's Table 3 reports 39.8 MRR@10 on MS MARCO at k = 100 in 222 ms on one CPU core and 20 ms on a GPU, against 4,569 ms on 8 cores for vanilla ColBERTv2 (published, academic, 2022). Measured here with fast-plaid 1.4.6 (the engine pylate uses) on the stored SciFact vectors, CPU, seed 42 (e_plaid.py). Predict: which knob matters on 5,183 abstracts, centroids probed or candidates fully scored?

nDCG@10 is 0.740 at 2 bits and 0.742 at 4 bits against 0.744 exhaustive, though only 89% and 95% of the exact top 10 are reproduced exactly. With only 32 candidates fully scored, nDCG@10 drops to 0.729 and 66% of the exact top 10 survive; from 256 on it is back. Centroids probed barely matter here: one centroid per query token, times 32 query tokens, already reaches most relevant candidates; on millions of passages it matters. Storage per token falls from 192 bytes to 24 bytes of residual codes plus a centroid id: 47.7 MB for the corpus with centroids and inverted lists, 4.9 times less than float16. At scale, never store ColBERT vectors uncompressed: use residual compression or token pooling and check the quality cost on your data. Page-image patches (ColPali) use the same machinery: Document ingestion and multimodal retrieval.

Compression costs little; too few fully scored candidates is what hurts

Rows: centroids probed per query token (n_ivf_probe); columns: candidates decompressed and fully scored (n_full_scores). Cell: nDCG@10 and the share of the exhaustive top 10 recovered. Index: 16,384 centroids of 96 dimensions (fast-plaid picks 2floor(log2(16 √tokens))). measured here

On-disk details of the fast-plaid index (measured)

fast-plaid stores the centroid id as an 8-byte integer (ColBERTv2's paper counts 4 bytes), and keeps a merged second copy of codes and residuals for search, so its folder is 86.8 MB. On 5,183 abstracts none of this is needed (exhaustive MaxSim is already fast); PLAID is for millions of passages.

10. Learned sparse retrieval: SPLADE

The other middle point keeps BM25's machinery, an inverted index and a score summed over shared terms, but lets a model choose the terms and their weights. SPLADE (Formal, Piwowarski and Clinchant, SIGIR 2021) runs BERT's masked-language-model head over every input position i, which scores all 30,522 vocabulary entries j; the text's weight for term j is the largest log-saturated score over positions. Terms the text lacks get weight too: expansion terms, words a reader would expect. The chart beside shows a real document vector.

wij = transform(hi)T Ej + bj,   wj = maxi log(1 + ReLU(wij)),   score(q, d) = ∑j wj(q) · wj(d)

The log saturates so no term dominates; ReLU zeroes most of the vocabulary. SPLADE v1 summed over positions; v2 (Formal et al., 2021) switched to the max, "almost 2 points" better on MS MARCO and TREC. Sparsity is trained, not hoped for: the FLOPS regulariser penalises each term's average weight over the batch, squared, which pushes down terms that are active in many documents and keeps posting lists short and even, with separate strengths for queries (kept sparser) and documents:

ℓFLOPS = ∑j ∈ V ( (1/N) ∑i=1N wj(di) )2,   L = Lrank + λq ℓq + λd ℓd

An inference-free variant, the model above, runs the network on documents only; a query is tokenised and each word gets a fixed weight from a table, so a query costs a tokeniser call, like BM25. On SciFact it scores 0.708 nDCG@10 against 0.679 for BM25 and 0.700 for Qwen3-Embedding, and fused with Qwen3-Embedding by RRF 0.724, level with BM25 + Qwen3 (0.724). A document keeps 239 non-zero terms on average and a query 20, so the index stays an inverted index, about 1,910 bytes per abstract before compression (derived: 239 × (4-byte term id + 4-byte weight)), between the single vector and ColBERT. Caveat: the model card lists SciFact and NFCorpus among its training sets, so these scores are in-domain and flatter it against BM25 and the dense models.

A sparse vector is a weighted bag of words, including words the abstract never uses

The 20 heaviest of the 239 non-zero terms the model wrote for SciFact abstract 4983 ("Microstructural development of human newborn cerebral white matter assessed in vivo by diffusion tensor..."); orange: the 2 expansion terms that appear nowhere in its text ("baby", "fibre"); also "infants" beside "infant", "fibers" beside "fiber". Model: opensearch-neural-sparse-encoding-doc-v3-distill (67 M, Apache 2.0) through sentence-transformers' SparseEncoder, 42 documents per second on MPS. measured on the Retrieval pipeline page (its src/exp/sparse.py, 2026-10-14), copied to src/inputs/sparse_rp.json, not rerun here.

Published (academic): SPLADE v1 reached MS MARCO dev MRR@10 0.322 against 0.184 for BM25 and 0.277 for doc2query-T5, close to dense ANCE (0.330), at an estimated 0.73 FLOPS per query-document pair against 0.13 for BM25 (Table 1, 2021). Distilled from a cross-encoder with Margin-MSE (section 3) on its own harder negatives, DistilSPLADE-max reached 0.368 (SPLADE v2, Table 1) and a BEIR zero-shot average nDCG@10 of 0.506 against 0.456 for BM25 and 0.457 for ColBERT (Table 2; SciFact 0.693 against 0.665 for BM25). Learned sparse is a first-stage retriever, or a third retriever beside BM25 and dense; how the lists are fused belongs to The retrieval pipeline, and pgvector's sparsevec to Search and vector databases.

More on learned sparse (published)

SPLADE v1, Table 1: a pure-lexical SparTerm trained with the same pipeline reached 0.290; with expansion but no log-saturation (ST exp-ℓFLOPS) 0.312 at 2.83 FLOPS, so the log is what buys the sparsity. A strongly regularised model kept 0.296 MRR@10 at 0.05 FLOPS, with 18 non-zero values per document and 6 per query on average and an index under 1.4 GB for MS MARCO's 8.8 M passages. The paper's Table 2 example adds "leg" to a passage about "legs" (an implicit stemmer) and "treatment" (a topic word). The inference-free model above: average nDCG@10 0.517 on 13 BEIR sets against 0.524 for the larger query-and-document v1 model (published, vendor, OpenSearch model card, as quoted by the Retrieval pipeline page). BGE-M3 (BAAI) gives dense, sparse and multi-vector outputs from one model; not run here.

11. Choosing

SituationChoiceWhy (evidence on this page)
CPU only, tight latency, Englishsmall cross-encoder (MiniLM-L6) on the top 10 to 20, or none157 ms for 30 pairs on this laptop's GPU; but measure: it hurt the hybrid list here (section 4)
A GPU, quality mattersa 0.6 B reranker (Qwen3-Reranker, bge-reranker-v2-m3) on the top 20 to 30+0.06 nDCG@10 over hybrid here; about 416 GFLOP per pair
Many languagesa multilingual reranker (bge-reranker-v2-m3, Qwen3-Reranker, hosted ones)MiniLM-L6 was trained on English MS MARCO only
Need a "nothing found" decisiona reranker score, recalibrated on your data, plus an answer-support checkabstention AUROC 0.80 at best (section 6)
Large corpus, better first-stage recalllate interaction (ColBERT with PLAID) as first stage or reranker0.743 alone here, at about 29 times the storage before compression
Keep an inverted index, add semanticslearned sparse (SPLADE-style) as a first stage or a third retriever0.708 alone here (in-domain), query cost like BM25 when inference-free (section 10)
Hard reasoning queries, budget for itan LLM listwise reranker on a short list after a cross-encoderGPT-4 class models beat trained rerankers on TREC DL; a 4 B model did not here (section 7)

Every open model on this page runs through sentence-transformers' CrossEncoder (section 2); pylate trains ColBERT models and builds PLAID indexes through fast-plaid; RAGatouille and the Stanford colbert-ai package are older ColBERT front ends; some vector databases store several vectors per document for late interaction (the parent's Tool map tab lists stores, versions and status).

Hosted rerankers, as listed by their vendors (volatile; read 2026-10-14; none run here)
VendorModelsContextPrice
Coherererank-v4.0-pro, rerank-v4.0-fast; older rerank-v3.532 K tokens; v3.5 4,096per search of one query and up to 100 documents (the price page did not load from here: unconfirmed)
Voyagererank-3, rerank-3-litequery plus one document up to 32,000 tokens$0.05 and $0.02 per million tokens, billed as query tokens × documents + all document tokens
Jinareranker v3.5from the topic's shared facts

vendor documentation; the topic runs local models only.

Design question: add reranking to a RAG service at 200 queries per second, p95 under 300 ms end to end (interview rehearsal)
Budget each stage (query embedding about 10 to 50 ms, ANN search a few ms, generation's first token separately). Rerank the hybrid top 20 to 30 with a 0.6 B cross-encoder on GPUs: about 0.4 TFLOP per pair, so 200 × 30 × 0.4 = 2.4 PFLOP/s of work; at a realistic 100 to 200 TFLOP/s achieved per GPU that is 12 to 24 GPUs, so consider a smaller distilled reranker, fewer candidates (K 10 to 20 after measuring the quality curve), shorter chunks, int8 or fp8, and dynamic batching across concurrent queries with a batch timeout. Cache scores for repeated (query, chunk) pairs. Fall back to the first-stage order if the reranker times out. Log scores to recalibrate thresholds; evaluate offline on a golden set before each model change. Derived arithmetic; the throughput figure is an assumption to replace with a measurement.
Measured on the topic's shared runs: what the root page used to show (moved here when the root's Pipeline lab was retired, 2026-10-24; 1 min)

Recorded in the root page's src/pipe on the same SciFact lists. Qwen3-Reranker-0.6B on the top 30 lifts the dense list (Qwen3-Embedding) to 0.765 and the hybrid list to 0.778. The most accurate reranker here is also about 40 times slower than the small one (6,618 ms against 155 ms for 30 candidates). Limits of that run: the setup scored the two large rerankers only on the BM25 top 30 and the Qwen3-Embedding top 30 (the union), and the root's lab scored the 2,715 extra pairs the hybrid top 50 needs (Qwen3-Reranker 4.9 pairs/s, bge-reranker-v2-m3 14.1 to 14.3 pairs/s, same settings); K 100 for them (about 12,200 more pairs, roughly 40 minutes for Qwen3-Reranker) was not run, given the flat curve from 20 to 50; the MiniLM cross-encoder covers K up to 100.

Every measured number on this page comes from the scripts in this page's src/scripts folder, run on an Apple M1 Pro (10 CPU cores, 16 GB) on 2026-10-14 against the running example of Topic: rag-and-retrieval (its src/data/load.py); results in src/data; the learned-sparse run is the Retrieval pipeline page's (src/inputs/sparse_rp.json). Versions: sentence-transformers 6.1.0, transformers 5.19.0, torch 2.14.1 (MPS) for the cross-encoders; pylate 1.6.0 and fast-plaid 1.4.6 (torch 2.11.0) for ColBERT; llama.cpp build 11146 for Qwen3-4B. Models at the revisions in the parent's src/data/manifest.json. Source quoted from those installed versions. Published numbers are labelled and kept apart.