Elevating Guest Repurchasing Behavior Using Buy It Again Recommendations

November 2, 2023

Amit Pande

Principal Data Scientist

Rankyung Park

Lead Data Scientist

A full version of this appears in RecSys 2023 as a short paper (pdf here) 
 
Introduction 
Buy It Again (BIA) recommendations are crucial to retailers like Target to help improve guest experience and site engagement. These recommendations work by suggesting items that guests are likely to buy again at times when they might be running out of the item(s) based on their own repeat purchasing patterns. A similar item recommendation challenge involves recommending the next items in your shopping basket based on items already in the cart, which can be explored in more detail in our colleague’s recent post on real-time recommendations using Target AutoComplete.  
 
Key insights  
Existing work in BIA recommendations focuses on modeling item repurchase probabilities by using variants of recurrent neural networks or statistical models. Large retailers handle hundreds of millions of items and guests, but the majority of repurchase transactions are on a small subset of items and guests. This can lead to underfitting for item-grained models, as the data ends up being represented sparsely in an extremely high dimensional space. Guests will often explore variants of an item or new items within a category for reasons such as the desire to try varied brands, the need to satisfy varying taste preferences in their family, or the presence of discounts on alternative items. Category-based repurchase modeling can effectively capture higher abstraction information on the repurchase dynamics of these items. As shown in Figure 1, the percentage of items that have high numbers of repurchases is small (Figure 1a), but most categories demonstrate high levels of repurchases (Figure 1b). The discrepancy means that models geared toward category repurchases may be more effective at satisfying guest preferences.  
 
Graph showing percentage of items on the y-axis with ascending numbers from 0.0 to 17.5, and x-axis with repurchase numbers from 1 to 1m. The graph shows a blue line descending from about 17% at 1 repurchases, down to 0% around 1m repurchases.
Graph showing percentage of categories on the y-axis with ascending numbers from 0 to 14, and number of repurchases in the x-axis with numbers from 1 to 305M, with a blue line showing steady growth with a spike of 15% of categories at around 524k repurchases, with a sharp decline after 2M purchases.
Fig.1a and Fig.1b. Percentage of items and categories against number of repurchases in 1.5-year window. Categories have more data for repurchase modeling than items, and the repurchase rate is higher across categories than the one of items.  
 
Our Model  
A two-step approach was taken to model repurchase behavior. First, a ranked list of personalized categories (PC) of a guest is generated using identified sales dates and quantities. Then a personalized list of items within each category (IC) is determined and they are combined to generate final recommendations.   
 
1. Category-Level Repurchase Modeling 
Category-level features use historical purchase data, obtained using Survival and ARIMA models. The Survival model generates features regarding probabilities of an event occurring at ± Kth day. ARIMA Models are trained for each guest’s category level purchases to model and predict the date when the customer will likely run out of the item(s) based on their past purchase dates. One ARIMA model fits based on successive past dates of purchases while another one fits based on rate of consumption. We also consider the number of times a given customer has purchased from the category, the number of trips the customer has made since purchasing in this category and the time difference between today and last date the customer made a purchase in this category as input features. They are then fed to a 2-layered FC (fully connected) neural network to get the category ranks per guest. 
 
2. Item Ranking 
Items within each category are ranked for individual customers based on the weighted scores of item frequency and item recency. We also make sure that guests can get more recommended items for those categories that they purchase most often 
 
3. BIA recommendations 
The final recommendation scores of all items purchased by a customer are calculated by combining category ranks from the trained category model, and item ranks within the categories. Top ranked items in the category with the highest category prediction value are recommended in the first place. The top N personalized items are recommended based on their final scores for all individual customers. 
Diagram showing user purchase history with a flow to categories listed in colorful boxes like "Filter Infrequent Categories," "FC Layer," and "Combine Items and Category Ranks," and "List of recommended items," with arrows pointing to boxes below, with categories like "category survival features," "Category ARIMA predictions" and more.
Figure 2 – Block diagram of BIA model 
 
Evaluation 
We compared the model with several baselines on academic datasets and measured recall and precision metrics. Notes on each of these datasets can be found in the footnotes at the end of this article.  
 
The performance is shown in Table 1. We observed that our model (PCIC model) performs very well along with TIFUKNN, Sets2Sets, RCP, and MPG models. We implemented the TIFUKNN algorithm for our Buy it Again task alone despite it originally being intended for the Next Basket task, and it still performs well. TopSell is a common strategy where we show general top selling items to guests whereas FBought shows a ranked list of items purchased by the guest before based on the frequency of purchase. Surprisingly, FBought also performs pretty well considering its simplicity.  
 
Table with a list of datasets, showing the top performing as TIFUKNN Valued Shopper at 0.3578, Instacart at 0.3952, Dunhumby at 0.2087. The table shows italicized values for the runners up, with values at TIFUKNN 0.3500, Instacart at 0.3700, and Dunhumby at 0.1940.
Table 2. Performance comparison with existing baselines. The top performing algos in a dataset are in bold. The three runners up are in italics. 
 
Scaling Up 
We compared TIFUKNN and Sets2Sets to our PCIC model using a subsampled target dataset of 100M guests. We observed a 30-35% reduction in NDCG and recall metrics in TIFUKNN and Sets2Sets against PCIC. RCP and MPG also underperformed by 5-15% in these metrics. Our PCIC model was implemented in a distributed Hadoop cluster using Apache Spark.   
 
Deployment  
When we introduced Buy It Again recommendation lists to the guest shopping experience, we A/B tested a PCIC model against a baseline of FBought (try it here.) There was a lift in Click Through Rate (CTR) and an increase in units purchased. We also tested adding a Buy It Again recommendation list to the search results of all guests (try it here). For this, we filtered the Buy It Again results using the search query context. We found that the guests' interaction with this recommendation list was significantly higher than existing search results (by over 20%).   
 
We then rolled out BIA to guests by filtering recommendations by categories (milk, yogurt, beauty, etc.) to create a virtual aisle experience for online guests in a dedicated space in the Target app and on our website. In each aisle, we first showed the BIA items of the guest followed by other relevant items. Guests who interacted with these recommendations had a significant increase in units per order (25-50%), and average order value (7-35%). 
 
What’s Next?  
Buy It Again recommendations help guests quickly complete their shopping missions. We demonstrated that category level insights of guests offer valuable insights to their repurchase behavior, making shopping easier and more personalized. Looking ahead, we are working on new algorithms that will be better able to respond to guests’ needs in real time.  
 
________________
 
 
 
Links to other approaches in table:  
Userknn: JA Konstan, BN Miller, D Maltz, JL Herlocker, LR Gordon, and J Riedl "Grouplens: Applying collaborative filtering to usenet news". Commun. ACM 40, 3 (1997), 77–87.  
 
Repeatnet: P Ren, Z Chen, J Li, Z Ren, J Ma and MD Rijke "Repeatnet: A repeat aware neural recommendation machine for session-based recommendation. Proc AAAI Vol. 33. 4806–4813.  
 
FMPC: S Rendle, C Freudenthaler, and LS Thieme "Factorizing personalized markov chains for next-basket recommendation" Proc WWW. 2010 811–820  
 
DREAM: F Yu, Q Liu, S Wu, L Wang, and T Tan, "A dynamic recurrent model for next basket recommendation". Proc SIGIR  2016729–732.  
 
SHAN: H Ying, F Zhuang, F Zhang, Y Liu, G Xu, X Xie, H Xiong, and J Wu,  "Sequential recommender system based on hierarchical attention network"   Proc IJCAI 2019 
 
Sets2Sets: H Hu X He “Sets2sets: Learning from sequential sets with neural networks” KDD 2019 1491–1499.  
 
TIFUKNN: Hu, Haoji, et al. "Modeling personalized item frequency information for next-basket recommendation." Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval. 2020. 
 
RCP: R Bhagat, S Muralidharan, A Lobzhanidze and S Vishwanath "Buy-it-again: Modeling repeat purchase recommendations" KDD 2018 62–70.  
 
ATD: R Bhagat, S Muralidharan, A Lobzhanidze and S Vishwanath "Buy-it-again: Modeling repeat purchase recommendations" KDD 2018 62–70.  
 
PG: R Bhagat, S Muralidharan, A Lobzhanidze and S Vishwanath "Buy-it-again: Modeling repeat purchase recommendations" KDD 2018 62–70.  
 
MPG: R Bhagat, S Muralidharan, A Lobzhanidze and S Vishwanath "Buy-it-again: Modeling repeat purchase recommendations" KDD 2018 62–70. 

RELATED POSTS

Using BERT Model to Generate Real-time Embeddings

By Pushkar Chennu and Amit Pande, March 23, 2022
How we chose and implemented an effective model to generate embeddings in real-time. Target has been exploring, leveraging, and releasing open source software for several years now, and we are seeing positive impact to how we work together already. In early 2021, our recommendations team started to consider real-time natural language input from guests, such as search queries, Instagram posts, and product reviews, because these signals can be useful for personalized product recommendations. We planned to generate representations of those guest inputs using the open source Bidirectional Encoder Representations from Transformers (BERT) model.

Real-Time Personalization Using Microservices

By Pushkar Chennu, Prathyusha Kanmanth Reddy, and Amit Pande, May 11, 2023
How Target's Personalization team uses microservices to improve our guest experience