Design Feed Ranking
Feed ranking is a service that orders posts from the accounts a person follows. The order favours posts worth the reader's time over a plain newest-first list.
The ask
The design ranks the feed of a social app. Readers open the feed many times a day.
The feed holds posts from followed accounts, plus posts the service chooses to suggest.
The first questions fix the mix. Suggested posts need a stated share beside followed accounts.
The goal is a feed worth returning to. Raw time on the app is not proof of value.
Estimate the scale
The service has 100,000,000 daily users.
Each user posts 2 times a day. 100,000,000 users × 2 posts = 200,000,000 posts a day.
200,000,000 posts ÷ 86,400 seconds = 2,315 posts per second.
Each user checks the feed 10 times a day. 100,000,000 users × 10 checks = 1,000,000,000 feed reads a day.
1,000,000,000 reads ÷ 86,400 seconds = 11,574 reads per second.
Each read ranks 500 candidates. 11,574 reads × 500 candidates = 5,787,000 ranking scores per second.
Data and features
The average account follows 200 accounts.
200 followed accounts × 2 posts a day = 400 new posts a day for one reader.
Features describe the reader, the author and the pair. Closeness between reader and author is the strongest pair fact.
Post features cover age, type and early response. A post's first burst of response hints at its wider pull.
Labels come from what the reader did. Reads, reactions, comments, shares and hides all leave a record.
High-level design
Posts land in a store keyed by author. The graph store answers who follows whom.
Candidate posts gather from followed accounts first. Suggested posts from wider sources join as a smaller share.
Fan-out on write pre-builds feed lists for ordinary accounts. Posts from celebrity accounts join at read time instead.
Ranking scores the candidates with closeness, freshness and predicted response.
Checked content is the only content in the pool. The checking filter runs before candidates gather, not after ranking.
Training the model
Training examples come from served feeds and the responses they drew.
Each example keeps the features as they stood when the feed was served.
Clicked posts are not the only positives. Comments, shares and long reads teach different kinds of value.
Hides are strong negatives. Fast scrolls past are weak ones, since the reader may never have seen the post.
The model retrains on a regular schedule. Freshness features update between runs, since post value fades within hours.
Serving predictions
Serving ranks the candidates for each read, inside a tight budget.
Prebuilt feed lists give ranking its starting pool. Ranking still runs per read, since freshness changes by the minute.
Each stage gets a deadline. A missing source shrinks the pool instead of delaying the feed.
Readers see a stable order during one session. New posts join at the next refresh.
A newest-first list is the fallback. It is plain, but it is fresh and never empty.
Deep dive: position bias
Position bias is the tendency for higher places in a list to earn more response because of place, not only quality.
The top post is seen by nearly every reader. A post at the bottom may never enter the screen.
Raw logs therefore praise the top unfairly. A model trained on them learns to repeat its own past order.
Showing order is logged with every response. Training can then compare posts that held the same place.
A small share of reads swaps some places on purpose. The swapped reads give fair evidence about lower posts.
Offline grades use the swapped evidence as a check. A model that only wins at the top is not winning.
Deep dive: fresh posts and close accounts
A close account's older post can beat a stranger's fresh one. Pure newest-first order buries that value.
Pure closeness order goes stale instead. The same voices would hold the feed for days.
Freshness enters the score as a weight that falls with age. The fall is a design choice, tuned by experiment.
Suggested posts face a higher bar than followed posts. The reader never chose their authors.
Variety rules cap repeats from one author in a row. One loud voice cannot fill the screen.
Evaluation and trade-offs
Offline tests replay served feeds and grade new orders against recorded responses. Position bias makes those grades kind to old top posts.
An online experiment gives the new model 1% of daily reads. 1,000,000,000 reads × 1% = 10,000,000 reads in the test arm.
Measures cover reactions, comments, shares, hides and return visits. Time in the app alone does not settle the result.
A post that should have been held back, seen across many feeds, is a stop signal. Checked content failures outrank every ranking gain.
The trade-off never closes. Fresher, closer and more varied feeds pull against each other, and experiments set the balance.
Signals the ranker reads
| Signal | What it shows |
|---|---|
| Closeness | How near the author stands to the reader |
| Freshness | How new the post is |
| Early response | Reactions in the first minutes |
| Post type | Text, photo or video |
| Reader history | Types the reader answers to |
Exercise
What is position bias?