Towards Personalized and Semantic Retrieval: An End-to-End Solution for E-commerce Search via Embedding Learning

Han Zhang, Songlin Wang, Kang Zhang, Zhiling Tang, Yunjiang Jiang, Yun Xiao, Weipeng Yan, Wen-Yun Yang

TL;DR

JD.com researchers present DPSR (Deep Personalized and Semantic Retrieval), a production-scale embedding learning system that moves beyond simple keyword matching. By using a multi-head two-tower neural network and optimized negative sampling, DPSR significantly improves search relevance and personalization, boosting conversion rates by over 10% for difficult "long-tail" queries.

What Problem Does This Paper Address?

In e-commerce, search is the primary engine of discovery. However, traditional search engines rely heavily on inverted indexes and term matching (like BM25). This leads to two major hurdles:

  1. The Semantic Gap: Users often search for concepts, not just keywords. A query for "cellphone for grandpa" might not match an item titled "Senior-friendly mobile device," even though they are semantically identical.
  2. Lack of Personalization: Traditional indexes treat every user the same. A search for "T-shirt" should ideally surface different results for a teenage girl versus an adult man based on their past behavior and profiles.

While deep learning has revolutionized the ranking stage of search, applying it to the retrieval stage (sifting through billions of items to find the top few thousand) is incredibly difficult due to strict latency requirements and the sheer scale of the data.

Methods

The authors propose a Two-Tower Architecture, where one neural network (the Query Tower) encodes the user's intent and another (the Item Tower) encodes product features.

Figure 3: Overview of our DPSR retrieval system.

Key innovations include:

  • Multi-head Query Tower: Instead of one embedding, the query tower produces $K$ different embeddings. This allows the model to capture multiple intents for polysemous queries (e.g., "Apple" could mean the fruit or the tech brand).
  • Attention-based Loss: They use a "soft dot product" interaction. This weights the multiple query heads against a single item embedding, allowing the system to learn which "head" is most relevant for a specific item.
  • Hybrid Negative Sampling: Training retrieval models requires "negative" examples (items the user didn't want). DPSR mixes Random Negatives (sampled from the whole catalog) with Batch Negatives (reusing positive items from other queries in the same training batch). This balance is crucial for teaching the model to distinguish between relevant items and popular-but-irrelevant ones.
  • System Engineering: To make this work at JD.com's scale, they implemented a custom C++ tokenizer for online/offline consistency and a proxy-based sharding system to serve hundreds of different models simultaneously with sub-20ms latency.

Datasets

  • JD.com Click Logs: The primary training set consists of 60 days of user sessions, totaling 5.6 billion sessions.
  • Human Supervision Data: They incorporated human-labeled "bad cases," skipped items from logs, and domain-specific pairs (e.g., ensuring "iPhone 11" is a positive match for "newest large screen iPhone").
  • Evaluation Set: A separate dataset of 500 difficult "long-tail" queries was manually labeled by experts to verify semantic improvements.

Key Insights and Ideas

  • The Multi-Head Advantage: The multi-head design is a powerful way to handle ambiguity. As shown in their t-SNE visualizations, different heads naturally learn to cluster different brands or product categories for the same query.
t-SNE visualizations of retrieval results for polysemous queries
  • The Popularity Trade-off: The ratio of random negatives ($\alpha$) acts as a "knob" for popularity. Increasing random negatives pushes the model to retrieve more popular items, which often improves global metrics but can hurt niche relevance.
  • Simplicity Wins in Production: While the authors tested complex models like RNNs and Transformers, they found that a well-tuned Multi-Layer Perceptron (MLP) was more efficient for industrial serving, allowing them to process more data with fewer machines.

Key Results

DPSR was deployed to JD.com's production environment in 2019, yielding impressive gains:

  • Conversion Boost: An overall increase of +1.29% in User Conversion Rate (UCVR) and +2.19% in Gross Merchandise Value (GMV).
  • Long-Tail Success: For rare or complex queries, the UCVR jumped by +10.03%, proving the system's ability to handle semantic nuances that stymie keyword search.
  • Efficiency: The system achieves a total retrieval latency of 15–20 milliseconds for 15 million items, making it as fast as traditional inverted index lookups.

Limitations and Future Work

The authors note that this work focuses exclusively on the candidate retrieval stage. While DPSR provides high-quality candidates, the final order is still determined by a downstream ranking stage.

Future work includes:

  • Tighter integration between the retrieval and ranking objectives.
  • Exploring more advanced encoders (like BERT-style transformers) as hardware acceleration for deep learning continues to improve, potentially overcoming the current latency trade-offs of complex models.

Summary updated

Abstract

Nowadays e-commerce search has become an integral part of many people's shopping routines. Two critical challenges stay in today's e-commerce search: how to retrieve items that are semantically relevant but not exact matching to query terms, and how to retrieve items that are more personalized to different users for the same search query. In this paper, we present a novel approach called DPSR, which stands for Deep Personalized and Semantic Retrieval, to tackle this problem. Explicitly, we share our design decisions on how to architect a retrieval system so as to serve industry-scale traffic efficiently and how to train a model so as to learn query and item semantics accurately. Based on offline evaluations and online A/B test with live traffics, we show that DPSR model outperforms existing models, and DPSR system can retrieve more personalized and semantically relevant items to significantly improve users' search experience by +1.29% conversion rate, especially for long tail queries by +10.03%. As a result, our DPSR system has been successfully deployed into JD.com's search production since 2019.
BibTeX
@inproceedings{zhang2020towards,
  author = {Han Zhang and Songlin Wang and Kang Zhang and Zhiling Tang and Yunjiang Jiang and Yun Xiao and Weipeng Yan and Wen-Yun Yang},
  title = {{Towards Personalized and Semantic Retrieval: An End-to-End Solution for E-commerce Search via Embedding Learning}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2020},
  doi = {10.1145/3397271.3401446},
}
Figure