Loading…
Enhancing Ad Relevance: Integrating Real-Time Context into Sequential Recommender Models
PinterestPinterest Engineering
Summary
Pinterest's sequential ads candidate generator inferred user embeddings offline from historical offsite conversions, which lacked real-time browsing context. Consequently, less than 1% of impressions on the Related Pins surface were attributed to this generator because its retrieved candidates struggled in downstream ranking. To resolve this limitation, engineers developed the Contextual Sequential Two Tower Model, integrating a context layer directly into the query tower alongside user demographic features. Offline training utilized synthetic context derived from positive conversion labels paired with high dropout rates to preserve sequence reliance, while serving split into offline Transformer inference and online context computation. Offline evaluations showed a 3x to 10x increase in Recall@K, and production deployment lifted median candidate relevance by 275% to 300% and overall ROAS by approximately 0.7%.
Context
Pinterest's sequential ads candidate generator relied on offline user embeddings inferred from historical offsite conversions. This design lacked real-time online browsing context, causing candidates to struggle in downstream ranking on contextual surfaces like Related Pins, where the model generated less than 1% of impressions.
Approach / What changed
Pinterest created the Contextual Sequential Two Tower Model, which concatenates the offline Transformer sequence encoder output with a real-time context layer and user demographics before passing them to an MLP. Offline training synthesizes pseudo-context from positive conversion labels with high dropout on the context layer. Serving runs hybrid inference, calculating Transformer states offline and computing the context layer with the MLP online.
Takeaways
- Offline evaluation of the contextual model demonstrated a 3x to 10x increase in Recall@K over the production baseline on Related Pins.
- Median relevance of retrieved candidates increased by roughly 275% to 300%, doubling the volume of retrieved candidates delivered to impression.
- Overall ads relevance metric rose by 1.08%, driving a ~0.7% lift in Return on Ad Spend (ROAS) overall and ~1.4% in top revenue countries.
Related reading
From Clicks to Conversions: Architecting Shopping Conversion Candidate Generation at Pinterest
Pinterest built a dedicated shopping candidate generation model to optimize for lower-funnel purchase conversions rather than relying strictly on engagement retrieval models. Because offsite conversion events are sparse and delayed, engineers trained a single multi-surface two-tower model using conversion data supplemented by duration-weighted click engagement and unengaged ad impressions as hard negatives. The two-tower retrieval architecture incorporates a parallel DCN v2 and MLP layer structure that allows simultaneous learning from the same inputs without information bottlenecks. Later revisions transitioned the system from a multi-head loss structure to a unified single-head multi-task architecture paired with an advertiser-level objective. Deployed across more than 600 million monthly active users, the system increased shopping conversion volume by 2.3% and boosted return on ad spend by 3.1% for United States shopping campaigns.
Pinterest EngineeringMeta ·