Retrieval-Enhanced Dual Encoder Training for Product Matching (2023)

Abstract: Product matching is the task of matching a seller-listed item to an appropriate product. It is a critical task for an e-commerce platform, and the approach needs to be efficient to run in a large-scale setting. A dual encoder approach has been a common practice for product matching recently, due to its high performance and computation efficiency. In this paper, we propose a two-stage training for the dual encoder model. Stage 1 trained a dual encoder to identify the more informative training data. Stage 2 then train on the more informative data to get a better dual encoder model. This technique is a learned approach for building training data. We evaluate the retrieval-enhanced training on two different datasets: a publicly available Large-Scale Product Matching dataset and a real-world e-commerce dataset containing 47 million products. Experiment results show that our approach improved by 2% F1 on the public dataset and 9% F1 on the real-world e-commerce dataset.

## introduction product matching is the task of finding the same product in a catalog for a specific query product. dual encoders had been proposed as a state-of-the-art solution for information retrieval tasks @xcite @xcite , including product matching @xcite . training dual encoder requires positive and negative pairs as training data. the positive pairs are usually given as part of training data, and the negative pairs can be formed according to the positive pairs. recent work @xcite tries to find negative pairs that are similar to positive pairs, which improved the quality of training data. in this paper, we propose retrieval-enhanced dual encoder training. it is a two-stage training process to improve the dual encoder with better positive and negative pairs. for every pair, we define the first item in pairs as a query and the second item in pairs as a target. in stage 1 we train a dual encoder using the human-annotated positive pairs and form the negative pairs with in-batch negative. we then use the stage 1 dual encoder to retrieve queries in positive pairs on all possible targets, the retrieved results can form pairs to serve as training data for stage 2 training. some of the positive pairs used in stage 1 might be excluded in the stage 2 training, while some extra positive pairs will be found for stage 2 training. we achieve better performance with the stage 2 dual encoder. we analyze how adding back the stage 1 positive pairs will impact the model performance, and find that the model performance dropped in several threshold settings even with stage 1 positive pairs included. this shows the stage 1 positive pairs left out in stage 2 training might not be helpful for the trained model, and our approach successfully identify those data and excluded them from stage 2 training. in this paper, we make two major contributions. first, we introduce the two-stage dual encoder training for product matching. the stage 2 training data can be used to train a more robust dual encoder model. we demonstrate the effectiveness of this approach on a public dataset and a real-world ecommerce dataset. second, we analyze how adding stage 1 positive pairs back into our stage 2 training data will impact our system performance. despite extra training data, the performance dropped in several threshold settings. this shows adding certain humanannotated training data sometimes reduces the performance. our approach is a way to identify and exclude these training data automatically. ## product matching and dual encoder given a product entry, the product matching system finds the same product in a product corpus. a product entry represents a set of information for a specific product, such as a title, description, image, or category. multiple entries of the same product could be sold by different vendors, and each vendor can give it a vendor-specific product title. a dual encoder is a popular approach for information retrieval. it performs retrieval by encoding queries and targets into dense low-dimensional vectors and computes the distance between two vectors. the distance can be used as the search score. we can use the same encoder for both queries and targets if they are using the same information in the product entries. training dual encoders requires pairs of query and target for contrastive learning. the training data contains positive and negative pairs. the positive pairs are created by a query and its related target. the in-batch negative is proposed to create the negative pairs from the existing positive pairs examples. each query in a positive pair can form a negative pair with the other positive pair's target. ## retrieval enhanced dual encoder training retrieval-enhanced dual encoder training tries to find the ideal pairs for training. the in-batch negative might create trivial negative pairs that are not useful for training. the stage 1 retrieval step avoids these trivial negative pairs. this retrieval step also includes extra useful positive pairs that might not be present in the training data and exclude the positive pairs that might not be useful for training. the loss function we use is the same with the one reported in @xcite . ## experiments our experiments are done on two different datasets, the wdc product data corpus and gold standard for large-scale product matching (lspm) @xcite foot_0 and our in-house english catalog. the former dataset enables us to compare performance with other approaches reported by other papers, while the latter dataset can give us insight into how our approach can improve real-world deployed e-commerce systems. ## related work earlier works @xcite tried to product matching based on certain extracted attributes from product entries, but recently @xcite it started to move towards using the text in the product entries directly, which avoids the possible errors caused by the attribute extraction process. there are two ways of using the text in product entries to solve product matching that had been studied. one @xcite is to treat the task as an extreme classification problem, and another @xcite is to treat the task as an information retrieval problem. to treat product matching as extreme classification, the paper built a multi-class classifier that considers each product as a separate class. in real world scenario, this could easily mean over million classes, and there are two main challenges to the approach. first, how to maintain the performance for a classifier with millions of classes. second, the classifier will need to be retrained when a new product enters the catalog. another way for product matching is to treat the task as an information retrieval task. the work in this direction started from using a standard retrieval engine to more deep learning-based approaches. among deep learning approaches, utilizing a dual encoder as a retrieval system proved to be efficient compared with more complex joint encoding ap- ## conclusion we demonstrated retrieval-enhanced dual encoder training for product matching. this approach can utilize the available training data in an efficient way to achieve improvement even with no extra annotated training data available. our stage 2 training use the same annotated training data as stage 1, the difference is on what pairs do we select for training. our empirical results on two different datasets show that our approach can achieve improvement comparing the standard in-batch negative dual encoder training. our analysis further shows that the approach not only provided valuable negative pairs for training but also adjusted positive pairs used in training data to achieve better results. as a result of this proposed training, we obtained a new way to train dual encoders for product matching. we can identify better training data automatically, instead of relying on the training data given by any specific dataset.