
An inside look at cutting P90 latency by 85% while unlocking massive personalized recommendation scale
This article details Pinterest's evolutionary journey in scaling Conditional Learned Retrieval (CLR) to solve the multi-intent retrieval challenge in home feeds. It explains how they unified multiple heuristic generators into a single, cohesive framework, integrated deep sequence modeling through foundation models, and pioneered lossless training and GPU-serving optimizations for production scale.
Highly recommended for ML and recommendation system engineers struggling with serving costs, system complexity, and multi-interest representation in high-traffic production environments.
Pinterest's home feed candidate generation is a large-scale User-to-Pin retrieval problem, but traditional two-tower models produce a single user embedding that struggles to capture diverse, simultaneous user interests like home renovation and recipes.
The team scaled Conditional Learned Retrieval (CLR) by conditioning the user tower on explicit contexts (interests, Pins, Boards) within a unified model, integrating a Conditioned User Sequence Transformer and PinFM foundation model, and optimizing training and serving with M-Falcon attention masking and GPU-based NVEmbed serving.
The optimized framework achieved 7-figure financial cost savings, slashed P90 model latency by 85% (from 80ms to 12ms), delivered massive engagement metric wins, and successfully deprecated legacy heuristic candidate generators.
Trade-off
Integrating large foundation models significantly increased computational complexity, requiring the engineering team to design and maintain custom infrastructure optimizations, such as M-Falcon block attention masks and request-level deduplication pipelines to control high GPU overhead.
An advanced retrieval paradigm that extends the traditional two-tower model by conditioning the user tower on specific explicit contexts, outputting multiple dynamic, context-aware embeddings instead of a single static one.
A lossless training optimization technique that exploits causal attention to append all target conditions for a given user to a single user sequence, preventing redundant sequence computations in a batch.
Hierarchical codes generated by quantizing static content embeddings using residual-quantized VAEs, allowing visually and semantically similar items to share adjacent regions in the ID embedding space.









