David T Phung
The For You timeline, ranked

The X algorithm, made transparent.

A faithful, interactive recreation of how X ranks the For You timeline, grounded in X's own open-source code. Real candidate sources, the real heavy-ranker feature set, the published weights. Then the part that matters for this case study: Grok explains why each post is where it is.

Grounded in github.com/twitter/the-algorithm (home-mixer, the heavy ranker, SimClusters)

The pipeline

Every refresh, the For You timeline runs roughly 1,500 candidates through five stages to pick the ~50 you see. These are the real stages, with the real service names from the repo.

01 · CANDIDATES

Sourcing

~50% in-network, ~50% out-of-network. From earlybird, UTEG, FRS, TweetMixer, SimClusters.

02 · LIGHT RANK

Light ranker

A fast logistic model trims the candidate pool to the most promising before the expensive step.

03 · HEAVY RANK

Heavy ranker (navi)

A neural net predicts ~17 engagement probabilities per post, combined by the weights below.

04 · FILTERS

Heuristics + visibility

Author diversity, content balance, feedback fatigue, and the visibility/trust-and-safety library.

05 · MIX

Mixing

Ads, follow recommendations, and onboarding prompts are woven in. Then it serves.

Where candidates come from

About half from people you follow, half from outside your network, surfaced only with social proof. The real candidate pipelines in home-mixer:

IN-NETWORK

Earlybird + RealGraph

Recent posts from accounts you follow, ranked by RealGraph (a model of your relationship strength with each account).

OUT-OF-NETWORK

UTEG

Uteg / DirectUteg: the User-Tweet-Entity-Graph. Posts that the people you follow recently engaged with. The "someone you follow liked this" path.

OUT-OF-NETWORK

SimClusters

Community embeddings. You and posts both get placed into ~145k communities; you see popular posts from your communities.

OUT-OF-NETWORK

TweetMixer + FRS

Embedding similarity (TwHIN) and follow-recommendation candidates. Plus ContentExploration for fresh-interest discovery.

The heavy ranker weights

The neural net predicts the probability of each action, then multiplies by these weights and sums. These are the exact features the open-source heavy ranker scores (from PredictedScoreFeature.scala); the weight values are the ones X published with the release. Notice replies dominate likes by ~27x, and a reply the author engages back is the single biggest positive at 75x. Negative feedback is brutal.

See it rank, live

These posts carry real engagement counts. The engine derives a probability for each action from the counts and recency, multiplies by the weights above, sums, applies time decay, and sorts. Tap Why this rank? on any post for the full breakdown, then hit Show less to watch the -74 negative-feedback weight crush a post.

For You · ranked by the real weights

Why this belongs in the case study

The thesis is that Grok should be a layer that makes the timeline legible. The ranking is the most powerful, least understood thing about X. A Grok layer that can answer "why am I seeing this?" in plain language, grounded in the real signals, is the highest-trust feature the layer could ship.