When you open Pinterest, Instagram, or TikTok, the home feed is what greets you. It is an endless stream of content chosen just for you, and it is the product's front door. The platform's ability to keep that feed fresh, diverse, and personally relevant is the single largest lever for long-term engagement and retention.
We are designing the ML system behind that home feed. The business objective is to maximize a composite engagement signal that combines clicks, saves, dwell time, and return visits. Pure click-through rate is the wrong north star because it rewards clickbait and shallow interaction. What the platform actually wants is a proxy for genuine user satisfaction, and that requires balancing engagement with content diversity, freshness, and creator health.
What we are designing
The ML task is a ranking problem. Given a user, their recent session signals, and a large candidate pool, score each content item to produce a ranked, diverse, fresh page of results under a 100 ms p99 latency constraint. The consumer of this ranking is the home feed rendering service, which requests a page of ranked items on each scroll and uses cursor-based continuation to extend the feed.
The high-level shape is a multi-stage pipeline. A retrieval stage fans out to multiple candidate sources, including embedding-based approximate nearest-neighbor (ANN) search, collaborative filtering, and trending pools, to produce a few thousand candidates. A ranking stage scores those candidates with a deep model. A re-ranking and blending stage enforces diversity, freshness, and exploration before returning the final page. Behind the online path, an offline and nearline loop logs impressions and engagement events, retrains models, refreshes embeddings, and rebuilds the ANN index that retrieval depends on.