- The paper presents CASE, a novel architecture that decouples item-level cadence learning from cross-item dependencies for repurchase recommendation.
- It employs multi-scale CNNs and induced set attention to capture temporal rhythms, achieving up to 8.6% lift in Precision@5 on benchmark datasets.
- The scalable design minimizes inference overhead and embedding complexity, enabling deployment to tens of millions of users in industrial settings.
Cadence-Aware Set Encoding for Large-Scale Next Basket Repurchase Recommendation
Introduction and Motivation
Repurchase behavior in large-scale retail is characterized by stable, item-specific cadences linked to replenishment cycles. Accurate modeling of these temporal rhythms is essential for next basket repurchase recommendation (NBRR) systems, especially in high-frequency shopping domains (e.g., grocery, household supplies). The majority of neural NBRR frameworks represent user-item histories as sequences indexed by basket order, disregarding real calendar offsets and thereby failing to accurately model elapsed time between purchases. This results in inability to adapt recommendations as time progresses between user transactions. Likewise, production-scale requirements impose strict constraints on inference efficiency, which common KNN or quadratic interaction models cannot satisfy.
CASE (Cadence-Aware Set Encoding) directly addresses these limitations by decoupling per-item cadence learning from cross-item dependencies, utilizing an architecture inherently amenable to production-scale deployment.
Figure 1: Overview of CASE—item-level purchase histories are converted to binary T-day calendar signals, multi-scale temporal convolutions extract cadence embeddings ci​, and induced set attention models cross-item interactions to produce final repurchase scores.
Model Architecture
CASE processes each user’s repurchase candidate set as follows:
Calendar-Time Signalization: Every item’s purchase sequence is mapped to a binary indicator hi​∈{0,1}T over a T-day window, directly encoding purchase recency and phase. This approach preserves inter-purchase interval information lost in basket-indexed approaches.
Multi-Scale Temporal CNN: Shared Conv1d filters operate on hi​ at predefined window sizes (weekly, biweekly, monthly, seasonal, trend), efficiently extracting multi-horizon periodicity and temporal trends. Activations from all scales are concatenated and projected to a fixed-dimensional cadence embedding ci​.
Induced Set Attention Block (ISAB): To model cross-item dependencies, embeddings [ci​∥ei​] (with static learned item embeddings ei​) are processed through ISABs, scaling set attention from O(n2) to O(nK) for ci​0 items, with ci​1 induced points. This enables context-aware aggregation without prohibitive computational cost.
Final Scoring: A downstream two-layer MLP takes ISAB-encoded representations and outputs per-item repurchase scores, forming the basis for ranking.
This architecture fully decouples cadence learning (shared, non-user-specific, efficient) from interaction modeling, conserving parameter count per user and minimizing inference overhead.
Experimental Results and Analysis
CASE was evaluated across three public retail datasets (Instacart, TaFeng, DC) and a proprietary large-scale grocery dataset, considering optimization for recommendation accuracy and scalability for tens of millions of users with large, sparse catalogs.
Benchmark Results
Across all evaluated datasets, CASE achieved superior or at least second place precision, recall, and NDCG at various cutoffs (ci​2). Notably, on benchmark and production datasets, CASE yielded up to 8.6% lift in Precision@5 and 9.9% lift in Recall@5 over strong KNN baselines and the incumbent production system. The gains were most pronounced at tight cutoffs, reflecting CASE’s ability to precisely synchronize recommendations with real repurchase cycles.
Ablation Study
The ablation on Instacart confirmed that multi-scale CNN-based cadence modeling is the dominant driver of performance. Removing the temporal CNN incurred the largest accuracy drop, supporting the hypothesis that explicit calendar-time encoding provides the critical discriminative signal. Set-based attention yielded consistent secondary gains by capturing co-purchase context.
Surprisingly, exclusion of item embeddings resulted in only marginal performance loss, indicating that semantic product features are largely subsumed by cadence and interaction cues—this also has positive scalability implications, as it reduces the reliance on maintaining very large embedding tables in real-world deployment.
Figure 2: PCA visualization of item-level embeddings—left panel shows cadence separation induced by the multi-scale CNN; right panel demonstrates refined partitioning of positive/negative classes post ISAB cross-item attention.
Scalability and Production Implications
CASE maintains a computational complexity of ci​3 per user, decoupling inference cost from the total number of users—a marked contrast to KNN approaches that scale with ci​4, where ci​5 is the user population. This efficiency enables industrial rollout over tens of millions of active users without prohibitive infrastructure demands.
The reliance on shared convolutional weights for temporal encoding, rather than per-user or per-item parameters, further facilitates real-time model refresh and catalog expansion without retraining or embedding table growth.
Theoretical Implications and Future Directions
This work demonstrates that converting chronological purchase logs into fixed-window calendar-time signals, and leveraging shared multi-scale convolutional representations, can capture complex periodicities and temporal drift unattainable with basket-index or index-based RNNs/transformers. Induced set attention provides an information-complexity tradeoff suitable for operational scale.
Potential research extensions include incorporating explicit forecasting of next repurchase times, modeling cadence drift for highly dynamic users, or integrating exogenous temporal signals (e.g., seasonality, promotions). Further, the framework is amenable to adaptation in other event-recurrent domains such as medical prescription refills, maintenance scheduling, or sensor event prediction.
Conclusion
CASE introduces a production-oriented architecture for NBRR that combines explicit, calendar-time modeling of item-level cadences with efficient set-based cross-item aggregation. It achieves superior empirical performance and satisfies strict scalability constraints required for deployment in large-scale industrial settings. The central insight—calendar-time encoding of repurchase rhythms—constitutes a robust template for next-generation temporal recommendation systems, supporting further exploration of set-based modeling under operational constraints.