Staff+

Feed Ranking System

rankingadsinfrastructure

Feed ranking determines what billions of people see every time they open the app, making it one of the highest-leverage systems in any social platform's infrastructure. I'll work through business and ML objectives, system architecture, data and features, modeling, infrastructure, evaluation, and robustness.

Solution Walkthrough

Business Objective

The objective is to maximize quality-adjusted time spent on platform, balancing user satisfaction, creator sustainability, and long-term platform health. This is more nuanced than just maximizing raw engagement. We could show clickbait that gets initial clicks but leaves users disappointed, or we could over-optimize for a single content type and create filter bubbles. Neither serves the long-term health of the platform.

Quality-adjusted means we're weighting engagement by satisfaction signals. A user who spends 10 minutes watching videos they love and comes back tomorrow is more valuable than a user who doomscrolls for 30 minutes, feels terrible, and doesn't return. We capture this through proxy metrics like reshare rates, positive reactions, return visit probability, and survey feedback.

The three-legged stool (users, creators, and platform) is critical. Users need content they enjoy. Creators need distribution so they're incentivized to make great content. The platform needs sustainable monetization through ads and long-term user retention. Over-optimizing any single leg collapses the others. If we only show content from mega-creators, new creators can't grow and eventually content diversity dies. If we show too many ads, users leave. The business objective needs to balance these.

ML Objective

From an ML perspective, this is a ranking problem at massive scale. Given a user, their current session context, and potentially billions of candidate posts, we need to rank them by their likelihood of contributing to quality-adjusted engagement. The ranking is personalized (what's great for you might be irrelevant to me) and it's contextual, adapting to what you're interested in right now based on recent behavior.

We're predicting multiple engagement types: probability of click, expected watch time, probability of like, probability of share, probability of negative feedback. Each prediction feeds into a value model that translates these engagements into a single score we can rank by. This value model is where we encode business priorities and is tunable without retraining the underlying predictor.

Unlock Full Solution

Get access to the complete walkthrough, key concepts, summary, and follow-up questions.