Abstract
Large Language Models (LLMs) have demonstrated exceptional capabilities in semantic understanding and reasoning, yet their high computational cost prevents direct deployment in real-time e-commerce search systems. This paper introduces ELLM-MKD, a framework that distills the reasoning process of LLMs into smaller, production-ready models. By utilizing Chain-of-Thought (CoT) annotations and multi-dimensional knowledge distillation, the framework enhances the relevance matching of student models while maintaining low latency. Experimental results on Taobao’s search system show significant improvements in ROC-AUC and online Click-Through Rate (CTR), particularly for challenging long-tail queries.
Introduction
In e-commerce, accurately matching products to user queries is critical for user experience and conversion. While traditional models like BERT or ColBERT are efficient for online serving, they often struggle with complex semantic relationships and rare "long-tail" queries. Conversely, LLMs possess the world knowledge necessary to solve these issues but are too slow for real-time applications. Furthermore, standard relevance models often act as "black boxes," offering no explanation for their decisions.
To bridge this gap, the authors propose a framework that uses LLMs as teachers to guide smaller student models. Unlike traditional distillation that only transfers final labels, this approach distills the underlying reasoning process—the "why" behind a relevance judgment.
Methodology: The ELLM-MKD Framework
The proposed framework consists of three primary steps designed to create an explainable and high-performing relevance system.
1. Explainable LLM for Relevance (ELLM-rele)
The process begins by generating high-quality Chain-of-Thought (CoT) annotations using large-scale teacher LLMs (e.g., Qwen2-72B). These models are prompted to break down relevance into specific attributes such as category, brand, gender, and material. A smaller 7B LLM is then fine-tuned (SFT) on these examples to serve as a specialized "teacher" that can consistently explain its reasoning (e.g., "The category matches, but the gender is a mismatch").
2. Multi-dimensional Knowledge Distillation (MKD)
The knowledge from the ELLM-rele teacher is transferred to student models through two main channels:
- Score Distillation: The teacher's output probabilities are normalized into continuous scores, allowing the student to learn the nuance and degree of relevance beyond binary labels.
- CoT Distillation: This is the core innovation. For interaction-based models (like BERT), sequence tagging is used to highlight evidence in the text. For representation-based models (like ColBERT), "Attention Score Regulation" forces the model to focus on keywords identified as critical by the LLM.
Data and Experiments
The framework was evaluated using extensive datasets from Taobao’s ad search logs, including both human-annotated and large-scale unlabeled data.
The CoT reasoning covers 14 sub-dimensions, ensuring a comprehensive evaluation of product-query matches across various attributes like brand, color, and material. The unlabeled dataset of 30 million pairs allows for massive-scale knowledge transfer via pseudo-labeling.
Key Results
The ELLM-MKD framework demonstrated superior performance across multiple benchmarks:
- Teacher Performance: The 7B ELLM-rele teacher outperformed existing baselines, achieving a 0.8% improvement in ROC-AUC over the Walmart-LLM baseline.
- Student Enhancement: Applying MKD to standard BERT and ColBERT models resulted in ROC-AUC gains of 2.6% to 4.1%.
- Long-Tail Success: The most significant impact was observed on low-frequency queries, where the MKD-enhanced ColBERT showed a 4.1% improvement, proving the effective transfer of niche knowledge from the LLM.
- Online Impact: Real-world A/B testing on Taobao confirmed the framework's efficacy, yielding a +0.17% increase in CTR and a +0.89% improvement in relevance "Goodrate."
Conclusion
ELLM-MKD successfully addresses the trade-off between model performance and inference speed in e-commerce search. By treating relevance as a multi-attribute reasoning task rather than a simple classification problem, the framework provides both high accuracy and explainability. Future work will focus on expanding the attribute scope and further narrowing the performance gap between large teacher models and lightweight online students.
Summary updated