advanced27 min studyLesson 664 in Engineering

Cross-encoder reranking score semantics

Use joint query-document scoring within a candidate set while separating ranking quality, calibration, and candidate recall.

On this page

What you’ll understand

  • Explain the interaction and cost of joint query-document encoding.
  • Distinguish a logit or sigmoid score from validated relevance probability.
  • Evaluate reranking conditional on its candidate set and truncation policy.

A cross encoder reads a query and a candidate document together, allowing fine-grained interactions that independent document vectors do not capture. It is usually applied to a bounded candidate set because that joint computation repeats for each query-document pair. Nogueira and Cho’s BERT passage reranker is a primary example. Its classification output supplies a ranking signal, while empirical calibration and decision thresholds remain separate properties to validate.

Joint interaction costs another model evaluation

The model can attend between query and document tokens while producing its score. A cross encoder can therefore distinguish a document that mentions the right entities but states the wrong relationship, although success still depends on training and truncation. The independent document representation used by a dual encoder cannot generally be reused as the complete joint score. Reranking many candidates or long sequences consumes additional inference work, so candidate count, token length, batching, and device conditions determine its practical latency.

The candidate retriever still sets a hard ceiling on what a pure reranker can return. If the relevant document never reaches the candidate set, improving its relative scoring cannot recover it. Measure candidate recall separately from the ordering quality within that set. Also record what text the reranker actually sees: a long document’s decisive passage may be truncated or hidden in a different chunk. A misleading score can arise from missing input evidence rather than an inability to compare two fully observed candidates.

s(q,d)=fθ([q;SEP⁡;d])s(q,d)=f_\theta([q;\operatorname{SEP};d])
This abstract cross-encoder score jointly depends on the tokenized query and document, with the model’s declared special tokens, truncation, and pooling. It need not decompose into separately precomputed query and document vectors, and the scalar has no universal score unit.↔ Scroll wide equations horizontally.

A monotone link preserves order, not calibration

A binary classifier may expose a raw logit or a sigmoid output. Applying a strictly increasing sigmoid preserves its ordering for a fixed query in exact arithmetic, but values between zero and one are not automatically calibrated probabilities on deployment traffic. Training label prevalence, negative sampling, query mix, and domain shift affect interpretation. A pairwise or listwise trained score may have a different meaning altogether. Identify the loss and output transform before using a numeric threshold to reject candidates or route queries.

Calibration asks whether an appropriately defined group of predictions at a given confidence matches its observed relevance frequency. It requires representative labels, an explicit relevance definition, and a held-out procedure. A global calibration curve can hide query-class failures, and a rank-preserving transform can change thresholds while leaving ranking metrics unchanged. The calibration literature establishes that strong classification accuracy does not imply well-calibrated confidence. Do not infer that a score of 0.9 means nine of ten arbitrary documents with that value are relevant without appropriate evidence.

σ(s)=11+e−s,dσds=σ(s)(1−σ(s))>0\sigma(s)=\frac{1}{1+e^{-s}},\qquad \frac{d\sigma}{ds}=\sigma(s)(1-\sigma(s))>0
For finite real dimensionless logits, sigmoid is strictly increasing. The derivative establishes order preservation mathematically; it does not establish calibration, cross-query comparability, or safety of a fixed threshold. Finite-precision saturation can create displayed ties.↔ Scroll wide equations horizontally.

Evaluate the score at its intended decision boundary

Compare rerankers on identical candidate lists when isolating their ordering effect, then separately evaluate the complete retrieval-and-rerank system. Use held-out queries, check annotation coverage, and report latency under representative batching and sequence lengths. If thresholds control fallback or answer generation, validate those decisions using the relevant costs and class distribution rather than selecting a threshold from one attractive example. Recalibrate or re-evaluate after model, candidate distribution, or label-policy changes; a saved threshold is part of the deployed contract.

The network lab illustrates one logistic scalar, not cross attention. Reset, set input to 1 and weight to 1, predict logit and output, then Step: the fixed bias makes logit 0.5 and output approximately 0.6225. Compare a fresh Reset with both input at 1 and weight at 2 before Step: logit 1.5 gives approximately 0.8176. This unit contains no document tokens, trained reranker, relevance judgments, or calibration experiment.

Same ranking, very different confidence-looking numbers

Two candidate logits are 2 and 1. Compare their sigmoid outputs, then add five to both logits and compare again. Use exact ordering and rounded outputs; assume no calibration evidence has been collected.

  1. Initial sigmoid values are approximately 0.8808 and 0.7311, so the first candidate ranks above the second.

  2. After the common shift, logits are seven and six, with sigmoid outputs approximately 0.9991 and 0.9975. The candidate order is unchanged.

  3. The shift radically changes threshold behavior and apparent confidence without changing this ranking. Neither pair of outputs establishes real relevance frequency; a representative held-out calibration evaluation is needed for that interpretation.

The result

Ranking order and probability calibration are different claims, even when scores pass through a sigmoid.

Explore the model

Interactive lab

Interactive lab · network

A logistic link without a retrieval model

Reset, set input x = 1 and weight w = 1, predict z = wx − 0.5 and σ(z), then Step. Compare a fresh Reset with both x = 1 and w = 2 before Step. The fixed-bias sigmoid unit has no tokens, trained cross encoder, candidate list, or calibration data.

A logistic link without a retrieval modelOne inspectable sigmoid unit, σ(wx − 0.5). Playback traces the computation graph. There is no training, attention mechanism or hidden deep network. Current readings: Product · wx: 1.2; Logit · wx − 0.5: 0.7; Sigmoid output: 0.6682. All parameters are adjustable with the labeled controls below.One input. One weight. One sigmoid.x1.20× w1.20+ b0.70σ0.668output0.668w = 1.00b = −0.50σ(z) = 1 / (1 + exp(−z))
Computation graphSignal trace
Product · wx
1.2
Logit · wx − 0.5
0.7
Sigmoid output
0.6682
t = 0 s

One inspectable sigmoid unit, σ(wx − 0.5). Playback traces the computation graph. There is no training, attention mechanism or hidden deep network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA bounded logistic output is a mathematical transform, while relevance calibration requires empirical evidence.

Check your understanding

A reranker’s sigmoid output is 0.95 for a document on a new domain. What can be inferred without representative calibration evidence?

Try it yourself

Compute sigmoid outputs for logits zero and negative two and state their order. If ten held-out pairs in a declared confidence bin average prediction 0.8 but only six are judged relevant, calculate the observed bin gap and explain one limitation.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the sigmoid definition and compare the bin’s mean prediction with its observed relevance fraction.

Compare with the solution

The outputs are 0.5 and approximately 0.1192, with the zero-logit item higher. The held-out bin’s observed relevance fraction is 6/10 = 0.6, so the prediction-minus-frequency gap is 0.2. Ten examples provide limited evidence, and sampling, label uncertainty, or class mix can affect the estimate; this observation does not establish a universal correction for every query or document.

Take it with you

  • Cross encoders add joint interaction while retaining candidate-recall and input-visibility limits.
  • Monotone score transforms preserve ordering without proving probability calibration.
  • Thresholds need representative validation at the actual deployed decision boundary.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.