Abstract
Query intent classification in e-commerce is frequently hindered by long-tail queries involving obscure brands or specific model numbers. Traditional retrieval-augmented methods rely on non-differentiable external indices, which prevents seamless end-to-end optimization. This paper introduces Dragan (Differentiable Retrieval Augmentation via Generative lANguage modeling), a framework that replaces physical vector indices with a generative "fragment" model. By utilizing the Gumbel-softmax trick, Dragan makes the retrieval process fully differentiable, allowing the model to "hallucinate" relevant product context. Experimental results demonstrate that Dragan significantly outperforms state-of-the-art baselines, particularly on long-tail queries, while maintaining high inference efficiency.
Introduction
In e-commerce, users often search using cryptic terms like "lomography" or model numbers such as "BCD-253WDPDU1." Standard language models struggle with these "long-tail" terms because they appear infrequently in training data. While Retrieval Augmentation—looking up queries in an external product catalog—is a common solution, existing methods like REALM or ORQA rely on Maximum Inner Product Search (MIPS) over massive, non-differentiable embedding indices. Updating these indices during training is computationally prohibitive and often results in sub-optimal performance due to the lack of joint optimization between the retriever and the classifier.
The Dragan Framework
Dragan addresses these limitations by treating the product catalog as a generative memory rather than an external database. Instead of searching a physical index, the model learns to generate the knowledge it needs. The architecture is composed of three differentiable components:
- Start Position Predictor: This module predicts the optimal starting point for a useful piece of information within a hypothetical product title. It employs the Gumbel-softmax trick to ensure the selection process remains differentiable.
- Neural Knowledge Generator: A transformer-based decoder that generates a "synthetic fragment"—a short, high-impact string of tokens (e.g., "Monitor Q2790P")—starting from the predicted position.
- Knowledge-Augmented Classifier: This final stage combines the original query with the generated fragments to predict the product category (e.g., "Electronics").
By focusing on short fragments rather than full product titles, the model avoids "semantic drift" and remains computationally efficient. Generating fragments is approximately 4x faster than generating full titles and reduces the noise introduced by irrelevant tokens.
Experimental Setup
The study utilized a large-scale dataset derived from user click logs on a major e-commerce platform. The data included a pre-training set of approximately 931,000 (query, title, category) triplets and a joint-training set of 667,000 examples. Evaluation was conducted on two 10,000-sample sets: one for overall performance and one specifically targeting rare, long-tail queries.
Key Results and Insights
Dragan demonstrated substantial improvements over traditional retrieval-augmented baselines. On long-tail queries, Dragan achieved an F1 score of 0.868, a significant leap over REALM’s 0.638. Ablation studies confirmed that the "fragment" approach is superior to using full titles in both accuracy and speed.
Beyond offline metrics, Dragan was deployed in a 30-day A/B test at JD.com. The deployment resulted in a 0.13% increase in Gross Merchandise Value (GMV) and a 0.28% increase in unique order items per user (UCVR), proving the framework's real-world commercial viability.
Limitations and Future Work
Despite its success, Dragan faces some constraints. The current implementation uses a reduced vocabulary of 9,000 tokens to maintain speed, which may need expansion for broader NLP tasks. Additionally, because the "knowledge" is encoded in the model's weights during pre-training, the system may require periodic retraining to stay current with rapidly changing product catalogs. Future research will explore the applicability of fragment generation to other domains, such as open-domain question answering.
Summary updated