CPRM: A LLM-based Continual Pre-training Framework for Relevance Modeling in Commercial Search

Kaixin Wu, Yixin Ji, Zeyuan Chen, Qiang Wang, Cunxiang Wang, Hong Liu, Baijun Ji, Jia Xu, Zhongyi Liu, Jinjie Gu, Yuan Zhou, Linjian Mo

Introduction

In commercial search ecosystems, such as the "mini-app" platforms of Alipay or WeChat, relevance modeling is critical for matching user intent with appropriate items. However, standard Large Language Models (LLMs) struggle with three primary challenges: the semantic gap between colloquial user queries and formal structured item data, domain blindness regarding specific commercial ecosystems, and task agnosticism in standard pre-training objectives.

CPRM (Continual Pre-training for Relevance Modeling) addresses these hurdles by moving beyond simple fine-tuning. It introduces a specialized pre-training phase designed to teach the model how to process search relevance through domain-specific knowledge injection and a novel in-context strategy.

Methodology

The CPRM framework is built upon three core modules for continual pre-training:

Domain Knowledge Enhancement (DKE)

DKE focuses on bridging the gap between structured product data and user search patterns. The model is jointly pre-trained on structured fields (titles, keywords, descriptions) and their most frequent corresponding queries using a masked language modeling (MLM) objective. This forces the model to learn the semantic relationships between different product attributes and real-world search terminology.

Input representation for Domain Knowledge Enhancement (DKE) showing multi-field item structure.

In-Context Pre-training (ICP)

Unlike standard training on isolated query-item pairs, ICP trains the model on sequences of semantically similar queries or items derived from user click logs. This approach mimics the "in-context learning" capabilities used during inference, teaching the model to leverage surrounding context to refine its relevance predictions.

The three-stage process of In-Context Pre-training (ICP): Semantic Computing, Filtering & Reordering, and Prompting.

Reading Comprehension Distillation (RCD)

To address sparse or low-quality structured data, CPRM employs a "Teacher LLM" (Qwen2-72B) to perform reading comprehension on items. The teacher generates high-quality summaries, paraphrases, and synthetic queries, which are then used to train the smaller "Student" model (GLM-2B), effectively distilling complex reasoning capabilities into a more efficient architecture.

Experimental Setup

The framework was evaluated using massive real-world datasets from Ant Group. Pre-training involved 4 million samples each for DKE and ICP, plus 500,000 RCD-generated samples. Supervised Fine-Tuning (SFT) was conducted on a human-annotated dataset of 625,000 triplets. Baselines included industry standards such as DSSM, BERT, GLM-10B, and Qwen2-7B.

Results and Discussion

Offline and Online Performance

CPRM (2B) achieved a state-of-the-art F1 score of 94.42% and an AUC of 93.49%, notably surpassing the larger GLM-10B baseline. This demonstrates that high-quality, domain-specific pre-training can outweigh raw parameter count. In online A/B testing, the model delivered a 0.32% increase in valid Page View Click-Through Rate (PVCTR) and a 4.71% reduction in the Error Filtering Rate.

Handling the Long Tail

A key insight was the model's robustness with long, complex queries (15+ words). CPRM improved AUC in this segment by over 15% compared to baselines, suggesting that the DKE and RCD modules successfully taught the model to parse intricate semantic dependencies.

System Efficiency

To meet real-time latency requirements, a hybrid deployment strategy was used. While a 0.3B model handles live traffic, the 2B CPRM model performs offline scoring and caching for historical query-item pairs, covering over 60% of total requests.

Conclusion

CPRM demonstrates that continual pre-training with domain-specific context is a highly effective strategy for relevance modeling. Future work will focus on reducing inference latency for "cold-start" queries and incorporating multi-modal data, such as product images, to further narrow the semantic gap.

Summary updated

BibTeX
@inproceedings{wu2025cprm,
  author = {Kaixin Wu and Yixin Ji and Zeyuan Chen and Qiang Wang and Cunxiang Wang and Hong Liu and Baijun Ji and Jia Xu and Zhongyi Liu and Jinjie Gu and Yuan Zhou and Linjian Mo},
  title = {{CPRM: A LLM-based Continual Pre-training Framework for Relevance Modeling in Commercial Search}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-industry.75},
}
Figure