How X’s ranking algorithm works

September 25, 2026

There’s a ton of folk wisdom on X about how to go viral. A few examples you’ll see over and over:

But it’s very hard to tell what’s real, and most of it traces back to code Twitter released in 2023. But X now publishes the production code for its “For You” feed at xai-org/x-algorithm (including the ranking weights!) and they update it about every four weeks.

How the ranker works

The basic trick of the ranking algorithm is to use something cheap to narrow the available options, then save the expensive model for a few thousand posts.

How X's ranker works. Index: Grok and Gemma LLMs read the post and preprocess it, and it becomes a six-number semantic ID. Retrieve: filter down from about 10 million posts to about 2,800, the nearest to your history and interests plus posts from people you follow. Rank: the Phoenix transformer scores each post by its predicted actions, as the sum of weight times the probability of about 25 actions.
Source: xai-org/x-algorithm, September 2026 release.
  1. Retrieval narrows ~10 million posts to ~2,800. Most come from people you follow or from an embedding search for posts close to your recent history.
  2. A transformer predicts what you’ll do. Phoenix (whose code started as a port of Grok-1) reads your last ~1,000 actions and predicts the odds you’ll like, reply, share, mute, or report each post.
  3. A weighted sum becomes the score. Posts from people you don’t follow get multiplied by 0.75, and each extra post from the same author counts for less.

A few implementation details I found fascinating:

What each action is worth on X, as a multiplier on the predicted probability of each action: copy-link share 20, reply 5, quote 5, DM share 5, follow the author 4, repost 1, like 0.5, report minus 234, mute minus 58.8, not interested minus 43.2, block minus 31.2.

What this means for your posts

So what should you actually do?

  1. Write things people send around. A copy-link share carries 40 times the weight of a like, which makes it incredibly valuable. People generally tend to forward useful things like a surprising number, a clear chart, or an explanation that breaks something down simply.
  2. Start conversations. Replies and quotes each carry 10 times the weight of a like. Build mutual follows with people in your field, since their replies count four times as much.
  3. Stay on topic. To reach people who don’t follow you, your post has to land near their interests in embedding space. A post clearly about one thing gets a clear semantic ID.
  4. Don’t rage bait. Mutes and reports are by far the heaviest negative weights, so it’s not really in your interest to post baity content.
  5. Post less, but better. Your second post in someone’s feed counts at about 0.6x, and your third about 0.4x.
  6. Everything expires in 48 hours. The ranker stops considering older posts, so there’s definitely a timing element of a post and might make weekend vs weekday timing important (though how time plays a factor depends on viewing and posting distributions, which aren’t available in the code itself).
  7. Links are fine now. X says the link penalty ended in mid-2025, and the code agrees. Just make sure the post stands on its own.

There are still some things we don’t know, though. The trained model isn’t public and every score is personalized to the viewer, so you can’t compute ahead of time how a post will do, but it is pretty intersting to get this level of transparency on the algorithm.


Or follow via RSS.