Abstract
Retrieving relevant items that match users’ queries from billion-scale corpus forms the core of industrial e-commerce search systems, in which embedding-based retrieval (EBR) methods are prevailing. These methods adopt a two-tower framework to learn embedding vectors for query and item separately and thus leverage efficient approximate nearest neighbor (ANN) search to retrieve relevant items. However, existing EBR methods usually ignore inconsistent user behaviors in industrial multi-stage search systems, resulting in insufficient retrieval efficiency with a low commercial return. To tackle this challenge, we propose to improve EBR methods by learning Multi-level Multi-Grained Semantic Embeddings (MMSE). We propose the multi-stage information mining to exploit the ordered, clicked, unclicked and random sampled items in practical user behavior data, and then capture query-item similarity via a post-fusion strategy. We then propose multi-grained learning objectives that integrate the retrieval loss with global comparison ability and the ranking loss with local comparison ability to generate semantic embeddings. Both experiments on a real-world billion-scale dataset and online A/B tests verify the effectiveness of MMSE in achieving significant performance improvements on metrics such as offline recall and online conversion rate (CVR).
Introduction
Industrial e-commerce search systems typically follow a multi-stage pipeline: retrieval, followed by pre-ranking and ranking. Embedding-Based Retrieval (EBR) models are the standard for the initial stage, typically trained to distinguish clicked items from randomly sampled negatives. However, this approach creates a consistency gap. Standard models often ignore two critical signals: Ordered Items, which represent the highest user intent and business value, and Unclicked Items, which serve as "hard negatives"—items that were exposed to the user but rejected despite being semantically similar to the query.
Ignoring these signals leads to a retrieval stage that provides suboptimal candidates for downstream ranking models, ultimately limiting the system's conversion potential. To address this, we introduce MMSE (Multi-stage Multi-Grained Semantic Embeddings), a framework designed to bridge the gap between retrieval and ranking by training on a full spectrum of user behaviors.
Methodology
Multi-stage Information Mining
Instead of a binary classification, MMSE categorizes items into four levels of relevance based on user behavior:
- Ordered ($P_o$): Purchased items (highest relevance).
- Clicked ($P_c$): Items interacted with but not purchased.
- Unclicked ($P_u$): Items exposed but not clicked (hard negatives).
- Negative ($P_n$): Randomly sampled items (easy negatives).
By explicitly modeling these levels, the retrieval model learns finer decision boundaries. Unclicked items are recognized as being semantically closer to the query than random negatives, yet still distinct from clicked items by a margin $\Delta$.
Multi-grained Learning Objectives
The MMSE architecture utilizes a two-tower framework with 4-layer Transformers. To preserve the hierarchy of user behaviors, we integrate four distinct loss functions into a multi-grained objective:
- Global Comparison (Retrieval Losses): Softmax cross-entropy is applied to clicked-negative ($L_{cn}$) and unclicked-negative ($L_{un}$) pairs, ensuring the model can distinguish relevant items from the vast corpus.
- Local Comparison (Ranking Losses):
- Hinge Loss ($L_{cu}$): Enforces a margin between clicked and unclicked items.
- Bayesian Personalized Ranking (BPR) Loss ($L_{ou}$): Specifically handles the sparsity of "ordered" data to ensure purchased items are ranked higher than those merely clicked or unclicked.
The final loss is a weighted sum: $\mathcal{L} = L_{cn} + L_{un} + L_{cu} + L_{ou}$. A post-fusion strategy ensures all item types are projected into a shared embedding space using a shared item tower.
Experimental Results
Offline Evaluation
The model was evaluated on a massive dataset from JD.com, comprising over one billion samples and hundreds of millions of users and items. MMSE demonstrated significant improvements in retrieval accuracy. Specifically, the batch-top@1 metric increased from 0.8898 (base RSR) to 0.9303 with the addition of MMSE.
Online A/B Tests
In a 10-day live test on the JD.com search engine, MMSE achieved substantial business impact:
- +2.0% increase in the number of items passing to the pre-ranking stage.
- +0.30% increase in Conversion Rate (CVR).
- +0.47% increase in UV-value (Revenue per Unique Visitor).
Conclusion
MMSE effectively addresses the consistency gap in industrial search systems by leveraging multi-stage user behavior data. By combining global retrieval losses with local ranking losses, the framework produces more nuanced semantic embeddings that better align retrieval with final business objectives like purchases. Future work will explore deeper integration with downstream ranking signals to further optimize the search pipeline.
Summary updated