Ecommerce ops · Production

How Instacart Uses Machine Learning to Suggest Replacements for Out-of-Stock Products

The problem

Instacart's replacement system faced four interrelated challenges: predicting suitable substitutes without real-time inventory data, generating accurate recommendations for rarely purchased or newly introduced products, handling bias introduced by a uniform ranking model across all retailers, and matching the highly nuanced size, flavor, and brand preferences of individual customers.

First attempt

The original replacement schema used a single ranking across all retailers, which created a bias toward universally available brand-name products and ignored store-brand alternatives, causing customer complaints about being charged more for replacements than for original products.

Workflow diagram · grounded in source
1
Out-of-stock signal
trigger
“Our machine-learning model prompts replacement suggestions if a product appears unavailable when an Instacart customer shops”
2
Candidate generation
ai_action
“We utilize a blend of strategies to select candidates: - Engagement — Product pairs from past replacements (say, frozen blueberry for fresh blueberry) - Taxonomy — Products that fall into the same category in our catalog (say, organic bl…”
3
Deep learning ranking
ai_action
“We've devised a supervised deep-learning model that optimizes for customer approvals — that is, to maximize the likelihood that customers will accept a candidate product as a suitable replacement should the source product be out of stock”
4
Engagement model for head products
ai_action
“we develop an engagement model that excels at memorization for head products, while the DL model's generalization capabilities benefit torso/tail products. The engagement model leverages customer engagement data to compute historical app…”
5
Ensemble score combination
ai_action
“we devise the final ranking as the combined result (ensemble) of the engagement and DL models. The engagement model assumes a higher weight in this ensemble when many replacement attempts exist for a given product pair”
6
Retailer-aware recommendations served
output
“We made our replacements model retailer-aware to address these issues and changed the schema to (retailer_id, source_product_id, replacement_product_id). At the same time, we enhanced the underlying engagement model to calculate retailer…”
Reported outcome

Making the model retailer-aware significantly boosted precision and made store brands more likely to appear as top replacement suggestions; more shopper-selected replacements were available at fulfillment, and an A/B test confirmed statistically significant improvements in replacement_issues_per_delivery.
The candidate generation pipeline now covers more than 95% of replacements actually picked by shoppers.

Reported metrics
Replacement candidate set coveragemore than 95%
Replacement issues per deliverystatistically significant improvements
Reported stack
Levenshtein distanceSiamese networkBERT
Source
https://tech.instacart.com/how-instacart-uses-machine-learning-to-suggest-replacements-for-out-of-stock-products-8f80d03bb5af
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Making the model retailer-aware significantly boosted precision and made store brands more likely to appear as top replacement suggestions; more shopper-selected replacements were available at fulfillment, and an A/B…

What tools did this team use?

Levenshtein distance, Siamese network, BERT.

What results were reported?

Replacement candidate set coverage: more than 95%; Replacement issues per delivery: statistically significant improvements (source-reported, not independently verified).

What failed first in this deployment?

The original replacement schema used a single ranking across all retailers, which created a bias toward universally available brand-name products and ignored store-brand alternatives, causing customer complaints about…

How is this ecommerce ops AI workflow structured?

Out-of-stock signal → Candidate generation → Deep learning ranking → Engagement model for head products → Ensemble score combination → Retailer-aware recommendations served.