Book Deep Read · ML System Design Interview · Chapter 10

Personalized News Feed: the model only gets the probabilities right — the weights decide what the product becomes

Machine Learning System Design Interview · Ch 10 · Ali Aminian & Alex Xu · 2023

中文 →

What is this chapter about?

You open a social app in the morning, and the first few things on the screen are not in time order. The people you follow posted hundreds of things yesterday; the platform picks a few dozen for you, and the order is computed for you alone, right then. This chapter is about how that order gets computed.

A strange thing first

The lazy approach is to guess "will you tap on this?" and sort by that likelihood, high to low. Sounds fine.

Do exactly that, and a few months later your feed is wall-to-wall clickbait. The model asked "will you tap," and those headlines are precisely the ones with the highest tap rate and the deepest regret afterwards. You did tap. The model thinks it did a great job. The flaw is simple: a tap is not a liking.

Why the old way is hard

It is hard because there is no right answer. Which post belongs at the top? Nobody can write that down. The same post is a welcome life update to an old classmate and noise to a stranger.

The only clue available is what you did: tapped, liked, commented, reshared, paused for a few seconds, or hit "not interested." Every one of those is real, and every one of them tells only a sliver: a like is casual, a comment means something genuinely landed, a reshare means you are willing to put your own name on it, and "not interested" means the post should never have appeared.

The core idea: don't ask one question, ask a row of them

The chapter's move is to ask six or seven questions at once about the same post: Will they tap? Like? Comment? Reshare? How long will they linger? Will they get annoyed and swipe it away?

Each question gets its own little judge who returns a likelihood, and the likelihoods are each multiplied by a number and added up into that post's score. It works like gymnastics scoring: not one judge deciding, but several scoring separately and combining by weights fixed in advance. The "annoyed" judge carries a negative weight — it drags the score down.

The judges also share one understanding of "this person and this post," splitting apart only at the last step. That pays off concretely: resharing is rare enough that it cannot be learned on its own, but learning it alongside liking lets it ride along.

The real product decision is those few weights

How the model trains is a technical question. What a comment is worth versus a like is a judgment call about values. Raise the weight on comments and creators start chasing "start a discussion" the next day; raise the weight on dwell time and thin, time-consuming content floats up.

The cost is just as direct: this set of weights has no correct answer. It can only be found through rounds of live experiments, and every change reshapes what every creator does.

Remember this one line

Feed ranking is not one guess about "will you tap." It is several guesses at once — like, comment, reshare, dwell, annoyance — combined by weights fixed in advance. The model decides how accurate the guesses are; the weights decide what the product turns into.

Want the mechanisms, the notation and the diagrams? → Switch to the deep read