Advanced Embedding-Based Retrieval for Personalized Content Discovery

pinterest · Tech · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.2 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Personalized content retrieval

Pinterest needed stronger Homefeed retrieval to deliver personalized, engaging, and diverse candidate content.

Constraints:

Architecture

Pinterest's learned-retrieval system is a production candidate generator for Homefeed. A two-tower model computes user and Pin embeddings, with the Pin tower run offline and the user tower fetched once per request; MaskNet/DHEN-style feature crossing improves the user tower; fixed ID embeddings and dropout stabilize scaling; serving-corpus changes remove stale or remapped content; multi-embedding clustering represents diverse user interests; ANN search retrieves candidates that are combined round-robin and handed to ranking and blending. Conditional retrieval adds an interest input for product surfaces that need more control.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  homefeed-request[Homefeed request] --> user-tower[User tower]
  feature-crossing-modules[Feature crossing modules] --> user-tower
  feature-crossing-modules --> pin-tower[Pin tower]
  id-embedding-table[ID embedding table] --> user-tower
  pin-tower --> serving-corpus[Serving corpus]
  user-tower --> multi-embedding-interest-clusters[Multi-embedding interest clusters]
  conditional-retrieval-input[Conditional retrieval input] --> user-tower
  serving-corpus --> ann-search[ANN search]
  multi-embedding-interest-clusters --> ann-search
  ann-search --> round-robin-combiner[Round-robin combiner]
  round-robin-combiner --> ranking-and-blending-layers[Ranking and blending layers]
  ranking-and-blending-layers --> homefeed-request
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Homefeed request Online request that needs personalized candidate Pins. User tower, Ranking and blending layers
User tower Online tower that builds user embeddings from history and feature-crossing modules. Homefeed request, Multi-embedding interest clusters, Conditional retrieval input
Pin tower Offline tower that generates Pin embeddings for the serving corpus. Serving corpus, ANN search
Feature crossing modules MaskNet and DHEN upgrades that improve representational power inside the towers. User tower, Pin tower
ID embedding table Sparse ID representation stabilized with fixed embeddings and aggressive dropout. User tower
Serving corpus Curated candidate pool whose freshness and remapping set the upper bound for retrieval quality. Pin tower, ANN search
Multi-embedding interest clusters Clustered user-history representation that captures diverse user interests. User tower, ANN search
ANN search Retrieves candidates for user embeddings from the Pin embedding index. Pin tower, Multi-embedding interest clusters, Round-robin combiner
Round-robin combiner Combines results from multiple embeddings before downstream ranking. ANN search, Ranking and blending layers
Ranking and blending layers Downstream systems that rank and blend retrieved candidates into Homefeed. Homefeed request, Round-robin combiner
Conditional retrieval input Interest-conditioned input used to steer retrieval for particular product surfaces. User tower

Data flow

Offline Pin-tower computation creates Pin embeddings and a curated serving corpus. At request time the user tower builds one or more user-interest embeddings from history, ANN search retrieves Pins for each embedding, results are combined round-robin, and ranking/blending layers produce Homefeed candidates. Conditional retrieval can add an interest token or filter to focus retrieval on a chosen interest.

3 supporting quotes
“Because the Pin tower is used offline and the user tower is only fetched once during a homefeed request, we can scale up to a complicated model structure within each tower.”article, stated
“At serving time, we only keep the first K embeddings and run ANN search, and K is determined by the length of user history.”article, stated
“Then the results are combined in a round robin fashion and passed to the ranking and blending layers.”article, stated

Why this architecture

Pinterest chose learned retrieval because Homefeed needs candidate generation that is personalized, engaging, and diverse at large scale. The two-tower split allows heavier offline Pin computation and one online user-tower fetch; corpus renovation and multi-embedding retrieval address freshness, upper-bound quality, and diversity without relying only on one user vector.

“embedding-based retrieval (a.k.a Learned Retrieval) is a key candidate generator to retrieve highly personalized, engaging, and diverse content”article, stated
“## Serving Corpus Upgrade Apart from model upgrades, we also renovate our serving corpus as it defines the upper-limit of retrieval performance.”article, stated

Models used: two-tower model · MaskNet · DHEN

Scale

Alternatives considered (roads not taken)

Train a larger sparse ID embedding table directly

Rejected because: The larger table overfit badly, so Pinterest fixed the table and used aggressive dropout first.

“We found that the model suffered from overfitting severely. To mitigate this, we first fixed the embedding table and applied an aggressive dropout with dropout probability of 0.5 on top of the ID embeddings, which led to decent online gains (0.6–1.2% HF repins”article, stated

Use one embedding for all user interests

Rejected because: Pinterest introduced multiple embeddings and clustering to represent diverse interests and combine retrieval results.

“At serving time, we only keep the first K embeddings and run ANN search, and K is determined by the length of user history.”article, implied

Improve retrieval only through modeling

Rejected because: The serving corpus itself set the ceiling, and corpus renovation improved metrics without model changes.

“Apart from model upgrades, we also renovate our serving corpus as it defines the upper-limit of retrieval performance.”article, stated

Patterns

rag-retrieval (retrieval)

The system is a learned retrieval candidate generator for personalized feed content.

“At Pinterest Homefeed, embedding-based retrieval (a.k.a Learned Retrieval) is a key candidate generator to retrieve highly personalized, engaging, and diverse content to fulfill various user intents and enable multiple actionability, such as Pin saving and shopping. We ha”article, stated

retrieval-ranking (retrieval)

Pinterest improved retrieval by changing model architecture and serving-corpus construction.

“Apart from model upgrades, we also renovate our serving corpus as it defines the upper-limit of retrieval performance.”article, stated

Tradeoffs

How much model complexity to put in each tower.

Chose complicated user and Pin towers over simpler towers with less feature crossing.

Rationale: The offline Pin tower and once-per-request user tower made heavier structures operationally feasible.

“we can scale up to a complicated model structure within each tower.”article, stated

How to improve candidate diversity.

Chose multiple clustered user embeddings with round-robin combination over a single user embedding feeding ANN search.

Rationale: Multiple embeddings let retrieval cover several user interests and then combine their candidates downstream.

“Then the results are combined in a round robin fashion and passed to the ranking and blending layers.”article, stated

Gotchas (what bit them)

ID embedding transfer risked overfitting.

Root cause: Direct fine-tuning did not perform well online.

Resolution: Pinterest mitigated overfitting with pretraining and contrastive-learning design.

“We found that the model suffered from overfitting severely.”article, stated

Evaluation

Pinterest evaluated online engagement changes from retrieval architecture and corpus updates.

Metrics: engaged sessions · repins · clicks

“35% improvement in engaged sessions from MaskNet, additional 0.”summary, stated

Outcomes

Reported gains include engaged sessions, repins, and clicks.

“asurable gains including 0.15-0.35% improvement in engaged sessions from MaskNet, additional 0.1-0.2% from DHEN scaling, 0.6-1.2% increases in repins and clicks from ID embeddings, and significant engagement improvements from multi-embedding and conditional retrieval approaches.”summary, stated