Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 8 min read Case study mediumAdept

Evolution of Product Classification at Shopify: From Categories to Comprehensive Product Understanding

Shopify's product classification evolved from a 2018 TF-IDF logistic regression model through a 2020 multi-modal classifier to a Vision Language Model system built on the Shopify Product Taxonomy, which covers over 10,000 categories and 1,000+ attributes. A Dataflow pipeline makes two dependent calls to a VLM service (currently Qwen2VL 7B with FP8 quantization, served via NVIDIA Dynamo on Kubernetes with in-flight batching and KV caching): one predicts the category, the other predicts category-specific attributes, and both must succeed. Training data comes from multiple LLM annotators, with judge models arbitrating disagreements and humans reviewing edge cases. The system handles over 30 million predictions a day, merchants accept 85% of predicted categories, and hierarchical precision and recall doubled compared with the earlier neural approach.

Assumes: LLM inference basicsmulti-modal models

Related posts

  • Beyond classification: How AI agents are evolving Shopify's product taxonomy at scale

    Shopify Engineering easyNovice

    Shopify maintains its 10,000+ category, 2,000+ attribute product taxonomy with a multi-agent LLM system. One agent analyzes the taxonomy's structure and another analyzes real merchant product data. A synthesis step merges their proposals, and an equivalence-detection agent finds cases where a specific category equals a broader category plus attribute filters (e.g., Women's Golf Shoes = Athletic Shoes + Activity Type=Golf + Gender=Women). Change-type and domain-specific LLM judges filter proposals before human review, as in a MagSafe-compatible attribute approved at 93% confidence. A Telephony pilot compressed what would have been years of manual expansion into weeks.

  • Leveraging multimodal LLMs for Shopify’s global catalogue: Recap of expo talk at ICLR 2025

    Shopify Engineering mediumAdept

    Shopify's Global Catalogue uses fine-tuned open-source vision LLMs (LLaVA 1.5 7B, then LLaMA 3.2 11B, now Qwen2VL 7B) to classify, extract attributes from, standardize and match billions of merchant product listings. The system has four layers: streaming product data with change data capture, multi-task product understanding, graph-based product matching (LSH and embedding candidates, discriminator edge pruning, connected components) and canonical record reconciliation. Training each model to predict a randomly selected subset of fields kept it generalizable and cut median latency from 2s to 500ms and GPU usage by 40%. LLM-agent annotation with an LLM arbitrator, instruction-following eval metrics and active learning driven by low token probabilities support 40M inferences a day on Triton with FP8 quantization.

  • Using Rich Image and Text Data to Categorize Products at Scale

    Shopify Engineering mediumAdept

    Shopify rebuilt its product categorization model as a multi-task, multi-class neural network that predicts all seven levels of the hierarchical Google Product Taxonomy. Multilingual BERT text embeddings and MobileNet-V2 image embeddings feed stacked hidden layers, with each level's output passed into the next level's prediction. Training combines the seven per-level losses with weights and uses class weights to handle imbalance, without forcing child predictions to match the parent. At inference, a Keras subclass model walks the taxonomy and only considers descendants of the chosen parent, and per-level confidence thresholds are hand-tuned for sensitive categories. The 250M-parameter model, trained with data-parallel distributed TensorFlow on GCP, raised leaf precision by 8% and nearly doubled coverage.

  • Clustering billions of products for agentic commerce with Catalog API

    Shopify Engineering mediumAdept

    Shopify's Catalog groups billions of merchant product listings under Universal Product Identifiers (UPIs) using a precision-first pipeline. It sets a hard precision threshold and maximizes recall under it, because a wrong merge is worse for buyers than a missed variant. A singleton detector parses Liquid theme code and resolves most shops deterministically. The remaining catalogs are pre-chunked with HNSW/FAISS nearest-neighbor graphs and sparse UPGMA average linkage (distance threshold 0.25, max 200 products per chunk). A two-stage LLM pipeline then extracts brand and model strings using a 'core value proposition' test, and a second critique pass flags outliers in each proposed cluster. Dynamically generated strict JSON schemas, with one required property per product ID, guarantee every product is labeled without skips or malformed output.

  • Cross-store product clustering across millions of stores

    Shopify Engineering hardMaster

    Shopify groups listings of the same product across millions of stores under a global Universal Product Identifier using a three-stage pipeline: embedding-based approximate nearest-neighbor retrieval to find candidate pairs, tiered pair scorers, and graph clustering. The scorers trade cost for precision. L1 is a GBDT on cheap pair features run over trillions of pairs, L2 is a fine-tuned multilingual E5 cross-encoder over both listings' text, and L3 is an image-aware reranker for selected pairs. All three are trained on LLM-judge labels validated against human annotations. To scale clustering, the graph is split into size-bounded components with a parallelized, score-ordered bounded union-find whose budget is degree-weighted. Within each component, hierarchical agglomerative clustering uses a learned GBDT merge rule built on support, coverage, cohesion and contradiction features, tuned for precision first and trained iteratively on its own policy's decisions.

The quest for software engineering knowledge.

Look:
Layout: