How BERT-Based Cross-Encoders Model Relevance in Retrieval
Cross-encoder relevance is mechanically traceable: a handful of attention heads carry the matching signal, relevance reaches [CLS] only in the final layers, and MiniLM leans on non-relevance signals — though the findings cover only BERT-family re-rankers.
On this page
The paper evaluates 3 BERT-based cross-encoders, yet the question it asks is one every re-ranker buyer should ask: why does this passage get a high score? Most people assume a strong re-ranker is a black box — pick the one with the best benchmark numbers, ship it, and worry about explanations later. That works until a query or a document drifts outside the training distribution, and you have no way to tell which part of the model went wrong. This study opens up MonoBERT-base, MonoBERT-large and a MiniLM cross-encoder, and traces how relevance is actually assembled [1].
The default view — black box, ship it — and what the paper asks instead
The usual advice is to treat the re-ranker as a black box: cross-encoders are the most effective models in retrieval, so pick the best-performing one and worry about explanations later. The paper opens on exactly this tension — cross-encoders are the most effective but also the least efficient models in information retrieval, yet the mechanisms behind their relevance predictions remain poorly understood [1]. For end users, opacity is acceptable as long as results are relevant. For researchers and practitioners, it blocks systematic improvement and the diagnosis of failure cases, especially when queries or documents fall out of domain.
The authors turn that motivation into six research questions. The first four are the core; the last two are orthogonal checks meant to stress-test the earlier conclusions.
| Research question | What it asks |
|---|---|
| RQ1 | What is the contribution of the model's components to relevance prediction? |
| RQ2 | How does information flow inside the model, especially through its most important components? |
| RQ3 | Which signals flow through the model and drive relevant versus non-relevant judgments? |
| RQ4 | How is the relevance signal constructed inside the [CLS] representation? |
| RQ5 | How consistent are these mechanisms across cross-encoders of different sizes? |
| RQ6 | How robust are the findings under domain shift? |
Three models, two domain regimes
The study evaluates 3 BERT-based cross-encoders that differ in size and pre-training strategy: MonoBERT-base, MonoBERT-large, and a MiniLM-based cross-encoder. Datasets come in two regimes — in-domain, drawn from the training distribution, and out-of-domain, where queries or documents fall outside it. The out-of-domain side has a concrete motivation: the release of the BEIR benchmark highlighted disparities between in-domain and out-of-domain performance of neural retrieval models [1]. The paper notes that the gap is smaller for cross-encoders than for bi-encoders, but it still exists, and combined with their reliance on semantic knowledge inherited from pre-training it raises the question of whether cross-encoders behave consistently across domains.
Methodologically, the authors combine several interpretability techniques rather than relying on one, because signals inside transformers are entangled and a single tool can mislead: Neuron Integrated Gradients (NIG, which attributes individual neuron contributions along a path to the output), ablation studies that switch a component off and observe the output change, Information Bottleneck Attribution, attention-pattern analysis, and linear discriminant analysis.
A few attention heads and FFN neurons decide the score
RQ1 uses NIG to locate critical components, and the result is layered: some components matter across domains, while others matter specifically out of domain, particularly in larger models. The paper singles out a small number of attention heads and feed-forward network neurons as key to the relevance prediction process.
But the authors point out that a naive use of NIG only tells you which components matter, not what kind of contribution they make — it cannot explain what those components are actually transmitting. That gap leads directly into RQ2.
Relevance does not enter [CLS] directly — it accumulates in query tokens first
RQ2 stacks three tools: a finer-grained version of NIG, an extension of prior ablation analysis, and a variant of Information Bottleneck Attribution. NIG and ablation extract the most salient informational directions, while the information bottleneck provides a more holistic view of the flow.
The results validate the multi-stage process described in prior work across both in-domain and out-of-domain settings, but add crucial detail:
- Prediction begins with contextualization of query and document tokens, and in parallel query-to-document information transfers occur, with document tokens receiving information from query tokens through attention.
- Contrary to prior work, document-to-query transfers are equally important at this stage.
- These transfers last for most of the model's layers, until the later ones.
- Relevance information shared across document and query tokens is not sent directly to [CLS]; it first accumulates in query tokens and is forwarded to [CLS] only in the very last few layers.
- The 'no-op' role of [SEP] is confirmed, and [CLS] is further shown to play a similar role from the early to the middle layers.
Two further findings stand out. Not all cross-encoders use the same process to accumulate relevance inside [CLS]. And MiniLM differs from MonoBERT: it does not appear to rely on relevance signals but rather on non-relevance signals to predict relevance. That difference recurs throughout the paper.
Matching happens in two stages: identical tokens first, semantic neighbors later
RQ3 analyzes the attention patterns of every attention head, contrasting their attributions when exposed to relevant versus non-relevant pairs. The goal is twofold: uncover what the high-attribution heads detect, and find heads specialized for matching signals.
The findings confirm that heads specialized in detecting matching signals do exist, and matching splits into two stages. From early to middle layers, these heads align occurrences of the same token in query and document — syntactic matching. In the last layers, matching happens between semantically contextualized tokens that sit close to each other in representation space — semantic matching. These heads are also among the model's most important components, which confirms the weight of matching signals.
The paper then goes one step further with a mechanistic explanation of why most of these heads behave as they do: their Query-Key circuit favors cross-attention — query to document or document to query — over self-attention, and associates highly similar source and target tokens.
Each model builds its relevance subspace differently
RQ4 targets a key step: when information stored inside query tokens is transferred into the [CLS] representation. The authors study the geometry of hidden-state subspaces to see whether a relevance subspace exists. MiniLM, MonoBERT-base and MonoBERT-large differ in both the construction and the nature of their respective relevance subspaces. A second finding is that relevance signals emerge in the [CLS] token only in the final layers, supporting the view that [CLS] performs a no-op in earlier layers, akin to [SEP].
RQ5 and RQ6 test whether these conclusions generalize across model sizes and domains. The multi-stage process and the existence of matching heads hold up broadly, but the MiniLM non-relevance finding is a clear exception — a reminder not to transplant a mechanism observed in one model onto another without checking.
When this method does not apply
The boundaries deserve stating. First, the study covers only BERT-family cross-encoders — 3 models in total — not every re-ranking architecture. MiniLM already diverges from MonoBERT, so cross-architecture extrapolation needs care. Second, the object of study is the re-ranking stage of a retrieval pipeline; the first-stage retriever is out of scope, so the conclusions cannot be used to explain an entire retrieval system.
Third, the tools have limits. NIG is an attribution method: it estimates contribution magnitude, not causal evidence. Ablations must be run in isolation and then put into perspective against perturbations of surrounding components, which becomes intractable on models much larger than BERT. The authors acknowledge this in their limitations section. Fourth, the mechanistic conclusions rest largely on cross-validation across multiple tools; cross-validation raises confidence but does not constitute proof.
So the method fails when you need a general, architecture-agnostic explanation framework, or when you want to diagnose a non-BERT re-ranker. In those cases the findings are a reference point, not a standard answer [1].
