Ecommerce ops · Production

Shopify builds a generative recommender from raw buyer event sequences with measurable production impact

The problem

At Shopify's scale—millions of products and billions of events—building consistently relevant recommendations requires a model that can process the full buyer event sequence rather than a summary, and operate within real production latency constraints.

Workflow diagram · grounded in source
1
Buyer event sequence captured
trigger
“A buyer's journey through Shopify isn't a click. It's a sequence—searches, views, add-to-carts, favorites, purchases—spread across storefronts and the Shop app, stretching back months.”
2
Autoregressive next-product prediction
ai_action
“we train an autoregressive model with a causal mask so it learns to predict the next token. In our case, the token is typically a product.”
3
Time-aware attention encoding
ai_action
“We used a RoPE-inspired rotary encoding so attention can carry an absolute (like notion of time), and we combined it with relative attention bias so the model can represent time gaps and recency.”
4
Negative sampling for training quality
ai_action
“Shared negatives let us effectively expand the negative pool by sharing across the batch, which increases coverage without exploding memory the way per-example negatives can.”
5
Ensemble retrieval and ranking
integration
“A production recommender system is usually an ensemble. Multiple retrieval models generate candidates, rankers reorder them, and aggregation layers handle deduplication, diversity, and business constraints.”
6
Real-time recommendations served
output
“a system that learns directly from raw event sequences, operates within real production latency constraints, and delivers measurable impact at scale”
Reported outcome

Online AB testing of the deployed generative recommender showed a 0.94% relative increase in Shop orders, a 5% relative increase in high quality click-through rate, a 0.71% relative increase in conversion rate, and a 4.8% relative lift in final served product recall at 2.

Reported metrics
Shop orders0.94% relative
High quality click-through rate5% relative
Conversion rate0.71% relative
Training pipeline speedup7.3x
Reported stack
HSTUCUDA
Source
https://shopify.engineering/generative-recommendations
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Online AB testing of the deployed generative recommender showed a 0.94% relative increase in Shop orders, a 5% relative increase in high quality click-through rate, a 0.71% relative increase in conversion rate, and a…

What tools did this team use?

HSTU, CUDA.

What results were reported?

Shop orders: 0.94% relative; High quality click-through rate: 5% relative; Conversion rate: 0.71% relative; Training pipeline speedup: 7.3x (source-reported, not independently verified).

How is this ecommerce ops AI workflow structured?

Buyer event sequence captured → Autoregressive next-product prediction → Time-aware attention encoding → Negative sampling for training quality → Ensemble retrieval and ranking → Real-time recommendations served.