Template-Type: ReDIF-Paper 1.0 Series: Tinbergen Institute Discussion Papers Creation-Date: 2025-12-11 Number: 25-071/XII Author-Name: Luuk van Maasakkers Author-Workplace-Name: Erasmus University Rotterdam Author-Name: Bas Donkers Author-Workplace-Name: Erasmus University Rotterdam Author-Name: Dennis Fok Author-Workplace-Name: Erasmus University Rotterdam Title: What Did I Forget? Basket Analysis for Large Assortments Using Transformers Abstract: We propose a new method for learning product complementarity patterns in shopping baskets, inspired by Google's Bidirectional Encoder Representations from Transformers (BERT) for natural language processing. We reformulate BERT's masked learning task in a marketing context and learn to accurately identify missing products from a real-life grocery shopping basket based on the other products purchased in that same basket. The resulting model, which we call BaskERT, can be used by retailers for personalized product recommendations and for analyzing product complementarity patterns across the assortment. BaskERT outperforms several state-of-the-art benchmarks in a basket completion task. Different procedures for sampling the missing product during training impact the variety of recommendations returned by the model. This enables marketers to steer their recommendations away from the most popular products. The model is easily scalable to large assortments. As our model only requires basket data from the current shopping trip, it is applicable in many situations, also when customer information and purchase history data are not available, for example because of privacy regulations. Classification-JEL: M31 Keywords: product basket prediction, machine learning, transformers, product embedding File-URL: https://papers.tinbergen.nl/25071.pdf File-Format: application/pdf File-Size: 10.035.937 bytes Handle: RePEc:tin:wpaper:20250071