TL;DR
This paper introduces BEQUE, a novel three-stage framework for improving e-commerce search by rewriting "long-tail" queries using Large Language Models (LLMs). BEQUE effectively bridges semantic gaps, leading to significant improvements in user experience and revenue on the Taobao platform.
What Problem Does This Paper Address?
In e-commerce, semantic matching is crucial for connecting users with the products they want. However, a significant challenge arises from "long-tail" queries – those that are specific, less frequent, and often phrased in ways that don't directly match product keywords. This "semantic gap" leads to a "few-recall" problem, where users receive few or irrelevant search results, negatively impacting both user satisfaction and sales. Existing query rewriting methods struggle with these long-tail queries, often relying on limited models or generic approaches that don't align with the specific goals of an e-commerce search engine.
Methods
BEQUE tackles the long-tail query rewriting problem through a three-stage framework:
- Multi-instruction Supervised Fine-Tuning (SFT): Instead of using off-the-shelf LLMs, BEQUE fine-tunes them on a custom dataset. This dataset is constructed using rejection sampling to ensure high-quality query-rewrite pairs and is augmented with auxiliary tasks like quality classification, product title prediction, and Chain-of-Thought (CoT) reasoning. This stage aims to imbue the LLM with a deeper understanding of e-commerce query semantics and rewriting nuances.
- Offline Feedback: After the LLM generates multiple candidate rewrites for a given query, these candidates are evaluated using an offline Taobao search system. This system simulates the actual search process to retrieve products for each rewrite. Crucially, the quality of these retrieved product sets is measured using three custom metrics:
- Relevance: Ensures the rewritten query still aligns with the original user intent.
- Increment: Measures how much the rewrite expands the semantic scope, helping to alleviate the "few-recall" issue.
-
Hitrate: Assesses the rewrite's ability to retrieve products that are semantically related but might have been missed by the original query. This feedback provides a partial order of the candidate rewrites based on their effectiveness.
-
Objective Alignment: The partial order from the offline feedback is used to further refine the LLM. A contrastive learning method, specifically a Bradley-Terry based approach, is employed to align the model's generation probabilities with the desired search outcomes. This stage ensures that the model learns to prioritize rewrites that lead to better search performance, as defined by the Taobao online objectives.
Datasets
- Initial Training Data: Approximately 20 million records from Taobao's online rewriting logs.
- Query Rewriting Dataset: 419,806 <query, rewrite> pairs generated through two rounds of rejection sampling.
- Manually Rewritten Data: 155,662 pairs to ensure human preference alignment.
- Multi-instruction SFT Dataset: A combined dataset including the query rewriting data and 50,000 samples each from quality classification, product title prediction, and CoT tasks.
- Alignment Training Dataset: 45,350 candidate rewrites generated from 10,000 queries, scored by the Taobao offline system.
- Test Dataset: 14,981 queries from Taobao search logs, with 50% sampled proportionally and 50% from long-tail queries.
Key Insights and Ideas
- LLMs are powerful but need specialization: While LLMs offer superior semantic understanding, they require fine-tuning and alignment with specific domain objectives (like e-commerce search) to be truly effective and avoid generating noise or hallucinations.
- Offline feedback is critical for e-commerce alignment: Directly using search engine results as a reward signal is more robust than relying solely on manual annotations or generic reward models, as it captures the actual impact on retrieval quality.
- Balancing metrics is key: The paper highlights a trade-off between relevance, increment, and hitrate. Optimizing for one can negatively impact others, necessitating a careful approach to metric alignment, as demonstrated by the analysis of different contrast numbers.
- Long-tail queries are a distinct challenge: The paper emphasizes that methods effective for "top queries" often fail for long-tail queries, underscoring the need for specialized techniques that can handle less common phrasing and expand semantic scope.
Key Results
- Offline Performance: BEQUE demonstrated significant improvements in relevance, increment, and hitrate compared to various baselines, including discriminative methods (CLE-QR), generative models (BART, Qwen), and RL-based approaches. Notably, BEQUE achieved the best performance in increment and hitrate for "Torso" and "Tail" queries.
- Online A/B Test: BEQUE was deployed on Taobao and showed substantial positive impacts:
- Overall, a 0.40% increase in GMV, 0.34% in #Trans, and 0.33% in UV.
- For rewritten queries (covered queries, ~27% of PV), increases were 2.96% in GMV, 1.36% in #Trans, and 1.22% in UV.
- Remarkable improvements for long-tail and "few-recall" queries, with a +18.66% increase in GMV, +5.90% in #Trans, and +6.25% in UV for "few-recall" queries.
Limitations and Future Work
- Deployment Constraints: Due to LLM size and autoregressive nature, BEQUE performs inference offline and uses a key-value graph for online serving. This approach has minimal impact on latency but means not all queries are rewritten.
- Future Work: The paper doesn't explicitly detail future work, but the success of BEQUE suggests potential avenues for further research could include:
- Exploring more efficient online inference methods for LLMs in search.
- Investigating more sophisticated ways to balance the trade-offs between relevance, increment, and hitrate.
- Extending the framework to other e-commerce platforms or search domains.
- Further refining the auxiliary tasks for SFT to capture even more nuanced aspects of query understanding.
Summary updated