Novel Grocery Recommendations with T5: A Transformer-Based Approach for Next Basket Prediction

Author(s): Pawan Chorasiya, Aditya Thomas, Abhinav Arya

In this paper, we introduce a transformer-based model for the Next Basket Recommendation (NBR) task in the grocery retail sector, specifically aimed at predicting a set of new, previously unpurchased products that a customer is likely to buy, based on their historical shopping behaviour. Our approach builds on the T5 (Text-to-Text Transfer Transformer) architecture, modified to enhance item-to-item correlations across sequential shopping baskets for recommendation purposes. Unlike traditional recommendation methods, which tend to focus on predicting repeat purchases, our model addresses the more challenging task of recommending novel products, even in the absence of direct customer-product interaction history. We formulate the NBR task as a sequence-to-sequence problem, where a customer’s historical sequence of shopping baskets serves as the input, and the target output is a prediction of new products the customer may purchase over the next four weeks. By framing the task as a sequence-to-sequence problem, our approach models customer behaviour as sequences of past purchases and predicts potential new products the customer might buy in the upcoming transactions.

To evaluate our model, we conduct extensive experiments using the public Dunnhumby dataset, containing transaction data for approximately 400,000 customers and 4,000 unique products. Our model produces probability scores for each product in the catalogue, enabling rank-ordered recommendations for unseen items. Performance metrics, including precision@k and decile gains, demonstrate that our model surpasses traditional collaborative filtering-based recommendation systems, highlighting the effectiveness of transformer architectures in addressing the problem for novel product recommendations.

Access this Lattice Journal:

Picture of 晓军

晓军

The Chartered Data Scientist Designation

Achieve the highest distinction in the data science profession.

Elevate Your Team's AI Skills with our Proven Training Programs

Strengthen Critical AI Skills with Trusted Generative AI Training by Association of Data Scientists.

Our Accreditations

Get global recognition for AI skills

Chartered Data Scientist (CDS™)

The highest distinction in the data science profession. Not just earn a charter, but use it as a designation.

Certified Data Scientist - Associate Level

Global recognition of data science skills at the beginner level.

Certified Generative AI Engineer

An upskilling-linked certification initiative designed to recognize talent in generative AI and large language models

Join thousands of members and receive all benefits.

Become Our Member

We offer both Individual & Institutional Membership.