Menu
Pinterest Engineering·August 26, 2026

Scaling Pinterest's Home Feed Conditional Learned Retrieval System

This article details Pinterest's architectural evolution of its Conditional Learned Retrieval (CLR) system for the home feed, focusing on how they scaled its retrieval capabilities across diverse use cases and improved model foundations. It covers critical system design aspects such as efficient serving infrastructure, large-scale embedding management, and the unification of condition types to reduce engineering overhead.

Read original on Pinterest Engineering

Pinterest's home feed candidate generation is a large-scale User-to-Pin retrieval problem. The traditional two-tower model (user tower, item tower) struggles to capture diverse user intentions. Conditional Learned Retrieval (CLR) addresses this by conditioning the user tower on explicit retrieval contexts, generating condition-aware embeddings that reflect various user interests while grounding them in overall behavior. This enables more relevant and diverse recommendations.

Expanding CLR Across Use Cases

To increase candidate diversity and drive engagement, CLR was expanded to support new types of conditions. This involved training CLR models using (user, condition, engaged Pin) triplets. Initially, interest conditions from a predefined taxonomy were used. Later, Pin conditions (clustering recently engaged Pins and using medoids) and Board conditions (leveraging random walks on a Pin-Board bipartite graph) were introduced. Each expansion aimed to deprecate legacy heuristic-based candidate generators, simplifying the serving stack and yielding significant metric improvements.

Scaling CLR Model Foundations

User Sequence and Foundation Models

Early CLR models used static user features. To capture dynamic user behavior, Pinterest introduced a Conditioned User Sequence Transformer. This model converts raw condition features into tokens, appends them to the user sequence, and encodes the combined sequence using a Transformer, allowing the model to focus on sequence signals relevant to the retrieval context. Further evolution involved integrating a large-scale Foundation Model (PinFM) trained on global user action sequences into the CLR user tower. This foundation model uses a large ID embedding table, reused in the Pin tower for consistent Pin representations, and employs a next-token loss during fine-tuning to adapt to user sequences. An attention pooling mechanism provides a holistic view of the user sequence, and a contrastive alignment loss encourages condition tokens to align with the Pin embedding space.

Unified CLR and Router Simplification

To scale CLR efficiently, the team tackled the challenge of supporting heterogeneous conditions through a shared architecture. Unified CLR consolidated multiple condition-specific models (e.g., Interest CLR, Board CLR) into a single model. This single model accepts various condition types, with missing features imputed, reducing duplicated work and maintenance overhead. Further, the routing logic was refactored into a condition-agnostic Slot Architecture. Instead of custom pipelines for each condition, features are bucketed into shared slots: `condition_os` (Omnisage-compatible embeddings), `condition_id` (specific identifier embeddings), and `condition_type_id` (learned embedding encoding condition type). This eliminates feature explosion and simplifies future condition type integration.

💡

System Design Takeaways

When building recommendation systems, consider how to handle diverse user intentions beyond a single embedding. Conditional retrieval, unified models, and flexible feature slot architectures are powerful patterns for scaling complex recommendation logic and reducing technical debt as new features are added. The move from static features to sequence transformers and foundation models highlights the industry trend towards more dynamic and context-aware user representations.

Machine LearningRecommendation SystemsInformation RetrievalTwo-Tower ModelUser EmbeddingFoundation ModelsScalabilityServing Infrastructure

Comments

Loading comments...