Problem
Pinterest ranks its home feed with a neural network that scores each candidate pin. The previous version, TransAct, put only the user's last 100 actions into a transformer. Seasonal or rare interests (gardening in spring, Halloween in autumn) fall out of that window. A longer history multiplies storage and data movement by the number of candidates per request, so most systems compress or drop old data.
Example from the article: a user who looks for gardening tips each spring and Halloween ideas each fall does not show either interest in their recent 100 actions.
Solution in brief
For each candidate pin, keep only the most recent actions plus the lifelong actions nearest to that pin in embedding space, so a 16,000-action history fits a short transformer input. An auxiliary Next Action Loss trains the user representation to predict the next engaged pin. A fused GPU kernel and request-level de-duplication keep serving fast.
Questions this case answers
- How to condition a per-candidate ranking model on a user history that is two orders of magnitude longer than the model can attend to
- How to add a sequence-forecasting auxiliary objective to a multi-head pointwise ranking model using shown-but-not-engaged items as negatives
- How to use a user's lifelong action history (thousands of events) in a feed ranking model without blowing the latency budget?
- How to pick the few relevant actions out of a very long history for each candidate item?
Tools and methods
- Lifelong action sequence — up to 16,000 past actions per user
- Nearest-neighbor selection — per candidate pin, take the most similar past actions by PinSage dot product
- Next Action Loss (NAL) — auxiliary contrastive loss on the next engaged pin
- Impression-based negatives — pins shown but not engaged serve as negatives for NAL
- int8 quantization — compact storage of action features and PinSage vectors
- Fused Triton kernel — one GPU kernel for the small transformer
Google or a one-time email code. No password.