OpenAI
Medium
How would you design X's Feed Algorithm?
Treat this as a ranking design question, not an engagement maximisation one. A feed that ranks only on predicted likes and replies rewards rage-bait, so the design starts with what a good session on X means.
Step 1. Clarifying Questions
- Which feed? Following (accounts you follow) or For You (ranked, including accounts you don't follow)? Assume For You.
- What is the goal? Time spent, retention, or quality conversation? Assume users returning because the feed was worth it.
- Which post types? Assume text, images and video.
Why it matters: For You is where new accounts get discovered and where much of the reading happens. If it rewards outrage, advertisers pull back and good creators stop posting.
Step 2. Stakeholders
- Readers: news, ideas and people worth following, in minutes.
- Creators: reach beyond followers when the post is good.
- Advertisers: a brand-safe place to appear.
- X: a daily habit and ad revenue.
Step 3. The pipeline
1. Candidate sourcing, a few thousand posts:
- In-network: recent posts from accounts you follow and interact with.
- Out-of-network: posts liked by people similar to you, topic matches, what is trending in your region (cricket during an India match).
2. Light ranker: cut to a few hundred, cheaply.
3. Heavy ranker: predict the probability of each action, then combine with weights.
- Positive: like, repost, reply, bookmark, dwell time, profile click, follow.
- Negative: "not interested", mute, block, report, instant scroll past.
4. Re-rank with rules:
- Author diversity: at most 2 posts per author in the top 20
- A balance of in-network and out-of-network
- Freshness boost for breaking news
- Safety filters, and reduced reach for borderline content
- Ads at fixed positions
Step 4. Set the weights carefully
- A reply that the author replies to is worth more than a like. It signals a real conversation.
- Negative signals weigh heavily. One block should cancel many likes.
- Don't treat replies alone as good. Angry quote posts and pile-ons look like engagement.
Step 5. Metrics
- North Star: daily users with a satisfying session (positive actions, no negative feedback)
- Ranking quality: engagement rate on the top 10 posts, follows that come from For You
- Guardrails: block, mute and report rate per 1,000 impressions, share of impressions going to the top 1% of accounts, brand-safety incidents
- Long term: D30 retention, not session time
Interview tip: name the rage-bait trap and fix it with negative signals in the score. That one move separates a PM from someone describing a model.
Community Answers (0)
No answers yet. Be the first to share your approach!