Abstract
Traditional text retrieval systems often face a trade-off between the efficiency of sparse methods like BM25 and the semantic effectiveness of dense neural models. We present SparTerm, a framework that leverages Pre-trained Language Models (PLMs) to learn sparse, term-based representations directly in the vocabulary space. By unifying term weighting and expansion into an end-to-end differentiable model, SparTerm achieves state-of-the-art performance on large-scale benchmarks while maintaining compatibility with high-speed inverted indexes.
Introduction
The evolution of search engines has been marked by a tension between speed and accuracy. Sparse retrieval methods, such as BM25, are highly efficient and interpretable but suffer from the "lexical mismatch" problem—they cannot match queries to documents that use different but semantically related terms. Conversely, dense retrieval models powered by BERT provide deep semantic understanding but are computationally intensive, requiring specialized vector databases and losing the direct interpretability of word-based indexes.
SparTerm addresses this gap by "upgrading" the traditional sparse index. It transforms documents into sparse vectors where term weights are context-aware and relevant missing terms are automatically added to the representation.
Methodology
SparTerm consists of two primary components: an Importance Predictor and a Gating Controller. These modules work in tandem to produce a final sparse representation $p' = F(p) \odot G(p)$.
Importance Predictor ($F$)
The Importance Predictor uses a BERT-based encoder to predict a weight for every term in the vocabulary (typically ~30,000 tokens). It is initialized with BERT’s Masked Language Model (MLM) weights, allowing the model to leverage pre-existing knowledge of semantic relationships. This module ensures that important words in a specific context receive higher weights.
Gating Controller ($G$)
The Gating Controller acts as a binary mask, determining which terms should be "active" in the final representation. It supports two operational modes:
- Literal-only: Restricts the representation to terms present in the input text.
- Expansion-enhanced: Identifies "expansion terms"—semantically relevant words not present in the original text—to mitigate lexical mismatch.
Experimental Evaluation
The authors evaluated SparTerm on the MSMARCO dataset, the industry standard for large-scale retrieval. The evaluation covered both the Passage Retrieval task (~8.8 million passages) and the Document Retrieval task (~367,000 documents). To ensure rigorous testing, a custom dev set of 1 million passages was used to evaluate full-ranking performance, moving beyond simple re-ranking metrics.
Results and Discussion
SparTerm demonstrated significant improvements over both traditional and neural sparse baselines. On the MSMARCO Passage Retrieval task, the expansion-enhanced SparTerm achieved an MRR@10 of 27.94, outperforming BM25 (18.6) and the previous state-of-the-art sparse model, DeepCT (24.3). It also surpassed Doc2query-T5 despite utilizing a more compact architecture.
Qualitative Analysis
A key advantage of SparTerm is its interpretability. Because it operates in the vocabulary space, the expanded terms can be directly inspected. Qualitative analysis confirms that SparTerm effectively identifies "hidden" important terms. As illustrated in the expansion for "temperature," the model identifies semantically linked terms such as "heat," "humidity," and "weather," which helps resolve lexical mismatch during retrieval.
Conclusion
SparTerm successfully bridges the gap between BERT-level semantic understanding and the efficiency of sparse retrieval. By unifying weighting and expansion in a single framework, it provides a scalable, interpretable, and high-performance solution for modern search systems. Future work will explore scaling to larger vocabularies and integrating even more powerful PLM backbones.
Summary updated