Pre-training Tasks for User Intent Detection and Embedding Retrieval in E-commerce Search

Yiming Qiu, Chenyu Zhao, Han Zhang, Jingwei Zhuo, Tianhao Li, Xiaowei Zhang, Songlin Wang, Sulong Xu, Bo Long, Wen-Yun Yang

This paper, presented at CIKM '22 by researchers at JD.com, tackles a common frustration in industrial NLP: why "state-of-the-art" models like BERT often stumble when applied to the messy, ungrammatical world of e-commerce.

TL;DR

Researchers at JD.com developed customized pre-training tasks—Random Substring Classification (RSC) and Random Substring Retrieval (RSR)—to bridge the gap between general-purpose language models and e-commerce search. By training on "synthetic queries" derived from product titles, they achieved significant gains in user intent detection and product retrieval, even with models small enough to run efficiently on CPUs.

What Problem Does This Paper Address?

Standard Transformer models (like BERT) are typically pre-trained on clean, grammatical corpora like Wikipedia. However, e-commerce data is a different beast entirely. The authors identify two primary hurdles:

  1. The Grammar Gap: E-commerce text is "grammatically disastrous." Product titles are often a "keyword soup" of repetitive attributes (e.g., "Ginseng seeds... Changbai Mountain ginseng seeds... Medicinal seeds"), and user queries are short and fragmented. A model trained on the King James Bible or Wikipedia doesn't know how to handle this.
  2. The Long-Tail Problem: Many queries are rare ("long-tail") or involve "cold-start" brands. Without specific pre-training, models lack the semantic "common sense" to categorize these queries correctly.
  3. The Production Constraint: In a high-traffic system like JD.com, serving a full 12-layer BERT model on GPUs for every search is prohibitively expensive. They needed a solution that worked for smaller, 4-layer models running on CPUs.

Methods

The core innovation lies in how the authors generate "synthetic" training data from their own product catalog.

  • Random Substring Classification (RSC): To train the User Intent module, the authors take a product title (e.g., "SAMSUNG Galaxy A32 5G Awesome White") and extract a random substring (e.g., "A32 5G Awesome"). They then task the model with predicting the product's category (Telephone). This forces the model to learn which keywords actually signal intent.
  • Random Substring Retrieval (RSR): For the Embedding Retrieval module (a "two-tower" architecture), they use a similar approach. The model learns to map a random substring (the synthetic query) to the embedding of the full product title.
  • Masked Language Modeling (MLM): They retain the standard BERT task of predicting hidden words but apply it to their domain-specific "keyword soup" corpus.
  • Fine-tuning: After pre-training on these synthetic tasks, they fine-tune the models using real-world user click logs, where a "positive" result is a category or product a user actually clicked on.

Datasets

The authors used internal data from JD.com, one of the world's largest e-commerce platforms:

  • Pre-training: ~566k examples consisting of item titles and categories.
  • Fine-tuning: Click logs containing ~180k queries for intent detection and ~667k pairs for retrieval.
  • Evaluation: Two sets of 10,000 queries—one "Overall" (randomly sampled) and one "Long-tail" (rare queries).
  • Open Source: The authors have released a subset of their data to help the research community.

Key Insights and Ideas

  • Substrings as Proxies: The "aha moment" is realizing that a random slice of a product title looks and acts a lot like a real user query. By using these as synthetic queries, the authors created a virtually infinite supply of labeled training data.
  • Domain Specificity Trumps Model Size: A 4-layer model pre-trained on e-commerce substrings outperformed a standard 12-layer BERT model. This proves that what a model learns is often more important than how many parameters it has.
  • Abolishing NSP: The authors found that BERT’s "Next Sentence Prediction" (NSP) task was useless for e-commerce, as product titles don't have a "next sentence" structure. Dropping it simplified training without hurting performance.

Key Results

The customized pre-training delivered impressive gains across the board:

  • Intent Detection: Their 12-layer model improved the F1 score by 10.4% over a model with no pre-training and 4.6% over the official Chinese BERT (BERT-zh).
  • Long-Tail Performance: The gains were even more pronounced on rare queries, where the RSC task helped the model "guess" the category of unfamiliar brands based on surrounding keywords.
  • Online Impact: In a 30-day A/B test on JD.com's live traffic, the new intent detection module increased Gross Merchandise Value (GMV) by 0.799% and the click-through rate (CTR) by 0.811%. In the world of massive e-commerce, sub-1% gains represent millions of dollars in revenue.

Limitations and Future Work

  • Ranking Module: This paper focuses on the "retrieval" and "processing" stages. The authors did not apply these pre-training tasks to the final "Ranking" module, which uses thousands of other features (like user history and popularity).
  • Language: The study was conducted on Chinese e-commerce data. While the logic should hold for English, the specific behavior of "keyword soup" titles may vary across languages.
  • Future Directions: The authors suggest that these synthetic substring tasks could be applied to other modules, such as query suggestion or automated product description generation.

Summary updated

BibTeX
@inproceedings{qiu2022pre,
  author = {Yiming Qiu and Chenyu Zhao and Han Zhang and Jingwei Zhuo and Tianhao Li and Xiaowei Zhang and Songlin Wang and Sulong Xu and Bo Long and Wen-Yun Yang},
  title = {{Pre-training Tasks for User Intent Detection and Embedding Retrieval in E-commerce Search}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2022},
  url = {https://openreview.net/forum?id=DFQgopdwda},
}

Loading related content...

Figure