From Activity to Intent: Generating User Journeys with LLMs
Pinterest replaced a multi-stage keyword-clustering pipeline for inferring user "journeys" (long-horizon goals like a kitchen remodel) with a single fine-tuned 4B Qwen3 model. The model reads a compact chronological activity log and emits a ranked JSON list of localized journey names, with the prompt itself encoding ranking, dedup, noise and safety policy. The student was distilled via LoRA SFT from frontier-model teacher outputs; a few thousand diverse, hard examples were enough, and 4B beat 0.6B/1.7B/8B on the quality/throughput tradeoff. Serving uses NVIDIA Dynamo with vLLM on ~100 L40S GPUs at ~775 req/s (p50 1.2s, p95 3.0s), with KV-aware routing and prefix caching, and skips recently inferred users. Online tests showed 1.1% email CTR and 1.3% push open lifts over the clustering system.
Related posts
- Our Early Journey to Transform Instacart’s Discovery Recommendations with LLMs
Instacart Tech mediumAdeptInstacart rebuilt its Shopping Hub discovery recommendations around a top-down, cascaded LLM pipeline. It first generates personalized page themes, then taxonomy-grounded retrieval keywords, then applies quality and diversity filtering, and finally hands off to existing product and pagewise ranking services. Keyword generation uses a teacher-student fine-tuned open-weight model (Llama/Qwen with LoRA ablations). It also uses RAG that prunes a 300,000-term keyword corpus to about 100 nearest neighbors per theme, which cut generation costs 15–20%. Quality is enforced through embedding-based deduplication, LLM-as-a-judge evaluators calibrated with human-in-the-loop data, and a fine-tuned cross encoder for theme-product relevance at scale.
- Distilling Long-Tail User Behavior into Scalable Embeddings for Job Search
Indeed Engineering hardMasterIndeed's user behavior model (UBM) runs heavy transformer sequence modeling over long user histories offline, distills each user into a fixed-length embedding refreshed daily via batch inference, and serves it through a feature store as one more dense feature for many compact production ranking, recommendation and bidding models. Moving from per-action sequences (apply, click, impression) fused late to a single chronologically merged timeline with event-type embeddings roughly doubled downstream ROC-AUC gains, e.g. CTR lift from +1.6% to +3.5%. Storing jobs in a side table with cached GPU lookups instead of materializing joins gave over 100× faster training. Production lifts include +5.24% application rate on email recommendations and +2.89% NDCG@10 on employer resume search. The main tradeoff is that attention is not conditioned on the target job at scoring time.
- Bypassing inference bottlenecks: Accelerating complex AI search with Retrieve-for-Train
Google Research hardMasterRetrieve-for-Train replaces expensive inference-time LLM reasoning for query fan-out with a one-time offline RL stage. A 4B fan-out language model (Gemma3-4B or Qwen3-4B) is trained with Soft-GRPO on a composite set-level reward that combines groundedness to the database manifold, Vendi Score diversity and query alignment. The trained model then synthesizes query-to-target-set pairs, which are distilled into a 53.9M-parameter diffusion retriever that produces a whole slate of target embeddings in one non-autoregressive pass. On fashion (CLIP) and music playlist (MuLan) retrieval it beats zero-shot expansion and Best-of-N, with a 12–20x speedup, staying at sub-second to a few seconds where autoregressive fan-out reaches nearly 50 seconds. Ablations show that without the diversity term the policy reward-hacks into degenerate strings.
- Shopify’s generative discovery model
Shopify Engineering hardMasterShopify 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. Products are tokenized with RQ-KMeans into three-token semantic IDs (three 8,192-entry codebooks). Training combines joint continued pretraining, upsampling of first-purchase discovery events, RL with an LLM relevance judge (+1.5 OneDCG@10) and multi-teacher distillation from task experts. For serving, LFM2-2.6B was chosen for its 25.5 ms p95, GPU trie-constrained decoding via STATIC cut constraint overhead from 50 ms to about 1 ms, and multi-token prediction replaces autoregressive decoding. In production the model lifted home-feed orders by 7.95% and search OneDCG@10 by 2.1 points.
- From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart
Instacart Tech hardMasterInstacart 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.