Lightweight Composite Re-Ranking for Efficient Keyword Search with BERT

Yingrui Yang, Yifan Qiao, Jinjin Shao, Xifeng Yan, Tao Yang

TL;DR

This paper introduces BECR, a lightweight re-ranking model that combines deep contextual embeddings from BERT with traditional lexical features. BECR achieves competitive relevance for keyword search while significantly reducing computational cost, making it suitable for CPU-only environments without GPUs.

What Problem Does This Paper Address?

Modern search engines rely on sophisticated ranking models, often leveraging powerful transformer architectures like BERT, to deliver highly relevant results. However, these models are computationally expensive, especially during online inference, posing a challenge for achieving low latency, particularly on hardware without dedicated GPUs. This paper addresses the critical trade-off between relevance and efficiency in document re-ranking, aiming to develop a fast, CPU-friendly model that doesn't sacrifice too much accuracy.

Methods

BECR tackles the efficiency problem by decomposing queries and composing query representations from pre-computed token embeddings (uni-grams and skip-n-grams). This avoids expensive BERT computations during online inference. The model then combines this lightweight query representation with:

  • Deep contextual soft matching: Similar to CEDR-KNRM, it uses BERT embeddings but with a simplified scoring mechanism.
  • Lexical matching: Incorporates traditional features like BM25 scores and term proximity.
  • Other features: Includes document-specific signals like PageRank.

The final ranking score is an additive combination of these components. For storage efficiency, BECR utilizes locality-sensitive hashing (LSH) for embedding compression and explores using fewer BERT layers.

Datasets

The paper evaluates BECR on three standard TREC datasets for ad-hoc search:

  • Robust04: News articles.
  • ClueWeb09-Cat-B: Web pages.
  • MS MARCO: Passages from Bing search logs.

The MS MARCO dataset is noted for its longer queries and shorter documents compared to the others. TREC DL19 and DL20 datasets were also used for evaluation.

Key Insights and Ideas

  • Query Decomposition for Efficiency: Decomposing queries into pre-computed token embeddings is a viable strategy to drastically reduce online inference cost without a massive hit to relevance.
  • Hybrid Approach is Key: Combining deep contextual signals with traditional lexical features is crucial for maintaining high relevance when simplifying the neural component.
  • CPU-Friendly is Achievable: BECR demonstrates that high-performance re-ranking can be achieved on CPUs, opening doors for more accessible and energy-efficient search systems.
  • LSH for Storage Savings: Locality-Sensitive Hashing is highly effective in compressing embedding storage, making large-scale deployment more feasible.

Key Results

  • Relevance: BECR achieves competitive relevance, often outperforming or being comparable to strong baselines like CEDR-KNRM and ColBERT on ClueWeb09-Cat-B and Robust04. While there's a slight degradation on MS MARCO, it's considered a reasonable trade-off for efficiency.
  • Inference Speed: On a CPU, BECR with LSH and 5 BERT layers achieves inference times in the tens of milliseconds, significantly faster than BERT-based models that require GPU. For example, it's 4x-9x faster than ColBERT in inference time.
  • Storage: LSH compression reduces document embedding storage from terabytes to gigabytes, making it practical for production environments. For instance, storage can be reduced to about 7.0TB for 50 million documents.
  • Component Contributions: Removing the lexical component ($S_{lexi}$) leads to the most significant relevance degradation, highlighting its importance. The deep soft matching ($S_{deep}$) also plays a vital role.

Limitations and Future Work

  • MS MARCO Relevance: The paper notes a slight relevance degradation on MS MARCO, potentially due to the dataset's limited relevance judgments per query.
  • Disk I/O: While inference is fast, fetching pre-computed embeddings from disk still incurs a noticeable cost, and disk I/O contention can be an issue with high query loads.
  • Future Work: The authors suggest further optimizing embedding storage and exploring more sophisticated methods for combining the different scoring components. Investigating machine learning-based approaches for determining embedding composition weights is also mentioned.

Summary updated

BibTeX
@inproceedings{yang2022lightweight,
  author = {Yingrui Yang and Yifan Qiao and Jinjin Shao and Xifeng Yan and Tao Yang},
  title = {{Lightweight Composite Re-Ranking for Efficient Keyword Search with BERT}},
  booktitle = {WSDM},
  year = {2022},
  doi = {10.1145/3488560.3498495},
}
Figure