Source-linked AI summary
PinRec: Unified Generative Retrieval for Pinterest Recommender Systems
Edoardo Botta, Jaewon Yang, Yi-Ping Hsu, Laksh Bhasin, Yilin Chen, Prabhat Agarwal, Anirudhan Badrinath, Jiajing Xu, Charles Rosenberg
TL;DR
Generative retrieval has shown promise, but serving multiple surfaces with differing goals and user behavior remains challenging, as does modeling evolving intent. PinRec combines cross-surface pretraining, surface-specific fine-tuning, and outcome-conditioned generation; it reports gains over baselines and deployment across Pinterest surfaces.
Problem
A unified generative retriever must accommodate surface-specific goals and data distributions while existing approaches are described as limited in capturing within-session intent shifts.
Source: §1 · p. 2Method
PinRec pretrains on user activity aggregated across surfaces, fine-tunes on surface-specific impression data, and generates autoregressively conditioned on outcomes.
Source: §1 · pp. 2–3, §4.4 · p. 5Results
PinRec outperforms baselines across the board, with outcome conditioning improving unordered recall @ 10 by +2-3% on Home Feed and Related Pins.
Source: §5.2.1 · p. 7Takeaways & Limitations
Abstract
from arXiv · showhide
Generative retrieval methods employ sequential modeling techniques, like transformers, to generate candidate items for recommender systems. These methods have demonstrated promising results in academic benchmarks, surpassing traditional retrieval models such as two-tower architectures. However, a key limitation is that current approaches require a separate model for each product surface, as building a unified model that accommodates the different business needs of various surfaces has proven challenging. Furthermore, existing methods often fail to capture the evolution of user interests over a sequence, focusing instead on only predicting the next item. This paper introduces Pinrec, a novel unified generative retrieval model for all of Pinterest's recommendation surfaces, including home feed, search, and related pins. Pinrec is pretrained on user activity sequences aggregated across surfaces, then fine-tuned for each surface using that surface's impression data. This pretraining-fine-tuning approach enables a single unified model while still adapting to the needs of individual surfaces. To better align recommendations with surface-specific business goals, Pinrec incorporates a novel outcome-conditioned generation mechanism that targets different outcomes for each surface, which further enhances the impact of fine-tuning. Our experiments show that Pinrec balances performance, diversity, and efficiency, delivering significant gains such as +4% increase in search saves. To our knowledge, this paper presents the first rigorous study of a unified generative retrieval model built and deployed at Pinterest scale, marking a significant milestone in the field.
1 Introduction
PinRec targets a unified generative retriever for Pinterest’s recommendation surfaces, where surface-specific goals and user behavior, evolving intent, and serving costs pose practical challenges. It combines cross-surface pretraining, surface-specific fine-tuning, and outcome-conditioned autoregressive generation.
1 Introduction
- Because ranking depends on retrieved candidates, retrieval must identify diverse, fresh, and relevant Pins.The introduction notes Pinterest’s scale, including over 600 million monthly active users and more than 1.5 billion Pins saved weekly.Source: §1 · p. 2
- Generative retrieval uses sequence models to generate candidates and has shown promising academic results against traditional two-tower retrieval.The paper frames a unified model as a way to share parameters and transfer learning across surfaces.Source: §1 · p. 2
- The paper identifies four production challenges: differing surface objectives and data distributions, shifts in within-session intent, and generative retrieval’s serving cost and latency.Surface goals include outbound clicks for Search, exploration for Related Pins, and saves and discovery for Home Feed.Source: §1 · p. 2
- PinRec is pretrained on activity aggregated across surfaces and fine-tuned on surface-specific impression data to serve multiple recommendation surfaces.The paper reports production deployment across three surfaces.Source: §1 · pp. 2–3, Figure 2 · p. 2
- Outcome-conditioned generation produces Pin-token sequences for selected outcomes, which can be combined to balance business objectives.The paper reports that offline and online evaluations show outcome conditioning adapts PinRec to each surface’s distinct business needs.Source: §1 · pp. 2–3
- Autoregressive multi-step generation captures evolving user interest, with up to +71% recall gains reported.The paper also describes low-latency decoding optimizations and infrastructure for serving hundreds of millions of users.Source: §1 · p. 3
2 Related Work
Related work spans sequential user modeling, generative recommendation, cross-surface unification, and multi-objective generation. PinRec is positioned as horizontal unification: one retrieval model serves multiple surfaces.
2 Related Work
- Sequential recommenders model interacted-item sequences, progressing from RNNs and transformers to pretrained language models; industrial systems also use sequential encoders for user representations.Those representations can feed embedding-based retrieval or ranking models.Source: §2 · p. 3
- Generative recommendation directly produces items, using either discrete semantic-ID tokens or continuous embeddings retrieved through approximate nearest-neighbor search.The passage describes discrete-token challenges at industrial scale, including invalid IDs and item collisions; PinRec follows the embedding-based paradigm.Source: §2 · p. 3
- Prior multi-stage training unifies retrieval and ranking within one surface, whereas PinRec pursues horizontal unification by fine-tuning one retrieval model across surfaces.The paper presents horizontal unification as a potential drop-in replacement at the retrieval stage of existing funnels.Source: §2 · p. 3
- Multi-objective generation includes reinforcement learning and supervised approaches such as goal conditioning and prompting; PinRec builds on the latter approaches for scalability.The passage notes that reinforcement learning can require extensive tuning for optimal generation.Source: §2 · p. 3
3 Problem Setup
The problem setup defines recommendations as ordered item lists generated for a user at a time, using interaction histories and the context of item types and surfaces. It also represents each surface feed view as shown items and any user actions on them.
3 Problem Setup
- The recommendation objective is to generate an ordered list of N items for user u at timestep t.The setup places users, items, actions, and surfaces in the system definition.Source: §3 · p. 3
- Items have types such as Pins, boards, or search queries, and users can click, save, share, or comment across recommendation surfaces.Surfaces include home feed, search results, board pages, and related Pins.Source: §3 · p. 3
- A user history is a chronological sequence of item interactions, each recording the item, action, surface, and timestep.The history is indexed through a maximum timestep.Source: §3 · p. 3
- A surface-specific feed view records shown items and their actions, including an impression marker when no explicit action occurs.For an impression without an action, the timestamp is set to the feed-view time.Source: §3 · pp. 3–4
- The sequential recommendation model maps interaction history, item types, and surface context to item scores, optimizing likelihood over observed interactions.The setup says this accounts for heterogeneous actions and surfaces.Source: §3 · p. 4
4 PinRec
PinRec uses a transformer decoder and outcome-conditioned generation with cross-surface pretraining and surface-specific fine-tuning. Its serving pipeline fetches user signals, generates candidate embeddings, and retrieves Pins, with reported latency and memory costs.
4.1 Model Architecture
- A causal transformer decoder processes ordered interaction histories into contextual states for next-item prediction, using item, temporal, and surface embeddings.Temporal signals include absolute timestamps and time since the previous action, capturing global temporal context and local session dynamics.Source: §4.1 · p. 4, §4.2 · pp. 4–5
- Outcome conditioning produces personalized item representations for specified engagement outcomes and surface constraints.During generation, one candidate embedding is produced per outcome; a sampled outcome’s embedding feeds back into the autoregressive loop, and retrieval budgets can be assigned by action type.Source: §4.1 · p. 4, §4.4 · p. 5
4.2 Input Sequence Representation
- Dense embeddings were chosen over Semantic IDs after representational collapse and lower evaluation metrics; ANN retrieval of continuous embeddings cannot hallucinate nonexistent items.At Pinterest scale, tens of thousands of items collided to the same Semantic ID; the representations also support generalization to unseen items such as Ads Pins and search queries.Source: §4.2 · pp. 4–5
4.3 Training Objective
- Pretraining predicts next items across-surface from user histories, while fine-tuning uses surface-specific sessions and histories and adds impression-only items as in-batch negatives.Both stages use teacher forcing and next-item prediction; fine-tuning computes per-position sequence losses on the surface-specific sequence.Source: §4.3 · p. 5
4.4 Inference
- Outcome-conditioned inference generates one embedding per outcome at each step, feeds a sampled outcome back autoregressively, and allocates retrieval budgets by action type.Similar generated embeddings are merged when their cosine similarity exceeds a threshold, with their allocated budgets summed.Source: §4.4 · p. 5
4.5 Serving
- The serving pipeline separates signal fetching, Pin featurization, autoregressive generation, and Faiss retrieval into stages within an NVIDIA Triton ensemble.Generated embeddings retrieve actual items through approximate nearest-neighbor search, and downstream ranking models can further refine the candidates.Source: §4.4 · pp. 5–6, §4.5 · p. 6, Figure 4 · p. 6
4.5.1 Signal Fetching.
- Signal fetching combines daily batch histories with real-time engagements; inference uses CUDA Graphs and KV caching, followed by CPU Faiss IVF-HNSW retrieval.Sequence-element embeddings are quantized to INT8 for transport and dequantized to FP16 for inference; Faiss retrieval uses inner product similarity.Source: §4.5.1 · p. 6, §4.5.2 · p. 6, §4.5.3 · p. 6
4.5.4 Serving Efficiency.
- At 80 QPS, PinRec-OC latency was p50 40ms/p90 65ms and PinRec-UC latency was p50 23ms/p90 46ms; GPU memory use was about 1.6GiB.Excluding KV Cache and CUDA graphs, memory use was roughly 250 MiB, similar to existing two-tower retrieval; parallelizing calls resulted in <1% added end-to-end latency.Source: §4.5.4 · p. 6
5 Offline Evaluation
Offline evaluations compare PinRec with established sequential and generative recommenders, then test how outcome conditioning, surface-specific fine-tuning, and autoregressive generation affect retrieval. The reported results show gains from these techniques, with conditioning and fine-tuning providing complementary benefits.
5.1 Offline Evaluation Metrics
- Unordered recall compares sets of generated embeddings with future targets; evaluation uses autoregressive prediction without teacher forcing against a 1M-item random index.A target counts as retrieved when at least one predicted embedding places it within the top-k results.Source: §5.1 · pp. 6–7
5.2.1 Model Evaluation.
- On held-out users, the study compares sequential and generative baselines with unconditioned and outcome-conditioned PinRec, without fine-tuning.The baselines include Pinnerformer, SASRec, TIGER, and HSTU.Source: §5.2.1 · p. 7
- PinRec outperforms the evaluated baselines across the board in unordered recall@10.The comparison covers major Pinterest surfaces.Source: §5.2.1 · p. 7, Table 1 · p. 7
5.2.2 Fine-tuning Evaluation.
- Removing outcome conditioning degrades recall 7.5–12.6% across surfaces; fine-tuning adds 2.0–4.5%, while impression positives hurt Related Pins and Search.The controlled ablation starts from PinRec-OC {FT, IN}; the two techniques’ benefits accumulate when combined.Source: §5.2.2 · p. 7, Table 2 · p. 7
5.2.3 Outcome-Conditioning’s Impact on Metrics.
- Conditioning on product outbound clicks yields a 16% lift; gains from outcome conditioning are larger for rarer outcomes.Product outbound click is described as a rare but important Search action.Source: §5.2.3 · pp. 7–8, Table 3 · p. 7
5.2.4 Autoregressive Generation Ablation.
- Related Pins gains most from autoregressive generation, with +71.4% recall lift at 16 steps versus one-step generation.The one-step baseline produces multiple embeddings in one forward pass without autoregressive feedback.Source: §5.2.4 · p. 8, Table 4 · p. 8
6 Online A/B Experiments
Online A/B experiments test PinRec as a candidate generator across Home Feed, Search, and Related Pins, alongside analyses of objective trade-offs and zero-shot retrieval. Results describe engagement changes and relevant candidate retrieval, including cross-surface effects from Related Pins.
6 Online A/B Experiments
- The A/B tests use PinRec recommendations as candidate generators alongside others, with ranking and blending left unmodified.Experiments cover Home Feed, Search, and Related Pins.Source: §6 · p. 8
6.1 Trading Off Objectives: A Pareto Analysis
- Varying outcome-action budgets traces a Pareto frontier between outcome rates, letting the business tune the trade-off between objectives.The reported rates are normalized by impressions; absolute values are omitted.Source: §6.1 · p. 8, Figure 5 · p. 8
6.2.1 Metrics.
- The experiments measure engagement actions, fulfilled sessions, and unfulfilled sessions; bolded reported metrics are statistically significant at the 5% level.The significance test is two-sided with p < 0.05.Source: §6.2.1 · p. 8
6.2.2 Home Feed.
- PinRec-OC delivers larger Home Feed gains in downstream actions and fulfilled sessions, while PinRec-UC increases grid clicks.The variants were evaluated as candidate generators in Home Feed.Source: §6.2.2 · p. 8, Table 5 · p. 8
6.2.4 Search.
- PinRec-OC improves Search metrics significantly versus control, including session-wide Search fulfillment; Related Pins also raises Search fulfillment by +0.42% and saves by +0.39%.The Search retrieval and ranking systems did not change; the reported gains are attributed to better Related Pins recommendations.Source: §6.2.4 · p. 8, Table 6 · p. 8, Table 7 · p. 9
6.3 Zero-shot Retrieval
- PinRec retrieves relevant ads and related searches for entities unseen in its training, despite not being trained to predict their engagement.The paper also reports lower cost per ad action and says production retrieval is cheaper because user-side inference is shared with organic candidate generation.Source: §6.3 · pp. 8–9, Table 8 · p. 9
7 Conclusion
The conclusion presents PinRec as a unified generative retrieval system for Pinterest’s Homefeed, Search, and Related Pins. It identifies outcome-conditioned generation and surface-specific fine-tuning as innovations associated with metric improvements, and outlines future research directions.
7 Conclusion
- PinRec’s outcome-conditioned generation and surface-specific fine-tuning enhanced several business metrics across its three recommendation surfaces.The paper describes this as a comprehensive study of deploying unified generative retrieval in a web-scale application.Source: §7 · p. 9
- Future directions include generative ranking, input-sequence optimization, and alignment techniques for using engagement signals.The conclusion cites Zhai et al. [34] for generative ranking and He et al. [9] for alignment techniques.Source: §7 · p. 9
A.1 Additional Analysis
The additional-analysis section describes supplementary experiments and online analyses.
A.1 Additional Analysis
- Additional analyses examine design choices, performance across state-of-the-art architectures, user cohorts, and tail items.The section says these experiments provide quantitative and qualitative evidence about PinRec’s design and performance.Source: §A.1 · p. 10
A.1.1 HSTU Architecture.
The paper tests whether outcome-conditioned PinRec transfers across architectures by reproducing the approach with HSTU. HSTU performs unevenly across surfaces, while the authors report that the ideas remain robust across architectures.
A.1.1 HSTU Architecture.
- Outcome conditioning is architecture-agnostic and can be applied across model architectures and algorithms.The authors reproduced gains over baselines using HSTU, rather than the multi-head-attention causal transformer.Source: §A.1.1 · pp. 10–11
- HSTU is roughly 3% worse on Home Feed than transformer-based PinRec, competitive on Related Pins, and substantially worse on Search.The Home Feed result effectively negates the improvement over unconditioned transformer-based PinRec; Search remains roughly the same order of magnitude as the transformer architecture.Source: §A.1.1 · p. 10, Table 9 · p. 11
A.1.2 Ablating Negative Sampling.
The ablations find that random negatives do not replace in-batch negatives, and increasing the number of in-batch negatives improves performance, especially on Home Feed.
Ablating Negative Sampling.
- The ablations vary random negatives while keeping in-batch negatives nonzero, and separately vary in-batch negatives with random negatives fixed.The study focuses on Home Feed and also reports results aggregated across surfaces.Source: §A.1.2 · p. 11
Random Negatives.
- Random negatives cannot substitute for in-batch negatives, which yield moderate unordered-recall gains when present.On Home Feed, adding in-batch negatives notably improves unordered recall over the baseline.Source: Table 10 · p. 11, §A.1.2 · p. 11
In-Batch Negatives.
- Increasing in-batch negatives and batch size improves performance, especially on Home Feed.With random negatives fixed, the authors report greater improvements from in-batch negatives than from random negatives, likely because they are more relevant.Source: §A.1.2 · p. 11
A.1.3 Ablating Parameter Scaling.
These supplementary analyses examine model scale, user and item cohorts, embedding diversity, and temporal offsets. They report trade-offs in serving cost, surface-specific diversity, and short- versus long-term recall.
A.1.3 Ablating Parameter Scaling.
- Scaling PinRec to around 1 billion parameters yields some gains, but is intractable for real-time serving; smaller tested sizes show no improvement.The authors therefore opt not to use larger transformers.Source: Table 12 · p. 11, §A.1.3 · p. 11
A.1.6 Embedding Diversity Analysis.
- Outcome conditioning produces 2–12x more unique embeddings than the unconditioned variant, while fine-tuning raises diversity for exploratory surfaces and lowers it for Search.The authors relate these diversity patterns to online corpus coverage.Source: Table 14 · p. 12, §A.1.6 · p. 12
A.1.4 Tail User and Item Analysis.
- For new users, outcome-conditioned PinRec is neutral or positive against control and unconditioned PinRec, and performs better on outbound clickthroughs.The reported comparison includes grid clicks and outbound clickthroughs.Source: §A.1.4 · pp. 11–12, Table 13 · p. 12
- Against a production two-tower model, PinRec-UC/OC surface 6.2%/17.3% more unique Pins and achieve 5.8%/7.7% absolute lifts for one-impression tail items.The first pair is corpus coverage; the second pair is the absolute lift for long-tail items with one impression.Source: Table 13 · p. 12, §A.1.4 · p. 12
A.1.5 Embedding similarity threshold tuning.
- Across tested embedding-similarity thresholds from 0.75 to 0.9, results are qualitatively consistent; 0.9 slightly outperforms other values for Search and Related Pins.The threshold has not been tuned for different user segments.Source: §A.1.5 · p. 12
A.1.7 Temporal offset value tuning.
- Using δ=10 yields 60% higher long-term recall with a 2% short-term recall decrease versus δ=0, so the authors select δ=10.Long-term recall is evaluated at Timestep Gap 30 and short-term recall at Timestep Gap 0.Source: §A.1.7 · p. 12