Source-linked AI summary
Timing-Aware Repurchase Prediction for Web-Scale E-Commerce: Survival Models for Multi-Surface Grocery Recommendation
Akshay Kekuda, Shreeranjani Srirangamsridharan, Ishan Bhatt, Yanan Cao, Sinduja Subramaniam, Evren Korpeoglu, Kaushiki Nag, Kannan Achan
TL;DR
Multi-surface grocery recommenders need to predict when previously purchased items will be repurchased, but standard binary classifiers require separate models for each horizon. The paper evaluates survival models, especially AFT, as a direct time-to-repurchase alternative and finds a ranking–calibration trade-off: Log-Normal is strongest for ranking, while Exponential AFT is best for probability-consuming surfaces.
Problem
Binary repurchase models ask whether an item will be bought within a horizon, requiring separate models for different horizons instead of directly modeling when repurchase occurs.
Method
The paper evaluates survival models on grocery customer–item data, using AFT for scalar time-to-repurchase rankings and calibrated survival CDFs for multiple horizons.
Results
A single AFT model matches or exceeds per-horizon binary classifiers at every horizon while using roughly 3× fewer total trees; Log-Normal leads ranking, whereas Exponential AFT reaches ECE ≈10−4.
Takeaways & Limitations
Exponential AFT is adopted for probability-consuming surfaces, while Log-Normal is retained for pure ranking because calibration and ranking favor different distributions.
Takeaways & Limitations
Experiments are offline on one proprietary grocery dataset, without validation on public benchmarks or non-grocery verticals, and the model omits basket-level item dependencies.
Abstract
from arXiv · showhide
Repurchase recommenders in e-commerce are commonly framed as a binary question asking "will this customer buy this item within W days", a formulation that requires a separately trained model for every horizon of interest. We replace this stack with survival models that predict time-to-repurchase directly, and evaluate them on millions of customers from a major grocery e-commerce platform across more than thirty ablation configurations. Our study makes three contributions. First, an empirical hazard analysis reveals a slightly decreasing marginal hazard (k ~ 0.9), differing from the common intuition that grocery items become more likely to be repurchased the longer since the last purchase (increasing hazard, k > 1). Log-Normal achieves the best marginal fit (R^2 = 0.998) and the best ranking, despite Weibull providing the best conditional residual fit, revealing an apparent discrepancy we analyze in detail. Second, a single Accelerated Failure Time (AFT) model replaces three per-horizon binary classifiers, matching or exceeding each at its own horizon while using roughly 3x fewer total trees. Feature importance reshuffles under the survival objective: channel-cadence and recency signals rise while aggregate frequency counts fall. Third, a 4-parameter parametric calibration maps raw survival CDFs to per-horizon probabilities with zero cross-horizon monotonicity violations. Calibration quality varies by an order of magnitude across the AFT family: Exponential AFT (Weibull k=1) achieves expected calibration error (ECE) ~1e-4, roughly 10x lower than Log-Normal, while ranking metrics agree within 0.3% relative. We adopt Exponential AFT for probability-consuming surfaces and Log-Normal for pure ranking, exposing a principled calibration-ranking trade-off within a single AFT family.
1 Introduction
The paper reframes multi-horizon grocery repurchase recommendation as a time-to-repurchase problem, using survival models to replace separate binary classifiers. It finds that AFT models preserve or improve ranking while reducing model count and that calibration distinguishes distribution choices.
- Motivation: Multiple recommendation surfaces require ranked previously purchased items on different clocks, making repurchase timing—not only purchase likelihood—the underlying problem.The examples span 7-day, 14-day, and 30-day surfaces with items that recur weekly, monthly, or every few months.
- Motivation: Three horizon-specific binary classifiers can assign the same score to items due soon and items due weeks later, while tripling training and serving cost.The binary:logistic formulation discards timing structure when separate models are trained for each horizon.
- Approach: AFT models predict scalar time-to-repurchase and provide an imminence-ordered ranking usable across horizons from one model.Discrete-Time models instead produce interval-specific hazards and per-horizon CDFs.
- Empirical hazard: 0.911 is the estimated Weibull shape parameter, indicating a slightly decreasing hazard rather than the commonly assumed increasing repurchase hazard.The study estimates the parameter from tens of millions of customer–item pairs and compares multiple survival distributions.
- Distribution choice: R^2 = 0.998 is the Log-Normal marginal fit, which also achieves the best ranking despite Weibull’s superior conditional residual fit.The discrepancy between marginal fit, residual fit, and end-to-end ranking is analyzed in the paper.
- Model replacement: A single AFT model matches or exceeds the best per-horizon binary classifier at every horizon while using roughly 3× fewer total trees.The survival objective also increases the importance of channel-cadence and recency features while reducing the importance of aggregate frequency counts.
- Calibration: A 4-parameter calibration maps raw survival CDFs to per-horizon probabilities with zero cross-horizon monotonicity violations.Calibration quality varies substantially across AFT distributions despite similar ranking behavior.
2 Problem Setting
The task is to rank previously purchased grocery items by future repurchase likelihood and timing for recommendation surfaces with different horizons. The dataset, evaluation, and production baseline are designed around multi-horizon ranking.
- Task: The task ranks previously purchased items by likelihood and timing of future repurchase for web and mobile surfaces with different horizons.The output populates “buy again” surfaces across multiple applications.
- Data: Tens of millions of customer–item pairs are labeled with observed repurchase time within 30 days or right-censored otherwise.Training uses one snapshot date, while evaluation uses the same date with a held-out customer partition.
- Evaluation protocol: P@h retrieves k items where k equals the number actually purchased within the h-day window, making precision and recall numerically identical.Evaluation uses horizons h ∈ {7, 14, 28} days and also reports NDCG plus consumable- and perishable-item precision.
- Baseline: The production baseline trains separate 800-tree XGBoost binary:logistic models for horizon-matched repurchase labels.The three models are F7d, F14d, and F30d, and each is evaluated on all horizons.
- Features: All models use 84 shared features spanning channel and payment frequency, recency, inter-purchase intervals, availability, tenure, basket composition, and order-presence signals.The best AFT model uses the production feature set, while the DT model adds interval-relative features.
3 Related Work
Prior recommendation systems largely model what customers will rebuy, while this paper targets when item-level repurchase occurs at web scale. It compares survival-based timing models against the deployed tabular production system rather than neural next-basket architectures.
- Next-basket recommendation: Next-basket research includes Markov, factorization, recurrent, attention, set-based, and frequency-based methods, alongside models that isolate repeat-basket intent.RepeatNet and ReCANet are examples of approaches focused on repeat consumption in grocery recommendation.
- Survival analysis in recommendation: Existing recommendation models generally answer what will be rebought or how likely it is, while item-level repurchase timing remains underexplored at web scale.The paper presents XGBoost AFT as a drop-in replacement for binary logistic without architecture changes.
- Time-aware recommendation: Multi-horizon recommendation commonly uses one model per horizon or multi-task learning, whereas person-period expansion supplies per-horizon probabilities without architectural modification.Session-based temporal models do not output calibrated per-horizon probabilities in the cited comparison.
- Discrete-time survival: Discrete-time survival uses interval-specific rows and is applied here with gradient-boosted trees on expanded datasets containing hundreds of millions of interval rows.The approach is positioned as a web-scale application of person-period expansion.
- Positioning: The deployed production system is a tabular gradient-boosted-tree ranker, chosen as the comparison baseline for engineering and explainability reasons.The paper does not claim state-of-the-art accuracy against neural next-basket systems; its claim is scoped to changing the objective while holding the tabular representation and tree ensemble fixed.
4 Survival Models
The paper implements AFT and discrete-time survival models for repurchase timing, with AFT providing horizon-invariant rankings and DT providing horizon-specific rankings in principle. It also addresses distributional behavior, censoring, and inference-time ranking.
- AFT: XGBoost AFT predicts a positive scalar time-to-repurchase for each customer–item pair, and Weibull, Log-Normal, and Logistic share the same ranking rule.The ranking is based on predicted time rather than a separate score for each horizon.
- Distribution behavior: For Weibull, k > 1 gives increasing hazard, k < 1 decreasing hazard, and k = 1 memoryless exponential; the empirical estimate is k̂MLE = 0.911.Log-Normal and Logistic hazards are non-monotone, whereas the empirical hazard is slightly decreasing.
- Peak repurchase day: Log-Normal has a finite density mode that can be interpreted directly as a peak repurchase day.This interpretability holds even when the Weibull mode collapses to t = 0 for k ≤ 1.
- AFT ranking: Items are ranked by −λ̂(x), so smaller predicted scale—and therefore sooner expected repurchase—ranks first using the existing inference pipeline.The ranking implementation preserves the same latency as the binary-classifier pipeline.
- Censoring: Preserving right-censored observations is critical: dropping high-lapsed-day censored items reduces concordance from 0.91+ to 0.55–0.65.The comparison remains poor even with heavy regularization.
- Ranking invariance: Single-output AFT rankings are identical across horizons because F(h|x) is monotone decreasing in λ̂ for fixed h and distribution parameters.A single model therefore serves every horizon with per-horizon probabilities obtained separately through calibration.
- Discrete-Time Hazard: Discrete-time models expand each pair into interval-specific rows, estimate interval hazards, and use the resulting CDF F(h) to produce a different ranked list per horizon.The implementation uses three intervals, approximately 2.9× row expansion, and a categorical interval index.
- Empirical hazard: Figure 1 reports a decreasing empirical hazard with slope −0.035/day, weekly periodicity, cumulative hazard, and a Weibull likelihood optimum at k̂MLE = 0.911.The profile likelihood places k = 1 nearest to the optimum.
5 Experiments
Experiments show that survival models capture decreasing population-level repurchase hazard, improve ranking across horizons, and substantially reduce model complexity. Distribution choice affects fit and calibration trade-offs, while timing-aware features and interval designs yield targeted gains under specific conditions.
- Distribution and hazard analysis: R^2 = 0.998 makes Log-Normal the best marginal fit, and it also delivers the strongest ranking despite Weibull’s superior conditional residual fit.Gumbel fits residuals best across training distributions, creating a conditional-fit versus ranking discrepancy.
- Distribution and hazard analysis: k̂_MLE = 0.911 indicates a slightly decreasing marginal hazard, consistent with QQ-based Weibull estimates below 1 across customer segments.The decreasing population-level hazard reflects heterogeneity: late survivors are disproportionately long-cadence items.
- Shape and feature ablation: P@14d improves by roughly 0.05% when the Weibull shape prior moves from k=1 to k=0.5, whereas six engineered timing features add no improvement.The strongest overall configuration uses the production feature set alone, suggesting raw recency and frequency features already encode timing information.
- DT ablations: 1–2% recall gains at 7 and 14 days come from interval-relative features, while full-data training outperforms a half-data configuration capped at 800 trees.The results indicate that interval-boundary customer-state features and broader data coverage matter more than simply increasing tree capacity.
- Main results: +0.82% at P@14d: the best AFT configuration reaches 0.3788 versus 0.3757 for the strongest per-horizon baseline, while a single survival model wins at every evaluated horizon.The comparison uses identical customer partitions and label pipelines, isolating model choice.
- Main results: ∼700 trees replace 2,400 baseline trees, producing a 3× reduction in training and serving compute without loss in ranking quality.The best AFT ensemble uses 330–765 trees, while the DT model uses 273 trees.
6 Feature Importance Under Survival Objectives
Under the survival objective, feature importance shifts from aggregate purchase volume toward recent timing and channel-cadence signals, while the two AFT distributions emphasize timing differently.
- Features that rise under the survival objective: The largest riser is product-type online-channel order count, moving from outside the production top 30 into the top 20 of both AFT models.Customer-level online-channel share also rises from rank 34 to rank 10 under Weibull and rank 7 under Log-Normal.
- Features that fall: The 3-month order total falls from rank 12 to rank 54 under Weibull and rank 46 under Log-Normal.Weekly and monthly rolling-average order counts also fall 15–20 places.
- Channel-cadence and recent-recency features rise under survival objectives, whereas aggregate frequency counts fall.The paper characterizes this as a shift from “how much?” toward “how recently?” and “through which channel?”
- Timing features: Log-Normal retains recent recency signals but demotes deep history, with fifth-last and fourth-last purchase recency each dropping nine ranks.Weibull keeps the fifth-last recency signal at rank 11, closer to production.
- Where the two AFT distributions disagree: The IPI–lapse residual ranks 18 in Weibull but 44 in Log-Normal, reflecting different timing emphases between the distributions.Weibull uses the residual as an overdue score, whereas Log-Normal relies more on channel- and cadence-mixture signals.
- Personal vs. population IPI: Personal item IPI ranks 15 under Log-Normal and 20 under Weibull, while population-level IPI sits just outside the top 30 as a low-gain cold-start routing feature.Importance values are XGBoost average gain per split on trees used at inference.
7 Calibration
The paper calibrates raw AFT survival CDFs into horizon-specific probabilities using a shared shape parameter and per-horizon intercepts. Exponential is best calibrated, while Log-Normal retains the strongest ranking and creates a coverage–precision trade-off.
- Raw AFT CDFs require calibration because a typical raw F(14) ≈ 6×10^-6 is far below the empirical 14-day repurchase rate of ∼0.15.The mismatch occurs regardless of distribution family.
- 7.1 Distribution-Matched Parametric Calibration: A shared shape parameter a and three per-horizon intercepts b_t provide a four-parameter calibration link across 7-, 14-, and 28-day horizons.The shared-a formulation guarantees cross-horizon monotonicity by construction.
- Fitting: The calibration parameters are fit by minimizing joint per-horizon binary cross-entropy on a held-out validation set using Nelder–Mead optimization.The optimization uses approximately 300 function evaluations and completes in well under a second.
- 7.2 Results: Exponential AFT achieves the lowest 14-day ECE at 1.3 × 10^-4, versus 3.6 × 10^-4 for Weibull k=0.5 and 7.5 × 10^-4 for Log-Normal.Exponential also tracks the reliability-diagram diagonal tightest across all three horizons.
- Why Log-Normal calibrates worse despite winning ranking: Log-Normal’s weaker calibration reflects hazard-shape mismatch rather than fitting failure: its bell-shaped hazard conflicts with the empirically monotonically decreasing hazard.The shared-a fit converges to the joint validation NLL minimum for all three distributions.
- Operating-point interpretation: Exponential produces roughly twice Weibull’s and 3.6 times Log-Normal’s top-tier coverage at P≥0.70, while achieving 81.6% precision.Weibull and Log-Normal reach 87.4% and 90.5% precision, respectively, on smaller candidate sets.
- Operating-point interpretation: Exponential is preferred for probability-consuming surfaces because its probabilities are more reliable, while raw ranking remains within 0.3% relative of ranking-best Log-Normal.This exposes a calibration–ranking trade-off within the AFT family.
8 Discussion and Conclusion
The discussion concludes that survival modeling can consolidate multi-horizon repurchase ranking while exposing a calibration–ranking trade-off and practical scope boundaries.
- Deployment efficiency: A single AFT model replaces three per-horizon classifiers, uses roughly 3× fewer total trees, and matches or exceeds each classifier at its horizon.Its ranking is reusable across web surfaces without re-inference, while only the calibration layer changes per horizon.
- Feature engineering: Channel-cadence and recent-recency features rise under the survival objective, while aggregate frequency counts fall.The authors identify direct implications for feature engineering in timing-sensitive recommenders.
- Calibration and ranking: Exponential AFT reaches ECE ≈10^-4 for probability-consuming surfaces, whereas Log-Normal remains strongest for pure ranking.The calibration layer converts raw survival CDFs into deployable per-horizon probabilities, separating the models’ operational roles.
- Practical considerations: AFT provides horizon-invariant rankings by construction, while DT supports genuinely different horizon orderings at the cost of roughly 3× data expansion and negative sampling.The paper therefore positions DT as an option when horizon-specific ordering is required, rather than as the default ranking formulation.
- Limitations: The findings are limited by offline evaluation on one proprietary grocery retailer, global distribution parameters, absent basket dependencies, and 30-day censoring.The authors identify public benchmarks, non-grocery verticals, per-category parameters, and longer-cadence modeling as unresolved scope boundaries.
- Future work: Future work would test the hazard finding and calibration–ranking trade-off on public benchmarks and explore per-item distributions, urgency reranking, and joint timing objectives.These directions are intended to assess whether the reported patterns extend beyond the studied retailer and modeling setup.