How Instacart Modernized the Prediction of Real Time Availability for Hundreds of Millions of Items While Saving Costs

Jack He17 Jul 2023

Problem

Instacart predicts the probability that a shopper finds each item (a product in a specific store). The catalog is hundreds of times larger than the daily stream of shopper signals, so most items have little or no data. The old batch model rescored all items every 2–4 hours at high cost, gave one score for every use, and was hard to explain.

Example from the article: a customer orders at night for early next-day delivery. The single score marks an item out of stock because the shelf is empty now, although it will be restocked by morning.

Solution in brief

The new model has three layers: General (typical availability from a sufficiently large sample), Trending (an XGBoost correction for the last days) and Real-Time (inference from the last observed status). Items are split by how recently they had a signal, and only the few frequent items get hourly and real-time scoring. A versioned API returns different scores for ordering and for shopper routing.

Questions this case answers
  • How to estimate the probability of a state per entity when most entities have too few observations for a standalone model
  • How to decide which entities deserve frequent or real-time scoring so that compute cost falls without hurting the metric
  • How to serve several versions of the same prediction to consumers that need different time horizons
  • How to predict whether an item is in stock when most catalog items have few or no observations?

Tools and methods

  • General score — found rate over the smallest local and recent sample that has at least K observations
  • Trending model (XGBoost) — deviation of recent availability from the General score
  • Real-time inference — last known status plus restocking-time distribution from history
  • Tiered scoring schedule — head, torso and tail items scored at different frequencies
  • Feature store and streaming pipeline (Griffin) — in-house stack for features and scores
Continue reading — it's free

Google or a one-time email code. No password.