---
title: "From Activity to Intent: Generating User Journeys with LLMs"
description: "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."
url: "https://swe.quest/articles/from-activity-to-intent-generating-user-journeys-with-llms-0ff3c950d1bbfa2d"
canonical: "https://medium.com/pinterest-engineering/from-activity-to-intent-generating-user-journeys-with-llms-9652b9417626"
source: "Pinterest Engineering"
published: "2026-10-09"
difficulty: "medium"
kind: "Case study"
reading_minutes: 15
tags: ["recommendation-systems","llms","inference","model-training","evals"]
---

# From Activity to Intent: Generating User Journeys with LLMs

A post on [Pinterest Engineering](https://swe.quest/sources/pinterest.md), published 2026-10-09, 15 min read, Case study. Original: [https://medium.com/pinterest-engineering/from-activity-to-intent-generating-user-journeys-with-llms-9652b9417626](https://medium.com/pinterest-engineering/from-activity-to-intent-generating-user-journeys-with-llms-9652b9417626)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)

## Prerequisites

- LLM fine-tuning basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- recommender systems ([easy posts on Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md?difficulty=easy))
- LLM inference serving ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))

## Keywords

Qwen3, LoRA, vLLM, NVIDIA Dynamo, PagedAttention, L40S, Pinterest

## Related posts

- [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.
- [Distilling Long-Tail User Behavior into Scalable Embeddings for Job Search](https://swe.quest/articles/distilling-long-tail-user-behavior-into-scalable-embeddings-for-job-search-bf9edf6cf1d311a4.md): Indeed Engineering · 2026-06-03 · Hard · 11 min read · Recommendations & ranking, ML platforms, Machine learning, Search
  Indeed'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.
- [Bypassing inference bottlenecks: Accelerating complex AI search with Retrieve-for-Train](https://swe.quest/articles/bypassing-inference-bottlenecks-accelerating-complex-ai-search-with-retrieve-95676e43f1ce9cc3.md): Google Research · 2026-09-15 · Hard · 8 min read · Search, Model training, Inference & serving, LLMs, Recommendations & ranking
  Retrieve-for-Train replaces expensive inference-time LLM reasoning for query fan-out with a one-time offline RL stage.
- [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.
- [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.

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)
