Shopify’s Generative Discovery Model for Personalized Commerce
Shopify integrates search and recommendation into a unified generative model to improve product discovery.
1Unified Discovery Architecture
Shopify has deployed a shared generative discovery model to handle both search and recommendation tasks. By training on combined commerce data, the system leverages buyer context and product knowledge to generate relevant candidates. This approach replaces siloed systems, allowing the model to learn from diverse shopping behaviors across millions of merchant storefronts.
2Semantic Product Representation
The system represents billions of products using semantic-ID tokens rather than raw database IDs. Using RQ-KMeans clustering, Shopify maps products into a three-token sequence, enabling the model to learn relationships between similar items. This method allows products with sparse interaction data to benefit from the learned representations of their neighbors.
3Training Recipe Strategy
The training process begins with an open-weight pretrained language model, which is then fine-tuned on commerce-specific datasets. Shopify uses multi-teacher distillation to combine specialized search and recommendation experts into one student model. This ensures the shared model retains high performance across both tasks while benefiting from the unique strengths of each.
4Search Quality Improvements
The generative model significantly boosts search performance, achieving a 2.1-point gain in OneDCG@10 metrics. For signed-in users, personalization capabilities drive a 2.7-point improvement, with 25% of queries showing better relevance in top results. These gains demonstrate the effectiveness of integrating buyer intent signals directly into the candidate generation process.
5Recommendation Performance Gains
In offline evaluations, the model contributes a 2.65pp increase in Incremental Pool Recall for recommendation systems. It currently serves as the strongest standalone candidate generator within the production stack. By focusing on discovery events, the model successfully identifies useful products that buyers have never interacted with, moving beyond simple historical retargeting.
6Discovery-Focused Fine-Tuning
To prioritize discovery, Shopify upsamples training streams centered on first-time purchases and category exploration. The team also compresses buyer histories by removing stale interactions, ensuring the model focuses on recent behavior. This strategy helps the system avoid overemphasizing products the buyer already knows, leading to a 10–15% relative improvement in discovery recall.
7Reinforcement Learning Integration
Shopify utilizes an LLM-based relevance judge to provide reward signals for search candidates. Through reinforcement learning, the model refines its choices based on the judge's feedback, directly improving retrieval quality. This technique resulted in a 1.5-point lift in OneDCG@10, bridging the gap between token prediction accuracy and actual search relevance.
8Optimized Serving Infrastructure
The model uses Liquid AI’s LFM2-2.6B architecture, chosen for its balance between quality and latency. Served via the RIPL inference stack, the model operates within strict latency budgets required for live requests. This setup ensures that candidate generation remains fast enough to allow for subsequent ranking stages in the production funnel.
9Constrained Decoding Techniques
To ensure generated codes correspond to valid products, Shopify uses a sparse index representing the catalog’s prefix tree on the GPU. A custom CUDA/C++ plugin enforces these constraints during decoding. This implementation reduced constraint overhead from over 50 milliseconds to approximately 1 millisecond per request, significantly improving overall system efficiency.
10Multi-Token Prediction Efficiency
Shopify is transitioning from autoregressive generation to multi-token prediction to optimize throughput. By predicting distributions for all three semantic-ID positions in a single pass, the model reduces sequential processing time. This efficiency gain allows for larger candidate sets, which are then refined by a lightweight ranker to maintain high quality.
11Future Discovery Roadmap
The long-term goal is to consolidate the multi-stage discovery funnel into a single, comprehensive model. This future system would handle intent reasoning, candidate generation, and ranking within one architecture. Shopify plans to incorporate richer multimodal representations and online continuous training to better understand evolving buyer preferences and complex shopping journeys.
12Impact on Commerce Ecosystem
This generative approach marks a shift toward more intelligent, context-aware product discovery at scale. By unifying search and recommendation, Shopify provides a more cohesive experience across the Shop app and merchant storefronts. The model’s ability to infer intent and adapt to user behavior sets a new standard for personalized online retail.