
Deploying a hybrid 3-tower architecture at Pinterest scale by balancing speed and model precision
This article highlights Pinterest's transition beyond classic two-tower models by launching a 3-tower engagement co-train model for standard ads. It explains how they successfully engineered a high-performance recommendation system using custom-tailored cross-attention layers, system optimizations, and a smart two-stage scoring pipeline to meet strict latency requirements.
Highly recommended for machine learning engineers and recommendation system developers seeking practical methods to deploy highly expressive neural networks in heavy traffic and tight latency budget environments.
Pinterest's lightweight ranking stage must score hundreds of thousands of candidates (up to 200K at P99) per request, making it extremely difficult to deploy complex, expressive machine learning models under strict real-time serving latency and cost constraints.
They designed a 3-tower co-train model that extends the existing two-tower (Query, Pin) architecture with a third 'cross tower' for user-sequence and candidate interactions, and deployed it inside a two-stage scoring flow that scales by using fast 2-tower scoring for all candidates and rich 3-tower scoring for a top-K subset.
The model achieved a ~30% reduction in offline loss for three-tower predictions across engagement tasks, and extensive serving optimizations (e.g., BF16 precision, moving LayerNorm) reduced P99 latency from over 200ms to ~30ms (only 1-2ms slower than production). This translated into online lifts of ~1% in CTR, gCTR30, and oCTR, along with CPC reductions.
Trade-off
More complex attention models and MMoE layers had to be simplified to a candidate-derived query token attention and a shared-bottom MLP to stay within latency budgets, and the heuristic approach of blending 2-tower and 3-tower scores for the final selection could theoretically introduce bias toward items that already scored high in the first stage.
An architecture that extends the traditional query and item (Pin) two-tower design with a third 'cross tower' dedicated to processing user interaction history, trained via multi-task loss.
A structural module utilizing cross-attention over on-site user behavior sequences and candidate features to capture high-order interaction patterns.
A serving pipeline designed to score a large candidate pool quickly with a fast model first, followed by a deeper, more complex evaluation on a selected top-K subset.









