---
title: "From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart"
description: "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."
url: "https://swe.quest/articles/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-1eba18ee15c15a7e"
canonical: "https://tech.instacart.com/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-cf36b4e8d1bb"
source: "Instacart Tech"
published: "2026-06-02"
difficulty: "hard"
kind: "Case study"
reading_minutes: 13
tags: ["recommendation-systems","ads","inference","ml-platform"]
---

# From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart

A post on [Instacart Tech](https://swe.quest/sources/instacart.md), published 2026-06-02, 13 min read, Case study. Original: [https://tech.instacart.com/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-cf36b4e8d1bb](https://tech.instacart.com/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-cf36b4e8d1bb)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md) (AI & ML)
- [Ads](https://swe.quest/tags/ads.md) (Domains)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)

## Prerequisites

- transformer sequence models
- candidate retrieval for recommenders
- vector quantization ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- beam search ([easy posts on Elixir & Erlang](https://swe.quest/tags/elixir-erlang.md?difficulty=easy))

## Keywords

Semantic IDs, RQ-VAE, TIGER, TensorRT-LLM, Triton Inference Server, Griffin 2.0, BERT

## Related posts

- [GenRecs Tokenization: Transforming Ads Recommendation at Meta with Stable Model Vocabulary](https://swe.quest/articles/genrecs-tokenization-transforming-ads-recommendation-at-meta-with-stable-model-e3f3b6ea2626a2c2.md): Meta Engineering · 2026-10-19 · Hard · 6 min read · Recommendations & ranking, Ads, LLMs, Machine learning
  Meta's ads recommender replaces per-item IDs with GenRecs Tokenization, a stable semantic vocabulary.
- [Shopify’s generative discovery model](https://swe.quest/articles/shopify-s-generative-discovery-model-99e5ac502d9a8c68.md): Shopify Engineering · 2026-11-11 · Hard · 12 min read · Recommendations & ranking, Search, LLMs, Inference & serving, Model training
  Shopify 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.
- [Semantic IDs: Product Understanding at Scale](https://swe.quest/articles/semantic-ids-product-understanding-at-scale-cd44ffa781feba70.md): Instacart Tech · 2026-06-02 · Hard · 10 min read · Recommendations & ranking, Machine learning, Model training, E-commerce, Evaluation
  Instacart 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).
- [Empowering Carrot Ads with Domain Adaptive Learning](https://swe.quest/articles/empowering-carrot-ads-with-domain-adaptive-learning-6fcfdc76882408ae.md): Instacart Tech · 2026-05-04 · Easy · 5 min read · Ads, Recommendations & ranking, Machine learning, Model training
  Instacart 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.
- [Our Early Journey to Transform Instacart’s Discovery Recommendations with LLMs](https://swe.quest/articles/our-early-journey-to-transform-instacart-s-discovery-recommendations-with-llms-2b1f0ff7e32d37b4.md): Instacart Tech · 2026-02-26 · Medium · 14 min read · Recommendations & ranking, LLMs, RAG & retrieval, Evaluation, E-commerce
  Instacart rebuilt its Shopping Hub discovery recommendations around a top-down, cascaded LLM pipeline.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
