Towards Better Query Classification with Multi-Expert Knowledge Condensation in JD Ads Search

Kun-Peng Ning, Ming Pang, Zheng Fang, Xue Jiang, Xi-Wei Zhao, Changping Peng, Zhangang Lin, Jinghe Hu, Jingping ShaoarXiv 2023 · DOI

TL;DR

This paper tackles the challenge of accurately classifying e-commerce search queries in real-time. They propose a novel "Distribution-Diverse Multi-Expert" (DDME) knowledge distillation framework that leverages the strengths of both fast, shallow models (like FastText) for low latency and powerful, deep models (like BERT) for better understanding of complex queries. This approach significantly improves classification performance without sacrificing speed.

What Problem Does This Paper Address?

In e-commerce, understanding user intent through search query classification is crucial for matching users with relevant products and ads. While fast models like FastText are essential for low-latency online inference, they struggle with nuanced or infrequent queries. Conversely, powerful models like BERT excel at understanding complex queries but introduce prohibitive latency. This creates a trade-off: either sacrifice accuracy for speed or speed for accuracy. The paper aims to bridge this gap by developing a method that combines the best of both worlds, achieving high accuracy with low latency.

Methods

The core of the proposed solution is the Distribution-Diverse Multi-Expert (DDME) knowledge distillation framework. This is a Teacher-Student learning approach where:

  • Student Model (FastText): This is the online model, chosen for its efficiency and low latency. It has strong memorization capabilities but weaker generalization.
  • Teacher Models (Multiple BERTs): These are offline models trained on diverse data distributions. They are designed to have strong generalization and semantic understanding.

The DDME framework works in several steps:

  1. Multi-Expert BERT Training: Instead of a single BERT, multiple BERT models are trained on different data distributions (high, middle, and low frequency queries). This allows them to capture a wider range of query characteristics.
  2. Training Data Generation: These diverse BERT "experts" are used to infer potentially relevant labels for historical search queries. This process effectively augments the training data for the student model.
  3. FastText Training: The augmented dataset, enriched with the insights from the BERT experts, is then used to train the FastText student model. This allows FastText to learn from a broader and more informative set of examples.

The paper also introduces a method for updating the page view (PV) matrix to better reflect the newly generated labels.

Datasets

The experiments utilize real-world data from JD.COM, a major e-commerce platform.

  • Training Data: A large dataset of approximately 160 million user queries from historical click-through data. This data is further processed and augmented by the DDME framework.
  • Testing Data: Multiple testing sets are used, including:
  • T+1 and T+30 days: These sets consist of ~2 million user queries, with T+1 containing a high percentage of queries seen in training, and T+30 containing a significant portion of unseen queries.
  • Offline and Online Annotation Sets: Smaller, manually annotated datasets are used for more precise evaluation of relevance.

Key Insights and Ideas

  • FastText as an "Online Dictionary": The paper highlights that FastText, with sufficient parameters, acts like a powerful "online dictionary," excelling at memorizing and classifying queries it has seen before.
  • BERT's Generalization Power: BERT, despite its higher latency, demonstrates superior ability to generalize and understand unseen or low-frequency queries due to its deeper semantic understanding.
  • The Synergy of Diverse Teachers: Training multiple BERT models on different data distributions (high, middle, low frequency) is more effective than a single BERT for generating richer training data. This "distribution-diverse" approach is key to improving the teacher's ability to find relevant, potentially unseen, labels.
  • Knowledge Distillation for Latency Constraints: The DDME framework effectively transfers the semantic understanding from powerful but slow BERT models to a fast FastText model, overcoming the latency barrier for real-time applications.

Key Results

The DDME approach demonstrated significant improvements across various metrics:

  • Offline Performance: The DDME approach consistently outperformed baseline models (FastText, BERT Dict) in terms of P@5 and R@5 on both T+1 and T+30 testing sets. It also showed improvements in accuracy on manually annotated datasets.
  • Online A/B Testing: In real-world A/B tests on JD.com, the DDME approach achieved substantial gains without increasing latency:
  • +1.38% Page View (PV) gain
    • +1.33% Click (CLICK) gain
    • +1.99% Pay (PAY) gain
  • Online Valid Requests: The method also improved the number of search queries that could retrieve advertisements, indicating better retrieval capabilities.

Limitations and Future Work

  • Limitations: The paper acknowledges that while the DDME approach significantly improves performance, it still relies on the quality of the generated data. The effectiveness is tied to the ability of the BERT experts to accurately infer relevant labels. The latency of the FastText model, while low, is still a factor, and further optimizations might be explored.
  • Future Work: The authors suggest that this Teacher-Student paradigm, leveraging diverse data distributions and knowledge distillation, can be applied to other tasks requiring a balance between accuracy and efficiency. Further exploration into optimizing the data distribution splitting and the ensemble strategy of the BERT experts could yield even better results.

Summary updated

BibTeX
@misc{ning2023towards,
  author = {Kun-Peng Ning and Ming Pang and Zheng Fang and Xue Jiang and Xi-Wei Zhao and Changping Peng and Zhangang Lin and Jinghe Hu and Jingping Shao},
  title = {{Towards Better Query Classification with Multi-Expert Knowledge Condensation in JD Ads Search}},
  year = {2023},
  eprint = {2308.01098},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.01098},
}
Figure