Design Feed Ranking
You'll learn to
- -Explain how feed ranking differs from a general recommender
- -Combine several predicted reactions into one score with a value model
- -Show how changing the weights changes the feed without changing the model
- -Name the integrity and diversity steps a feed needs
A social feed looks like a recommender, and in many ways it is. But it has a twist: the items come from people and pages you chose to follow, they go stale in hours, and some of the most engaging posts are the ones that hurt people. Designing a feed means designing what the system is allowed to optimize.
An Analogy: The Newspaper Editor
An editor deciding the front page weighs what readers will want to read against what matters and against the paper's standards. A story that would sell the most copies might still stay off the front page. A feed ranker plays that role for millions of readers at once, and the weights it uses are an editorial policy written as numbers.
What Is Different From a General Recommender
- -Candidates are your network: posts from friends, pages, and groups since your last visit, plus a few suggested ones. The candidate set is small compared to a video catalog, but it changes every minute.
- -Freshness is central. A great post from yesterday may be worth less than an average one from ten minutes ago.
- -Reactions are social: likes, comments, shares, replies. Negative signals matter too: hides, mutes, unfollows, reports.
- -Integrity is part of the job: misinformation, bullying, and borderline content must be handled in ranking.
On the infrastructure side, where each user's candidate posts are stored and how they are assembled is the news feed design from the HLD course: fan-out on write versus on read. The ML system sits on top of it and decides which candidates go where.
Predict Several Things, Then Combine
Instead of one "engagement" prediction, a feed model has several heads, each predicting the chance of one reaction: like, comment, share, hide, report, and sometimes how long the user will look. A separate value model combines them into one score: a weighted sum, where positive reactions add and negative reactions subtract, often multiplied by a freshness factor. The model predicts. The weights decide what the feed is for.
The block below ranks four posts under two sets of weights, using the same predicted probabilities for both. The first set rewards any engagement. The second pays more for comments, penalizes hides and reports heavily, and lets a harmless post outrank an upsetting one. The probabilities and weights are invented. Press Run and compare the two orderings.
With engagement-first weights, the viral meme wins with 0.428, and the debate thread is third. Under the second set, the friend's vacation photo leads with 0.513, the viral meme falls below zero because its hides and reports now cost more than its likes earn, and the debate thread plunges to −3.411 since four in a hundred viewers would hide it. No model changed. The weights did all the work, which is why the weights are a product and policy decision that deserves review and testing, not a constant an engineer picks alone.
Integrity, Diversity, and Pacing
- -Integrity: classifiers for misinformation, borderline content, and bait run alongside the ranker. Their outputs demote a post's score, or remove it.
- -Diversity: avoid five posts in a row from one source or on one topic. A re-ranking pass spaces them out.
- -Pacing and session health: limit how much of a single type is shown, and avoid drowning a friend's rare post in a stream of pages.
Evaluation
- -Offline: calibration of each head, since the value model multiplies probabilities by weights, and ranking metrics against logged reactions, split by time.
- -Online: A/B test on meaningful interactions, session length, and returning users, with guardrails on hides, reports, and complaints. Run it long enough to see novelty fade.
- -Surveys: ask a sample of users whether they enjoyed the feed. Behavior is not the same as satisfaction.
Interview Signal is part of Pro
See a real weak answer next to a real strong one for this exact topic.
Quiz is part of Pro
Test what you just read with a short quiz, and bank the XP.
Discussion0
Join the Discussion
Sign in to leave comments, reply to others, or like insights.
No comments yet. Be the first to start the thread!