Problem
Instacart does not know in real time whether a store has a product in stock. When an item turns out to be missing, the app must suggest a replacement to the customer, and shoppers see suggestions in the store. Popular products have plenty of engagement data, while rare and new ones have only catalog attributes. One ranking for all retailers also favours brand-name products that every store carries over a store's own brands.
Example from the article: for a honey-flavored cereal the deep-learning model returned four equally plausible cereals, but historical data showed customers picked other cereals far more often.
Solution in brief
Generate a couple of hundred candidates per product with cheap heuristics, then score them with a Siamese network trained on customer approvals from catalog features. For products with many past replacement attempts, blend in a historical approval score whose weight grows with the number of attempts. Key everything by retailer.
Questions this case answers
- How to recommend a similar item to replace an unavailable one when interaction data is plentiful for head items and absent for tail and new items
- How to blend a memorization model built on interaction statistics with a content-based generalization model according to how much evidence each item pair has
- How to recommend substitutes for an out-of-stock product when real-time inventory is unknown?
- How to rank substitutes for popular products and for rarely bought or new products with the same system?
Tools and methods
- Rule-based candidate generation — engagement, taxonomy, aisle and semantic candidates, trimmed by Levenshtein distance and popularity
- Siamese network — pointwise ranker scoring an original and a candidate product from catalog features
- BERT-based sentence embedding — encodes the product name
- Engagement model — historical approval rate per product pair, for head products
- Sigmoid-weighted ensemble — blends the two scores by number of attempts
- Online A/B test — launch decision
Google or a one-time email code. No password.