---
title: "Semantic IDs: Product Understanding at Scale"
description: "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)."
url: "https://swe.quest/articles/semantic-ids-product-understanding-at-scale-cd44ffa781feba70"
canonical: "https://tech.instacart.com/semantic-ids-product-understanding-at-scale-5283e0288f5a"
source: "Instacart Tech"
published: "2026-06-02"
difficulty: "hard"
kind: "Case study"
reading_minutes: 10
tags: ["recommendation-systems","machine-learning","model-training","ecommerce","evals"]
---

# Semantic IDs: Product Understanding at Scale

A post on [Instacart Tech](https://swe.quest/sources/instacart.md), published 2026-06-02, 10 min read, Case study. Original: [https://tech.instacart.com/semantic-ids-product-understanding-at-scale-5283e0288f5a](https://tech.instacart.com/semantic-ids-product-understanding-at-scale-5283e0288f5a)

## Summary

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). 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.

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)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [E-commerce](https://swe.quest/tags/ecommerce.md) (Domains)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)

## Prerequisites

- vector embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- vector quantization / VAEs ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- contrastive learning
- recommender systems ([easy posts on Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md?difficulty=easy))

## Keywords

Semantic IDs, RQ-VAE, TIGER, PLUM, ESCI, Gemma, Gemini Flash, Instacart

## Related posts

- [From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart](https://swe.quest/articles/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-1eba18ee15c15a7e.md): Instacart Tech · 2026-06-02 · Hard · 13 min read · Recommendations & ranking, Ads, Inference & serving, ML platforms
  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.
- [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.
- [Shaping Product Understanding with Contrastive Reinforcement Learning](https://swe.quest/articles/shaping-product-understanding-with-contrastive-reinforcement-learning-dd8440354bbdc8d2.md): Etsy Code as Craft · 2026-05-26 · Hard · 9 min read · Model training, LLMs, Search, Recommendations & ranking, E-commerce
  Etsy fine-tunes Qwen3-VL-8B with GRPO to generate natural-language listing summaries that capture distinguishing product details buried in long descriptions, attributes and images.
- [Understanding Etsy’s Vast Inventory with LLMs](https://swe.quest/articles/understanding-etsy-s-vast-inventory-with-llms-1fa28367e98029f1.md): Etsy Code as Craft · 2025-10-13 · Medium · 7 min read · LLMs, Evaluation, E-commerce, Search, Data pipelines
  Etsy extracts structured product attributes such as color, material and dimensions from unstructured listing titles, descriptions and photos using LLMs.
- [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)
