Basket Representation Learning by Hypergraph Convolution on Repeated Items for Next-basket Recommendation

Yalin Yu, Enneng Yang, Guibing Guo, Linying Jiang, Xingwei Wang

Abstract

Next-basket recommendation (NBR) is a critical task in e-commerce, aiming to predict a user's next set of purchases based on their transaction history. Conventional approaches often simplify baskets into "bags of items," neglecting the intricate correlations between items and the specific patterns of repeated purchases. This paper introduces Basket Representation Learning (BRL), a novel framework that leverages hypergraph convolutions to capture high-order item dependencies. By constructing dual hyperedges for full baskets and repeated items, and employing contrastive learning to emphasize stable preferences, BRL significantly improves recommendation accuracy, outperforming existing baselines by up to 16%.

Introduction

Predicting the next shopping basket is more complex than standard item recommendation because it requires modeling both the sequential evolution of user interests and the internal structure of the baskets themselves. Most existing NBR models rely on simple pooling operations (e.g., mean or max pooling) to represent a basket. This "bag of items" assumption fails in two ways: it ignores that items within a basket are often functionally related (the Independence Assumption), and it overlooks the heightened correlation among items that a user repurchases over time (the Repurchase Gap).

Methodology: Hypergraph Convolution and Contrastive Learning

The BRL model addresses these limitations by representing the shopping history as a hypergraph, where each basket is a hyperedge connecting multiple item nodes.

Hypergraph Construction

Unlike standard graphs that connect pairs of nodes, hypergraphs allow edges to encompass any number of nodes, naturally fitting the structure of a shopping basket. BRL constructs two types of hyperedges for each transaction:

  1. Basket Hyperedge: Contains all items in the current basket.
  2. Repeated Item Hyperedge: Contains only the items in the current basket that the user has purchased previously. This "turns up the volume" on items that represent long-term habits.
The BRL framework: Hyperedge construction (left) and the overall model architecture featuring HGCN, RNN, and contrastive learning (right).

Model Architecture

The framework consists of three main components:

  • Hypergraph Convolutional Network (HGCN): HGCN layers propagate information between items sharing hyperedges. This allows the model to learn "bundle-able" item embeddings based on global co-occurrence patterns.
  • Contrastive Learning: To enhance robustness, BRL uses a triplet-based contrastive objective. An Anchor (the original basket) is compared against a Positive View (the basket with low-correlation noise removed) and a Negative View (where repeated items are replaced with random ones). The model is trained to minimize the distance between the Anchor and Positive views while maximizing the distance from the Negative view.
  • Sequential Modeling: The refined basket representations are processed by a Recurrent Neural Network (RNN) to capture the temporal evolution of user preferences across successive shopping trips.

Experimental Results

The BRL model was evaluated on three large-scale datasets: TaFeng, Dunnhumby, and Instacart. The results demonstrate that BRL consistently outperforms state-of-the-art baselines such as FPMC, Sets2Sets, and CLEA across various metrics including Recall, NDCG, and MAP.

Performance comparison of BRL against baseline models across three datasets. BRL shows significant improvements, particularly in NDCG and MAP metrics.

Key findings include:

  • Significant Gains: On the Dunnhumby dataset, BRL achieved a 16.26% improvement in NDCG@20 over the strongest baseline.
  • Robustness of Repeated Items: Data analysis confirmed that "repeated items" show a much higher category correlation (e.g., 55% in Instacart) compared to general basket items (47%), justifying the model's focus on these elements.

Conclusion

Basket Representation Learning (BRL) provides a sophisticated approach to NBR by moving beyond simple pooling to high-order hypergraph modeling. By explicitly accounting for the correlations within repeated items and utilizing contrastive learning, the model captures more nuanced user preferences. Future work will explore the integration of temporal intervals between purchases to further refine the prediction of when an item will be repurchased.

Summary updated

BibTeX
@inproceedings{yu2023basket,
  author = {Yalin Yu and Enneng Yang and Guibing Guo and Linying Jiang and Xingwei Wang},
  title = {{Basket Representation Learning by Hypergraph Convolution on Repeated Items for Next-basket Recommendation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.24963/ijcai.2023/268},
}
Figure