Swiggy developed an in-house predicted lifetime value (pLTV) model using a multi-task multilayer perceptron (MLP) and over 350 features. This model generates early signals for new customers, allowing Swiggy to optimize advertising bids based on long-term value rather than short-term conversions. A key architectural decision involved using an auxiliary prediction task to significantly reduce model size and improve accuracy.
Read original on InfoQ ArchitectureSwiggy's approach to predicting customer lifetime value (pLTV) exemplifies how machine learning can be integrated into core business operations, specifically advertising bid optimization. By shifting from short-term conversion metrics to long-term value prediction, Swiggy aims for more sustainable customer acquisition and improved return on ad spend (ROAS). This highlights a common system design challenge: how to integrate sophisticated ML models into real-time decision-making systems and cold-start scenarios.
A significant challenge in pLTV prediction, especially for new customers, is the "cold start" problem and sparse early signals. Many new users might not place orders immediately, making it difficult to distinguish high-value users from low-value ones based on initial interactions. Swiggy addressed this by: * Extensive Feature Engineering: Utilizing over 350 features from various domains (acquisition, device, fraud, geographic, order behavior, payment, socioeconomic) available *before* a customer's first order. * Focus on Early Signals: Designing the model to generate useful predictions with minimal early data points.
System Design Insight: Multi-Task Learning
Multi-task learning can be a powerful architectural pattern for ML systems, especially when dealing with related prediction problems or resource constraints. By sharing hidden layers, models can learn more generalized representations, leading to smaller model sizes, reduced training times, and sometimes improved accuracy for individual tasks. This reduces the operational overhead and complexity of deploying and maintaining multiple separate models.
Instead of separate models, Swiggy employed a relatively simple multi-task multilayer perceptron (MLP). This architecture uses three shared hidden layers to learn common representations across different prediction tasks (Food and Instamart pLTV). Critically, adding an auxiliary prediction task (order count) alongside lifetime value not only improved results but also reduced the model's parameter count by 63% (from 363,000 to 135,000). This demonstrates a significant architectural optimization for resource efficiency and maintainability.
Conventional regression metrics like MAE or MAPE were deemed insufficient due to the highly skewed target distribution and a large number of zero-value users. Swiggy instead focused on the model's ability to rank customers by value. They used decile coverage and Spearman correlation to assess how well predicted values align with actual customer value rankings, which is a more robust evaluation strategy for business outcomes in such distributions.
In production, the pLTV signal is integrated with Google's target return on ad spend (tROAS) bidding system, allowing bids to be differentiated based on predicted customer value. Swiggy's in-house model outperformed a third-party platform in terms of retention and gross order value per acquired user. Future work includes moving from point estimates to probabilistic pLTV predictions to better represent uncertainty in bidding decisions, which further enhances the sophistication of the ML system's integration with real-world financial operations.