[Paper Review] Pre-trained Language Model for Web-scale Retrieval in Baidu Search
This paper presents a production-ready retrieval system for Baidu Search that leverages the ERNIE pre-trained language model to enhance semantic matching in web-scale retrieval. By employing a Transformer-based bi-encoder with a multi-stage training paradigm and a unified deployment workflow, the system significantly improves retrieval effectiveness—especially for low-frequency and natural language queries—demonstrating substantial gains in online user engagement metrics like click-through rate and dwell time.
Retrieval is a crucial stage in web search that identifies a small set of query-relevant candidates from a billion-scale corpus. Discovering more semantically-related candidates in the retrieval stage is very promising to expose more high-quality results to the end users. However, it still remains non-trivial challenges of building and deploying effective retrieval models for semantic matching in real search engine. In this paper, we describe the retrieval system that we developed and deployed in Baidu Search. The system exploits the recent state-of-the-art Chinese pretrained language model, namely Enhanced Representation through kNowledge IntEgration (ERNIE), which facilitates the system with expressive semantic matching. In particular, we developed an ERNIE-based retrieval model, which is equipped with 1) expressive Transformer-based semantic encoders, and 2) a comprehensive multi-stage training paradigm. More importantly, we present a practical system workflow for deploying the model in web-scale retrieval. Eventually, the system is fully deployed into production, where rigorous offline and online experiments were conducted. The results show that the system can perform high-quality candidate retrieval, especially for those tail queries with uncommon demands. Overall, the new retrieval system facilitated by pretrained language model (i.e., ERNIE) can largely improve the usability and applicability of our search engine.
Motivation & Objective
- To address the challenge of semantic matching in large-scale web retrieval, where traditional keyword-based methods like BM25 fail to capture paraphrased or semantically similar content.
- To improve retrieval performance for low-frequency, tail queries that are difficult to model due to limited training signals.
- To design a practical, scalable system architecture that enables deployment of a pre-trained language model (ERNIE) in a real-world, high-traffic search engine.
- To integrate semantic matching with conventional text matching and statistical features to enhance candidate relevance and system robustness.
Proposed method
- The system uses an ERNIE-based bi-encoder with separate encoders for queries and documents, leveraging the deep self-attention mechanism of the Transformer to model fine-grained semantic representations.
- A multi-stage training paradigm is employed, using diverse data sources and objectives to progressively improve model generalization, especially for rare or out-of-vocabulary queries.
- The retrieval pipeline combines semantic matching with traditional BM25 retrieval, enabling a hybrid candidate generation strategy that balances recall and precision.
- A lightweight post-retrieval filtering module is introduced to unify statistical features (e.g., click-through rate, dwell time) for refining top candidates after initial retrieval.
- The system is deployed in a production environment with a scalable infrastructure that supports low-latency inference on billion-scale web corpora.
- The model is fine-tuned using a poly-interaction scheme and data mining strategies to enhance relevance prediction between query-document pairs.

Experimental results
Research questions
- RQ1Can a pre-trained language model like ERNIE significantly improve semantic matching in web-scale retrieval compared to traditional keyword-based methods?
- RQ2How does multi-stage training enhance the generalization of a retrieval model, particularly for low-frequency or tail queries?
- RQ3To what extent can integrating semantic and statistical features in a post-retrieval filtering stage improve final result quality?
- RQ4Does the proposed system architecture enable effective and efficient deployment of a PLM-based retrieval model in a real-world search engine?
Key findings
- The ERNIE-based retrieval model improved the normalized discounted cumulative gain (DCG) by +0.17% on random queries and +0.22% on tail queries in offline evaluation.
- The post-retrieval filtering module contributed +0.10% to DCG on random queries and +0.65% on tail queries, showing stronger impact on rare queries.
- In manual evaluation, the new system achieved a +3.50% relative improvement in Good vs. Same vs. Bad (GSB) score on random queries and +7.50% on tail queries, indicating significant quality gains.
- Online A/B testing showed a 0.31% increase in total clicks, a 0.57% increase in click-and-stay behavior, and a 0.62% increase in average post-click dwell time, all with p < 0.05.
- The system demonstrated larger improvements on long, natural language queries compared to short queries, indicating better handling of conversational and complex queries.
- The combination of ERNIE-based retrieval and post-retrieval filtering led to statistically significant gains across all metrics, confirming the effectiveness of the hybrid architecture.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.