Pathway to Relevance: How Cross-Encoders Implement a Semantic Variant of BM25
Meng Lu, Catherine Chen, Carsten Eickhoff
TL;DR
This work analyzes how a BERT-based cross-encoder estimates document relevance and asks whether traditional IR signals like $TF$ and $IDF$ are embedded in neural models. Using mechanistic interpretability, the authors causal-ly locate BM25-like components: soft-TF in early/middle layers, $IDF$ encoded in a dominant embedding direction via a low-rank representation, and a BM25-style aggregation in later layers. They formalize a BM25-like linear function and demonstrate a strong linear-model fit to cross-encoder scores with $r = 0.8157$ ($p < 0.001$), exceeding a tuned BM25 baseline ($r = 0.4200$) and generalizing across 12 IR datasets. The findings reveal a two-stage relevance computation with practical implications for targeted model editing, personalization, bias mitigation, and parameter-efficient adaptation, advancing transparency and controllability in transformer-based IR.
Abstract
Mechanistic interpretation has greatly contributed to a more detailed understanding of generative language models, enabling significant progress in identifying structures that implement key behaviors through interactions between internal components. In contrast, interpretability in information retrieval (IR) remains relatively coarse-grained, and much is still unknown as to how IR models determine whether a document is relevant to a query. In this work, we address this gap by mechanistically analyzing how one commonly used model, a cross-encoder, estimates relevance. We find that the model extracts traditional relevance signals, such as term frequency and inverse document frequency, in early-to-middle layers. These concepts are then combined in later layers, similar to the well-known probabilistic ranking function, BM25. Overall, our analysis offers a more nuanced understanding of how IR models compute relevance. Isolating these components lays the groundwork for future interventions that could enhance transparency, mitigate safety risks, and improve scalability.
