Improving Sequential Recommender Systems with Online and In-store User Behavior

Luyi Ma, Aashika Padmanabhan, Anjana Ganesh, Shengwei Tang, Jiao Chen, Xiaohan Li, Lalitesh Morishetti, Kaushiki Nag, Malay Patel, Jason Cho, Sushant Kumar, Kannan AchanarXiv 2024

TL;DR

This paper introduces a novel approach to "omnichannel" recommendation by integrating in-store transaction data into online sequential recommender systems. The authors propose a hybrid data pipeline to unify disparate data sources and a specialized Store Transaction Encoder that uses self-attention to compress multi-item in-store "baskets" into single embedding vectors compatible with standard Transformer architectures.

What Problem Does This Paper Address?

Modern sequential recommender systems (like SASRec or BERT4Rec) are typically "online-only." They excel at predicting what a user will click next based on their recent browsing history. However, this provides an incomplete picture of the customer journey. A user might browse a bike online but ultimately buy it in-store due to immediate availability, or an in-store purchase of a tent might inspire an online search for sleeping bags.

The authors identify two primary hurdles to holistic modeling:

  1. Data Engineering: Online data is usually streaming and session-based, while in-store data arrives in batches with different schemas.
  2. Structural Mismatch: Sequential models expect a sequence of single items (one per timestamp). In-store transactions are "sets" or "baskets" where multiple items share the same timestamp. Simply "flattening" these sets into a sequence breaks the standard Transformer backbone.
Fig. 1. A user could have online and in-store shopping behaviors that correlate and reflect the user’s shopping interest. Items in online user behavior are differentiable because of individual timestamps, while items from in-store user behaviors usually come in a set with shared timestamps. However, only online user behaviors can’t unveil the complete shopping journey.

Methods

The researchers at Walmart Global Tech developed a two-pronged solution:

1. The Hybrid Data Pipeline

They built a pipeline that uses streaming processors (like Spark or Flink) to ingest real-time online clicks and joins them with batch-processed in-store transaction data. A centralized Feature Registry manages the metadata, ensuring that both data sources adhere to a unified schema despite their different update frequencies and volumes.

2. Store Transaction Encoder

To handle the "multiple items at one timestamp" problem, they introduced a plug-in encoder module. Instead of feeding every item in an in-store basket into the Transformer individually, the encoder:

  • Takes a set of items $s$.
  • Applies a self-attention mechanism to compute the similarity between items in the basket.
  • Generates an attention score that reflects the "dominance" of specific shopping intents within that set.
  • Produces a single weighted-sum embedding vector $v_s$ representing the entire transaction.

This allows the downstream Transformer to treat an entire in-store visit as a single "event" in the sequence, maintaining the model's structural integrity.

Fig. 2. The transformer-based sequential recommender systems cannot process this hybrid sequence because of multiple items at the same timestamp, and we propose an encoder (light-orange box) to enable the modeling of hybrid sequences.

Datasets

The models were evaluated using a large-scale, real-world dataset from Walmart.com:

  • Scale: 58,766 users and 317,457 unique items.
  • Composition: Every user had at least 20 behaviors, with an average sequence length of 33. Notably, 40% of the behaviors were in-store transactions, highlighting the importance of this data source.

Key Insights and Ideas

  • Baskets as Intents: The self-attention mechanism in the encoder isn't just for compression; it's designed to identify the "dominant shopping intent." If a user buys a TV, a soundbar, and a pack of gum, the attention mechanism should ideally weigh the electronics more heavily as they represent the primary intent of that trip.
  • Permutation Invariance: Because items in a physical shopping basket don't have a meaningful internal order, the encoder is designed to be permutation invariant—the output is the same regardless of how the items in the set are ordered.
  • Adaptor Role: The encoder acts as an "adaptor," translating the high-density information of a physical store visit into the "language" of online sequential modeling.
Figure 3: Detailed view of the self-attention mechanism within the Store Transaction Encoder.

Key Results

The experiments compared a standard online-only SASRec model against variants that included in-store data.

  • In-store data helps: Simply adding in-store data (SASRec$_{w/store}$) improved HitRate@10 by 1.55%.
  • Attention is superior: The proposed attention-based encoder (SASRec${attnE}$) outperformed a simple average-pooling approach (SASRec${avgE}$), achieving a 4.29% improvement in HitRate@10 and a 7.50% improvement in NDCG@10 over the online-only baseline.
Table 1: Performance comparison across different model variants.

Limitations and Future Work

While the paper demonstrates clear gains, a few areas remain for exploration:

  • Independence of Behaviors: The authors note that in-store behaviors still maintain a level of independence from online behaviors due to factors like physical location and item eligibility. Future work could more explicitly model these external constraints (e.g., geography).
  • Cross-Domain Dynamics: The current model focuses on predicting online behavior. A natural extension would be a truly symmetric model that predicts both online and in-store interactions simultaneously.
  • Cold Start: The dataset required users to have at least 20 behaviors; how this system performs for new or low-activity users remains an open question.

Summary updated

BibTeX
@misc{ma2024improving,
  author = {Luyi Ma and Aashika Padmanabhan and Anjana Ganesh and Shengwei Tang and Jiao Chen and Xiaohan Li and Lalitesh Morishetti and Kaushiki Nag and Malay Patel and Jason Cho and Sushant Kumar and Kannan Achan},
  title = {{Improving Sequential Recommender Systems with Online and In-store User Behavior}},
  year = {2024},
  eprint = {2412.02122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.02122},
}
Figure