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.
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).
[CLS] query [SEP] document [SEP], one relevance score out.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.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.
[CLS] claim [SEP] abstract [SEP], 231 tokens; the claim has segment id 0 (orange), the abstract 1 (first 48 abstract tokens drawn).[CLS] vector goes through dense, tanh and one linear layer: logit 5.68.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)
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 passes | Time | Source |
|---|---|---|---|
| Bi-encoder: encode the claim (Qwen3-Embedding-0.6B) + exact search over 5,183 vectors | 1 | 51 ms + under 1 ms | measured here (setup, query p50) |
| Cross-encoder MiniLM-L6 on the top 30 | 30 | 157 ms | measured here, one batch of 30 (e_time.py) |
| bge-reranker-v2-m3 on the top 30 | 30 | 2,442 ms | measured here |
| Qwen3-Reranker-0.6B on the top 30 | 30 | 7,499 ms | measured here |
| MiniLM-L6 on all 5,183 abstracts | 5,183 | 22 s | derived: 5,183 / 236.8 pairs/s |
| Qwen3-Reranker-0.6B on all 5,183 abstracts | 5,183 | 17 min | derived: 5,183 / 5.0 pairs/s |
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
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)
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.
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.
transformers 5.19.0, models/bert/modeling_bert.py, lines 457-463 (BertPooler) and 1104-1107 (BertForSequenceClassification.forward)
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)
same file, lines 704-736 (predict, abridged) and 425-426 (default 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
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:
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?
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.
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.
| Student | Teacher and signal | Loss | Reported 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. |
| ColBERTv2 | a 22 M MiniLM cross-encoder reranking ColBERT's own top k, 64 passages per example | KL divergence between score distributions, plus in-batch negatives | MS MARCO dev MRR@10 39.7 (Santhanam et al., Table 4) |
| DeBERTa 70 M to 435 M | GPT permutations of BM25's top 20 for 10,000 MS MARCO queries | listwise ranking losses on the teacher's order | 435 M student 53.03 BEIR average against 51.36 for monoT5-3B (RankGPT, Table 13) |
| RankVicuna 7 B, RankZephyr 7 B | RankGPT-3.5 orders (about 100 K queries), then RankGPT-4 (up to 5 K) for RankZephyr | next-token loss on the permutation text, shuffled inputs | RankZephyr 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 averaged | score distillation | BEIR 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.
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.
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.
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.
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
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.
Everything above is one evaluation, and the same recipe works on any corpus:
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.
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.
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.
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)
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).
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)
A decoder language model can rerank in three ways, which differ in what one call sees:
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
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.
chat_template.jinja, sentence-transformers 6.1.0)cross_encoder/modules/logit_score.py, lines 42-54 (abridged)
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").
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).
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).
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.
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.
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.
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%").
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.
[CLS], the query marker and the word pieces.[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.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)
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.
scores/colbert.py, lines 189-200 (the plain torch path)
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.
| SciFact, 5,183 abstracts | Vectors | Bytes per abstract | Corpus | Source |
|---|---|---|---|---|
| bge-small, one 384-d float32 vector | 5,183 | 1,536 | 8.0 MB | derived: 384 × 4 |
| Qwen3-Embedding, one 1,024-d float32 vector | 5,183 | 4,096 | 21.2 MB | derived: 1,024 × 4 |
| ColBERT-small, 96-d float16 per token | 1,221,388 | 45,245 | 234.5 MB | measured here: 235.7 vectors per abstract × 192 bytes |
| ColBERT-small in a PLAID index, 2 bits per dimension | 1,221,388 | 9,202 | 47.7 MB | measured 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.
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.
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)
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:
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.
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
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.
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.
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:
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.
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.
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.
| Situation | Choice | Why (evidence on this page) |
|---|---|---|
| CPU only, tight latency, English | small cross-encoder (MiniLM-L6) on the top 10 to 20, or none | 157 ms for 30 pairs on this laptop's GPU; but measure: it hurt the hybrid list here (section 4) |
| A GPU, quality matters | a 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 languages | a multilingual reranker (bge-reranker-v2-m3, Qwen3-Reranker, hosted ones) | MiniLM-L6 was trained on English MS MARCO only |
| Need a "nothing found" decision | a reranker score, recalibrated on your data, plus an answer-support check | abstention AUROC 0.80 at best (section 6) |
| Large corpus, better first-stage recall | late interaction (ColBERT with PLAID) as first stage or reranker | 0.743 alone here, at about 29 times the storage before compression |
| Keep an inverted index, add semantics | learned sparse (SPLADE-style) as a first stage or a third retriever | 0.708 alone here (in-domain), query cost like BM25 when inference-free (section 10) |
| Hard reasoning queries, budget for it | an LLM listwise reranker on a short list after a cross-encoder | GPT-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).
| Vendor | Models | Context | Price |
|---|---|---|---|
| Cohere | rerank-v4.0-pro, rerank-v4.0-fast; older rerank-v3.5 | 32 K tokens; v3.5 4,096 | per search of one query and up to 100 documents (the price page did not load from here: unconfirmed) |
| Voyage | rerank-3, rerank-3-lite | query plus one document up to 32,000 tokens | $0.05 and $0.02 per million tokens, billed as query tokens × documents + all document tokens |
| Jina | reranker v3.5 | from the topic's shared facts | |
vendor documentation; the topic runs local models only.
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 point is a real measurement on SciFact's 300 test claims: nDCG@10 after reranking the top K (recorded scores), against the time to rerank one claim's K candidates in one batch on this laptop (bench lock, 3 repeats). Choose the first stage and a point; the cards say what it buys and what it costs, and what the same work would take on faster hardware.
The hardware slider rescales only the cross-encoders' compute: time = K × GFLOP per pair / achieved TFLOP/s, with GFLOP per pair from the token counts (section 1 of the Reading tab). The first position is this laptop's measured throughput for each model. Higher positions are assumptions for illustration, labelled derived: real servers add batching, padding and transfer overheads, and gain from lower precision.
x: milliseconds per claim to rerank K candidates (log scale; measured where a timing exists, otherwise interpolated linearly in K from the measured points and drawn hollow). y: nDCG@10. The first stage alone is the dashed line; ColBERT times are MaxSim on one CPU thread over stored vectors. measured here (e_depth.py, e_time.py, e_colbert.py)
Quality against measured latency for every reranker and K, rescaled to faster hardware. 3 min
The whole pipeline; its sections 2 to 4 compare the scorers and the stages, and its shared runs hold the same rerank depth sweep and the end-to-end answers; its Tool map tab lists rerankers and vector stores with status. 19 min
The first stage this page reranks: chunking, BM25, hybrid fusion, query rewriting, prompt assembly. 47 min
Bi-encoders from the inside: pooling, contrastive training, hard negatives. 30 min
IVF and product quantization, the ideas PLAID reuses for token vectors. 39 min
ColPali: MaxSim over page-image patches, measured on ViDoRe. 28 min
When an agent decides to search again instead of trusting one reranked list. 35 min
Latency budgets, caching and cost per query, the rerank stage included. 37 min
Judged metrics, faithfulness and groundedness beyond nDCG. 27 min
nDCG, MRR, recall, calibration and AUROC defined. 27 min
Position bias and calibration of LLM judgements, the same problems LLM rerankers have. 29 min
The losses behind bi-encoders and ColBERT training. 31 min
The database-engine view of BM25 and ANN indexes. 33 min
Batching and serving, which set a reranker's real latency. 34 min
The cross-encoder recipe in four pages. 15 min
Relevance as the probability of a "true" token. 20 min
MaxSim, query augmentation, reranking against end-to-end retrieval. 45 min
Residual compression and denoised distillation. 40 min
Centroid interaction and pruning; the four-stage search. 40 min
Cross-architecture knowledge distillation for rankers. 35 min
Listwise LLM reranking with a sliding window, and permutation distillation. 40 min
Pairwise prompts, sorting variants, position bias. 35 min
A distilled open listwise reranker. 30 min
How Qwen3-Reranker is trained and evaluated. 30 min
Learned sparse retrieval: log-saturated MLM weights and the FLOPS regulariser. 20 min
Max pooling, document-only encoding, distillation; BEIR results. 20 min
The benchmark the running example comes from, with BM25+CE rows. 40 min
Loading, predict, rank, prompts. 15 min
BCE, listwise and distillation losses, hard-negative mining. 25 min
ColBERT models, training and PLAID indexes in one library. 20 min
Template, instruction and usage. 10 min
How the 33 M ColBERT used here was trained. 15 min