How DoorDash learned which grocery item can stand in for another
In September 2022 DoorDash described how it moved the out-of-stock question from a phone call in the store to a choice the customer makes before the shop starts. The ranked list of substitutes came from three models in turn, name similarity, a LightGBM classifier trained on thumbs-up and thumbs-down, and a deep model with search embeddings. The post shows no numbers. The product idea is now a four-way choice in DoorDash's app and an order API field.

A grocery order is missing one item, and someone has to decide what goes in its place. Ask the customer from the aisle and you get the right answer slowly. Guess and you get it fast, sometimes wrong.
DoorDash, the US delivery company, described its answer in a post by Dawn Lu on 8 September 2022. The live page now sits behind a bot check, so we read the archived copy taken the minute it went up.
The problem: a phone call in the aisle
A DoorDash courier, a Dasher, shops the order in the store. The post names two problems: the item is out of stock or cannot be found, and "the Dasher can’t find a good substitution for an out-of-stock item on the customer’s behalf". It tackles only the second.
"Dashers would have to call or text customers while they were in the store to discuss alternative options and agree on a substitute item." That could find a good swap, but "it was time-consuming and exhausting for both the customer and the Dasher."
The business reason: when the swap works, "DoorDash does not need to refund the cost of the original item and the merchant doesn’t lose out on any sales."
The design: ask before the shop starts
DoorDash set out "to create a low-friction way to collect a customer’s substitution preferences ahead of time." For each item, the app shows a short list of recommended substitutes, plus contact me and refund. The customer picks, and "Dashers then could meet customer needs without any back-and-forth communication." Our redraw is at the top.
So the feature rests on one question: is item B a good substitute for item A? The post answers it three times.
How they built it: three models, one question
1. No labels yet: name similarity. "We found a simple yet effective technique for identifying similar items involved using TF-IDF cosine similarity based on an item’s name." TF-IDF weights the words in each name, and cosine similarity scores how much two names overlap. A taxonomy from the catalog team kept the matches "to relevant categories." For a 12-pack of Coca-Cola, it suggested other Coca-Cola products.
2. Ask customers, then train a classifier. To get labels, DoorDash asked customers to rate suggested swaps thumbs-up or thumbs-down. Those trained "a binary classifier to predict the probability that any item in our catalog would be a good substitute for an ordered item." The team picked LightGBM, a gradient-boosting library, for "its relatively high performance with minimal hyperparameter tuning". They taught something new: "Customers who have ordered a 12-pack of Coca-Cola would rather substitute a 12-pack of Pepsi or Dr. Pepper than a two-liter bottle of Coke." In short, "quantity is more important than brand loyalty when customers are ordering in bulk."
3. Borrow meaning from search. The third version is a deep learning recommendation model, DLRM in PyTorch, a design Facebook published in 2019. Its item embeddings, a list of numbers per product, "are trained on the search behaviors of DoorDash users", reused from earlier DoorDash work. That helped items with "less historical customer feedback because of relatively lower purchase volume." For canned green beans, LightGBM suggested canned corn and the deep model canned green peas, "because item embeddings accurately represent that beans are more similar to peas than corn."

How they measured it
The post admits this was the hard part: "One of our biggest challenges from the start was measuring the quality of our substitution recommendations and quantifying improvements."
Before labels, the team built a "golden" set: ideal substitutes for top-selling items, chosen by people. They "compared what percentage of the algorithm’s recommendations were matched by human-curated substitutions." Once labels arrived, AUC compared model versions offline. Online, experiments tracked "customer approval rate (which represented the relevance of our recommendations) and coverage (percent of ordered items with recommendations)", then how often unfound items were substituted and how customers rated the swaps.
That ladder is worth copying: a human answer key with no data, a standard metric once you have some, live behaviour as the judge. Approval and coverage pull against each other: offer only safe matches and you cover fewer items.
What it delivered
The full result claim: "we were able to improve our business metrics by a substantial amount." No AUC, no approval rate, no coverage, no refund rate, no baseline, no launch date for any version. The three examples are single hand-picked cases. They show what a model can do, not how often.
The lessons are clearer: "(1) don’t underestimate simple solutions and (2) if labeled data is scarce, it can be worthwhile to invest in collecting item metadata."
What has changed since
We found no later DoorDash post on this model. The idea itself is now product and API.
DoorDash's help page offers four choices: "Go with Similar Item", "Pre-Select Substitutes", "Refund this item" and "Contact Me". With no preference set, "the Shopper may select for you a suitable substitution, where appropriate", and that shopper "cannot ensure that the substitute product caters to your specific dietary requirements".
The developer docs for merchant integrations go further: "based on our machine learning model, Doordash can also implicitly set out_of_stock_preference" to substitute. They mention "price guardrails and other guardrails (subbing alcohol item for non-alcohol item etc.)". Neither page is dated.
An April 2024 post on DoorDash's product knowledge graph says "attributes such as product category and size enable recommending more relevant substitutions". An April 2026 post lists substitution among the uses of new embeddings built with gemini-embedding-001. It does not say whether that replaced the 2022 model.
Instacart published its own design in a November 2024 post. Two additions. Popular pairs are scored from their own history, blended with a model for rare items. And rankings are per retailer, "(retailer_id, source_product_id, replacement_product_id)", because store brands lost to national brands and customers complained about paying more. Instacart gives no lift figure either.
Why it matters for your business
In Indonesia, the grocery apps we checked describe refunds or cancellations, not a substitute choice. Astro's terms, in force from 13 April 2026, say that if an item is unavailable, "ASTRO akan menginformasikan kepada Pembeli dan melakukan pengembalian dana". The GrabMart FAQ says it will contact you, cancel, and ask you to reorder. Sayurbox handles "stok habis" with a refund claim within three days. Public pages only; in-app flows may differ.
Every refund is a lost sale, and every cancel-and-reorder makes the customer shop twice.
UU 8/1999 on consumer protection has no rule on substitution. But Pasal 4 b gives the consumer "hak untuk memilih barang dan/atau jasa" and to receive them as promised, and Pasal 16 a bars a seller taking orders from not honouring the order as agreed. Our reading: an unasked swap is risky, and one the customer chose in advance is far safer. Halal labelling sits in Pasal 8, so treat halal as a hard rule. Not legal advice; check with counsel.
How we would build it today

Picture an Indonesian supermarket with delivery: a few thousand SKUs, Indonesian product names, picker notes.
- Clean the catalog first. Brand, variant, size and unit (ml, gr, "isi 12"), price per unit, halal flag, allergens. DoorDash's own lesson.
- Start with rules and name similarity. Same product type, similar size, then TF-IDF on character n-grams so "gr" and "gram" still match. Days of work, and a baseline.
- Filter before you rank. Halal stays halal, no allergens, no alcohol, a price cap, in stock at this branch today.
- Turn history into labels. Past swaps that were accepted, refunded or complained about are labelled pairs. Add a thumbs-up or thumbs-down, as DoorDash did.
- Then a gradient-boosted pair model. LightGBM (MIT licence) on size ratio, price ratio, same brand, name similarity and the pair's past acceptance. Skip the deep model until feedback volume demands it.
- Remember popular pairs. Instacart's idea: for items swapped often, the pair's history beats a model.
- Give four choices. Similar item, pick from a list, contact me, refund as the easy default. Log what was offered and chosen, per item.
- Measure like DoorDash, report better. A golden set from store staff, then approval, coverage and refund rate against the rules-only version.
For most stores steps 1 to 3 already beat an automatic refund. The model earns its place once the labels exist.