Abstract
Dense retrieval systems, typically powered by models like BERT, offer high accuracy but suffer from significant computational overhead, often necessitating expensive GPU infrastructure. This paper investigates the viability of using sparse language models as "drop-in" replacements for standard dense models in retrieval tasks. By leveraging oBERT (a pre-sparsified BERT variant) and the DeepSparse inference engine, the researchers demonstrate a 4.3x speedup in queries per second (QPS) on commodity CPUs with negligible impact on retrieval accuracy (typically less than a 1% drop). These findings suggest a path toward more sustainable and cost-effective deployment of state-of-the-art information retrieval systems.
Introduction
Modern Information Retrieval (IR) has transitioned toward "dense retrieval," where models like BERT encode queries and documents into high-dimensional vector spaces. While highly effective at capturing semantic meaning beyond simple keyword matching, these systems impose a "GPU Tax." Scaling such models for production environments is often prohibitively expensive and energy-intensive.
While model pruning is a known technique to reduce complexity, it typically requires specialized expertise. This research explores whether off-the-shelf sparse models can be utilized for dense retrieval without complex custom setups or significant performance degradation. The goal is to achieve high-throughput inference on standard CPUs.
Methodology
The authors utilized Sparse Transfer Learning, specifically employing oBERT, a version of BERT-base sparsified during its initial pre-training. Two sparsity configurations were evaluated:
- 90% Unstructured Sparsity: Randomly zeroing out 90% of model weights.
- 80% Block Sparsity: Removing weights in structured blocks to better align with hardware optimization.
To realize actual latency improvements on CPUs, the team used DeepSparse, an inference engine optimized to skip zero-valued weights in sparse networks. The models were integrated into the Tevatron framework for training and evaluation. The researchers also compared "tied" vs. "untied" bi-encoders, finding that sharing weights between query and document encoders helped maintain model expressiveness despite high sparsity.
Datasets and Evaluation
The approach was validated across three benchmark datasets for Open-Domain Question Answering (ODQA) and passage retrieval:
- MSMARCO V1.1: Real-world Bing search queries.
- Natural Questions (NQ): Google Search queries paired with Wikipedia passages.
- TriviaQA: Question-answer-evidence triples for reading comprehension.
Results and Discussion
The primary finding is that sparse models can serve as effective drop-in replacements for dense models. As shown in Figure 1, the relative retrieval accuracy remains remarkably stable even as the throughput (Queries Per Second) increases significantly.
Performance Gains and Accuracy
The combination of oBERT (90% sparse) and the DeepSparse engine achieved a 4.3x increase in QPS on an Intel Xeon CPU compared to the standard BERT-base on PyTorch. Notably, switching to the DeepSparse engine alone (without model sparsity) provided a 1.7x speedup, highlighting the importance of sparsity-aware software.
On the MSMARCO dataset, the 90% sparse model achieved 70.04% Recall@100, slightly exceeding the dense baseline of 69.80%. Across all benchmarks, the accuracy delta was typically less than 1%. This demonstrates that high levels of sparsity do not necessarily compromise the semantic representation capabilities required for effective retrieval.
Limitations and Future Work
A significant hurdle identified was quantization collapse. Attempting to combine sparsity with 8-bit integer quantization led to a total failure in retrieval accuracy. Future research is needed to reconcile these two compression techniques to unlock even greater efficiency. Additionally, while this work focused on BERT-base bi-encoders, extending these findings to cross-encoders and larger language models (LLMs) remains an open area for exploration.
Summary updated