Behavior-driven Query Similarity Prediction based on Pre-trained Language Models for E-Commerce Search

Yupin Huang, Jiri Gesi, Xinyu Hong, Kai Zhong, Han Cheng, Vivek Mittal, Qingjun Cui, Vamsi SalakaeCom @ SIGIR 2023

Introduction

In the vast landscape of e-commerce, search engines are the primary gateway for customers to find products. While high-traffic "head" queries provide ample behavioral data (clicks and purchases) for ranking, "tail" queries—rare or highly specific searches—often suffer from data sparsity. Traditional Natural Language Processing (NLP) techniques attempt to solve this by finding semantically similar queries. However, linguistic similarity does not always translate to identical shopping intent. Amazon researchers have addressed this by developing a behavior-driven framework that leverages co-purchase data to train language models, bridging the gap between text and intent.

A significant challenge in e-commerce search is the "vocabulary gap." Customers use a wide variety of terms to describe the same need. For instance, "noise-canceling headphones" and "noise-canceling earbuds" are semantically close but represent distinct product categories. Conversely, queries like "goya lady fingers" and "tiramisu cookies" may appear different to a standard model but reflect the same underlying customer requirement.

Mapping diverse search queries to a central shopping intent.

As shown in the figure above, a single intent like "sunglass trendy woman" can be expressed through brand names, specific shapes, celebrity associations, or social media trends. By using actual customer behavior—specifically co-purchase data—as the ground truth, the proposed framework can link these disparate queries effectively.

Model Architecture and Methodology

The researchers implemented a multi-stage pipeline designed for both accuracy and scale. The core of the approach involves predicting query-to-query (Q2Q) similarity using behavior-based labels derived from massive search logs.

Behavior-Based Labeling

Instead of relying on human annotators, the system uses co-purchase signals. If two queries lead to the purchase of the same product, they are considered similar. Similarity is quantified using a combination of Overlap Similarity and Jaccard Similarity, the latter of which helps mitigate "popularity bias" by preventing generic head queries from dominating results.

Encoding and Similarity Calculation

The architecture utilizes Pre-trained Language Models (PLMs) to encode queries into dense embedding vectors.

The multi-layered architecture for query similarity calculation.

The process involves:

  1. Query Input: Both the search query and candidate queries are fed into the system.
  2. Encoding Layers: Queries are processed through PLMs (such as Amazon's internal A-PLMv2) to generate embedding vectors.
  3. Similarity Calculation Layers: These vectors are then compared to produce a final similarity score.

To balance performance and latency, the system uses a two-stage "Retrieval and Re-ranking" pipeline. A fast Bi-encoder retrieves candidate queries from an Approximate Nearest Neighbor (ANN) graph, which are then re-ranked by a more complex Cross-encoder. Finally, knowledge distillation is used to transfer the accuracy of the Cross-encoder back into a high-speed Bi-encoder for production use.

Key Results and Impact

The behavior-driven approach yielded significant improvements in both offline evaluations and real-world online tests.

  • Offline Performance: The A-PLMv2 model achieved a 27.4% improvement in NDCG@3 compared to standard BERT baselines, demonstrating the value of domain-specific pre-training on e-commerce logs.
  • Online Impact: In A/B testing across 100 million sessions, the system increased search click rates by 0.08% and reduced search reformulations by 0.03%.
  • Category Success: The most notable gains occurred in the clothing and fashion sectors, where identifying relevant similar items is traditionally difficult.

Conclusion and Future Work

By shifting the focus from semantic similarity to behavior-driven intent, this framework significantly enhances the relevance of e-commerce search, particularly for rare tail queries. While the computational cost of indexing billions of queries remains a challenge, the success of knowledge distillation provides a path forward for real-time applications. Future research will explore multi-modal models that incorporate product imagery to further refine similarity predictions.

Summary updated

BibTeX
@inproceedings{huang2023behavior,
  author = {Yupin Huang and Jiri Gesi and Xinyu Hong and Kai Zhong and Han Cheng and Vivek Mittal and Qingjun Cui and Vamsi Salaka},
  title = {{Behavior-driven Query Similarity Prediction based on Pre-trained Language Models for E-Commerce Search}},
  booktitle = {eCom @ SIGIR},
  year = {2023},
}
Figure