From Activity to Intent: Generating User Journeys with LLMs

Open the original

Short summary

Pinterest replaced its multi-stage clustering pipeline with a single 4-billion-parameter LLM that reads user activity logs and outputs ranked journey names—goals like "Modern Farmhouse Kitchen" rather than generic interests. They distilled this from expensive frontier models into a deployable student model using synthetic training data.

  • The old clustering system fragmented related activities (cabinets, countertops, backsplash treated as separate journeys) and fell back to generic labels like "Art" or "Shopping" when clusters were messy. Collapsing the pipeline into one generative model solved this by reading the full activity sequence at once.
  • Prompt engineering became the ranking and safety policy—all the logic previously encoded in separate model weights and thresholds now lives in explicit instructions about engagement strength, recency, coherence, and specificity. Changes to prompts are treated as launches requiring review discipline.
  • The 4B student model achieves frontier-model quality at scale through distillation: frontier models generate synthetic training examples from real activity histories, then the smaller model learns to replicate those outputs at inference cost Pinterest can actually afford for hundreds of millions of users.

Full summary

Pinterest realized that recommending individual pins misses what users actually want—to accomplish specific goals like planning a kitchen renovation or learning to make sourdough. They call these multi-week, multi-session pursuits "journeys," and the company built a system to detect them from user activity logs. The old approach used a multi-stage pipeline: extract keywords from searches and saves, cluster them hierarchically, name clusters by their top keywords, then rank and filter the results. It worked reasonably well—journey-aware notifications beat interest-based ones by 88% on email click rate and 32% on push opens—but the pipeline fragmented related activities (cabinets, countertops, backsplash treated as separate journeys instead of one kitchen project) and fell back to useless generic labels like "Shopping" when clusters got messy. They scrapped the pipeline and reformulated the problem as pure generation: feed an LLM a user's profile and chronological activity log, get back a ranked JSON list of journey names. The prompt design is deliberate. Actions collapse into five categories ordered by strength (search/save strongest, dislike weakest). Events group by date and action type to save tokens and show same-session bursts clearly. Dislikes go in explicitly—the model learns to suppress journeys backed mostly by negative signals unless there's offsetting positive engagement. They run at temperature 0 with reasoning off for deterministic, cheap inference. The model reads up to 150 events across 360 days and outputs at most 300 tokens. The entire approach ditches the classical multi-stage recommendation stack—no separate keyword extraction, embeddings, clustering, or naming models. One 4-billion-parameter LLM does it all. They distilled this from a larger frontier model so they could actually serve it at scale. The system works at notification scale and the recipe generalizes: any platform with sequential user activity and structured goals (e-commerce, streaming, search) can apply the same activity-to-intent formulation to collapse their recommendation pipelines into a single generative model.

Ask about this article