Problem
An ad system must narrow a huge pool of ads to a shortlist before heavy ranking and the auction. Demographic or static-interest targeting misses fast-changing shopping intent. Pinterest holds a rich history of users' conversions on advertisers' sites (checkout, add-to-cart, signup), and the team set out to use it for candidate generation. Advertiser-level personalization also stops scaling as the catalog grows, because downstream models must score every item of every selected advertiser.
Illustrative example: a user added several products from one store to the cart last week. They should see ads for products they are likely to convert on next, not for the biggest advertisers.
Solution in brief
Train a two-tower retrieval model. The user tower is a bidirectional transformer over the offsite event sequence. The other tower encodes the advertiser, and later the individual shopping Pin. Positives are future conversions, negatives come from the batch and a random sample, and tuned log-Q terms correct popularity. User embeddings are computed daily, items are served from an ANN index.
Questions this case answers
- How to retrieve personalized candidates from a very large catalog using a sparse, noisy history of conversions that happened outside the platform
- How to keep a retrieval model trained with sampled softmax from collapsing onto popular entities while still keeping recall high
- How to generate ad candidates from a user's sequence of offsite conversion events?
- How to move ad candidate generation from the advertiser level to the item level when the catalog has over a billion items?
Tools and methods
- Two-tower model — a transformer user tower and an advertiser or item tower for retrieval.
- Sampled softmax with log-Q correction — loss that does not over-penalize popular candidates.
- In-batch and random negatives — contrastive training signal.
- ANN graph — online top-K item retrieval.
- Recall@K, diversity metric — offline model selection.
Google or a one-time email code. No password.