How Instacart Uses Embeddings to Improve Search Relevance

Xiao Xiao, Taesik Na, Tejaswi Tenneti, Guanghua Shu15 Sep 2022

Problem

Instacart search covers over 1 billion products from 900+ retailers. Fewer than 1000 popular queries make up more than 50% of traffic, and a long tail of specific or broad queries ("appetizers") has little engagement data. Keyword and category matching miss relevant items for these queries. Raw conversion logs are a poor relevance label: a customer searching "cereal" may add milk, and not buying a product says little about relevance.

Example from the article: for "milk" the model has to separate milk from milk chocolate, and for "tortilla" it has to tell tortilla chips from unrelated items such as a coffee mug.

Solution in brief

Instacart trained ITEMS, a two-tower transformer that puts queries and products in one vector space. Positives come from converted search impressions filtered by conversion rank, negatives come from the rest of the batch, and training runs in two stages (noisy, then clean). The embedding score is used for retrieval and as a ranking feature.

Questions this case answers
  • How to score the relevance of a short query to a large catalog when behavioral signals are sparse and skewed toward popular items
  • How to train a retrieval model from implicit positive-only feedback where non-conversion does not mean irrelevance
  • How to measure and retrieve query-relevant products when engagement and keyword signals are sparse?
  • How to build training pairs for a query-product relevance model from conversion logs without explicit negatives?

Tools and methods

  • Two-tower (bi-encoder) model — encodes queries and products independently so embeddings can be precomputed.
  • Sentence Transformers — pretrained weights for both towers.
  • In-batch negatives with self-adversarial re-weighting — negatives without mining; hard ones weigh more.
  • Cascade training — noisy warmup, then clean fine-tuning with untied towers.
  • Synthetic queries and multi-task heads — cover rare products, stabilize the product tower.
  • FAISS ANN index plus feature store — serves retrieval and query embeddings.
Continue reading — it's free

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