From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart
Instacart replaced its BERT-based ads retrieval model, which scored every atomic product ID in a fixed vocabulary, with a generative model that autoregressively decodes Semantic IDs (RQ-VAE codeword sequences) via beam search. The goal was to fix vocabulary bottlenecks, cold-start bias toward popular items, and incoherent candidate sets. Prompts combine a retailer-type token, user history SIDs and cart SIDs. SIDs shrink embedding parameters 125x and give new products coverage from day one, while beam width and temperature act as dials between precision and diversity. Serving moved from Python on CPU to a Go service on TensorRT-LLM and Triton. Mean latency dropped 10–17% despite roughly twice the candidates, and A/B tests showed +5% CTR and +34% add-to-carts.
Related posts
- GenRecs Tokenization: Transforming Ads Recommendation at Meta with Stable Model Vocabulary
Meta Engineering hardMasterMeta's ads recommender replaces per-item IDs with GenRecs Tokenization, a stable semantic vocabulary. Each ad, product or page is encoded with pre-trained multimodal models, decomposed into subspaces (e.g. residual decomposition) and quantized against learned codebooks into short token sequences, so similar items share tokens. This lets new and tail items inherit what the model learned about related items, enabling cold-start generalization and cross-campaign transfer. Paired with GEM and the Adaptive Ranking Model it delivered a +0.35% conversion lift. Across eight tokenizer versions, intrinsic metrics (cluster purity, distribution balance, codebook utilization) correlated with downstream CTR accuracy, so the tokenizer can be iterated without full model retraining.
- Shopify’s generative discovery model
Shopify Engineering hardMasterShopify trained a single generative model, adapted from an open-weight LLM, that emits semantic-ID tokens to generate product candidates for both personalized search and recommendation across a catalog of billions. Products are tokenized with RQ-KMeans into three-token semantic IDs (three 8,192-entry codebooks). Training combines joint continued pretraining, upsampling of first-purchase discovery events, RL with an LLM relevance judge (+1.5 OneDCG@10) and multi-teacher distillation from task experts. For serving, LFM2-2.6B was chosen for its 25.5 ms p95, GPU trie-constrained decoding via STATIC cut constraint overhead from 50 ms to about 1 ms, and multi-token prediction replaces autoregressive decoding. In production the model lifted home-feed orders by 7.95% and search OneDCG@10 by 2.1 points.
- Semantic IDs: Product Understanding at Scale
Instacart Tech hardMasterInstacart compresses product text embeddings into 4-level semantic IDs using a residual vector quantizer (RQ-VAE), so products with related meaning share code prefixes across taxonomy branches (e.g., Italian cheeses, olives and tapenades under 6_19). A contrastive regularizer (λ=0.01) uses catalog-tree distance as supervision, with hierarchical batch sampling, which helps cold-start products that lack engagement data. Two embedding flavors serve different needs: ESCI for precise substitution and search, and Gemini-extracted attributes embedded with Gemma for broader discovery. Intrinsic evaluation (similarity-depth correlation of 0.69–0.84, LLM cluster scoring, taxonomy alignment) showed failures from sparse product text and exposed mislabeled catalog items. Generative retrieval over the ~2,000-token code vocabulary delivered +34% add-to-carts on carousels.
- Empowering Carrot Ads with Domain Adaptive Learning
Instacart Tech easyNoviceInstacart tackles the cold-start problem for Carrot Ads partners by transferring knowledge from its data-rich Marketplace (source domain) to new retailer sites (target domain) when predicting click-through rates. The wide-and-deep pCTR model reuses pre-trained embedding layers and fine-tunes later layers on limited partner data. On the data side, it aligns features such as product taxonomy across domains and trims low-importance features to meet auction latency budgets. The adapted models raised CTR, clicks per user and ad revenue even where enough partner data existed to train from scratch, though schema mapping still needs human-in-the-loop checks to avoid negative transfer.
- Our Early Journey to Transform Instacart’s Discovery Recommendations with LLMs
Instacart Tech mediumAdeptInstacart rebuilt its Shopping Hub discovery recommendations around a top-down, cascaded LLM pipeline. It first generates personalized page themes, then taxonomy-grounded retrieval keywords, then applies quality and diversity filtering, and finally hands off to existing product and pagewise ranking services. Keyword generation uses a teacher-student fine-tuned open-weight model (Llama/Qwen with LoRA ablations). It also uses RAG that prunes a 300,000-term keyword corpus to about 100 nearest neighbors per theme, which cut generation costs 15–20%. Quality is enforced through embedding-based deduplication, LLM-as-a-judge evaluators calibrated with human-in-the-loop data, and a fine-tuned cross encoder for theme-product relevance at scale.