Abstract
Modern information retrieval systems typically employ a two-stage pipeline: a fast lexical retriever (e.g., BM25) followed by a computationally intensive neural re-ranker (e.g., BERT). While neural models excel at capturing semantic nuances, they often struggle with exact keyword matching and are limited by input length constraints. This paper explores a simple yet effective method to bridge this gap by injecting the BM25 score directly into the BERT-based re-ranker as a text token. Our proposed model, $CE_{BM25CAT}$, demonstrates significant performance improvements across standard benchmarks like MSMARCO and TREC Deep Learning, providing a robust signal for lexical relevance without increasing computational overhead.
Introduction
In the landscape of large-scale search, the two-stage retrieval architecture is the industry standard. The first stage uses lexical models like BM25 to prune millions of documents down to a few hundred candidates. The second stage utilizes Cross-Encoders (CE), typically based on BERT, to perform a deep semantic analysis of the query-document pairs.
Despite their power, BERT-based re-rankers have two primary weaknesses: a tendency to overlook exact keyword matches in favor of semantic similarity and a strict input token limit (usually 512 tokens) that causes them to ignore the tail end of long documents. Traditionally, practitioners have attempted to mitigate these issues through late-stage score fusion—mathematically combining the BM25 and BERT scores. However, this approach is difficult to tune and often fails to capture the complex relationship between lexical and semantic relevance. This research proposes a more integrated approach: providing the BM25 score as an input feature to the transformer itself.
Methodology: $CE_{BM25CAT}$
The core innovation of this work is the $CE_{BM25CAT}$ architecture. In a standard BERT re-ranker, the input is formatted as:
[CLS] Query [SEP] Document [SEP]
The authors modify this sequence to include the BM25 score as an additional text segment:
[CLS] Query [SEP] BM25 Score [SEP] Document [SEP]
Score Normalization and Representation
Because BM25 scores are unbounded and vary significantly across different queries, they cannot be fed into BERT as raw floating-point numbers. The researchers identified a specific normalization strategy that allows the model to interpret these values effectively:
- Global Min-Max Normalization: BM25 scores across the entire collection are scaled to a range between 0 and 100.
- Integer Conversion: These scaled values are converted into integers (e.g., "42").
By representing the score as a string of digits, the model leverages BERT’s existing vocabulary for numbers. This allows the transformer to "read" the lexical relevance of a document as if it were part of the natural language context.
Experimental Results
The method was evaluated on the MSMARCO Passage Ranking dataset and the TREC Deep Learning (2019 & 2020) benchmarks. The researchers tested the approach across various model sizes, including BERT-base, BERT-large, DistilBERT, and MiniLM.
Performance Gains
The results showed consistent improvements across all architectures. On the MSMARCO DEV set, the MiniLM model saw its MRR@10 increase from 0.360 to 0.367 simply by including the score token. More impressively, in specialized tests focused on exact keyword matching, the $CE_{BM25CAT}$ method outperformed the standard BERT baseline by approximately 9% in nDCG@10.
Interpretability and Numerical Literacy
Using Integrated Gradients, a technique for attributing model predictions to specific input tokens, the authors confirmed that the model pays significant attention to the injected score token. This suggests that BERT is surprisingly "numerate"—it can learn the ordinal relationship between numerical tokens and use that scale to weight the importance of lexical relevance against semantic content.
Discussion
Bridging the Truncation Gap
One of the most significant advantages of this method is its ability to handle long documents. BM25 calculates its score based on the entire document text, whereas BERT is often forced to truncate documents. By injecting the BM25 score, the re-ranker receives a "hint" about the relevance of the document parts it cannot see, effectively extending its reach beyond the 512-token limit.
Zero Computational Overhead
Unlike other methods that involve complex feature engineering or additional neural layers, $CE_{BM25CAT}$ adds only a single token to the input sequence. This results in virtually zero increase in training or inference time, making it a highly efficient "drop-in" improvement for existing production pipelines.
Conclusion
Injecting the BM25 score as text is a deceptively simple modification that yields substantial benefits. It allows BERT-based re-rankers to better balance lexical and semantic signals, improves performance on truncated documents, and avoids the pitfalls of manual score fusion. Future work may explore injecting multiple scores from different retrieval sources (such as dense retrievers) to further enhance the re-ranker's perspective.
Summary updated