There’s a ton of folk wisdom on X about how to go viral. A few examples you’ll see over and over:
- Put links in the first reply instead of the post. " (Sprout Social).
- Replies are king. “A reply on your tweet is worth 13.5x a like,” and if you reply back, “a two-way conversation [is] worth 150x more than a single like” (OpenTweet).
- Pay for Premium. Premium gets “roughly 4x for in-network reach to your own followers and about 2x for out-of-network reach to non-followers” (SocialRails).
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.
- 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.
- 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.
- 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:
- The ranker never reads your words. Its inputs are post IDs, author IDs, and actions. Your text only gets in through a semantic ID (basically think of it like a small embedding): six numbers from 0 to 255. The first number picks one of 256 broad neighborhoods, and each number after that narrows it down further. Posts on the same topic end up sharing the first few numbers.
- An LLM also writes a report on every post. A Gemma-based initial filter (called, hilariously, the “banger initial screen”) reads each post and outputs a description, tags, topic categories, yes/no flags like high quality, spam, and NSFW, and a “slop score.”
- The weights are in
param.rs. A Copy-link share is incredibly valuable and worth a multiplier of 20, a reply is worth 5 (not 13.5 as past articles noted), quote 5, DM share 5, repost 1, and like 0.5. Getting reported is −234 and muting is −58.8 (so incredibly bad). Though note that these are based on probabilities of actions, not actual actions themselves. - A lot of the folk wisdom isn’t in the code. There’s no weight for the author replying back, and I couldn’t find a Premium multiplier anywhere in the scoring code.
- Mutual follows got a big boost this summer. Replies on original posts from mutual follows now count for 20 instead of 5 (X even published the whole A/B test history, which is pretty cool to see).
What this means for your posts
So what should you actually do?
- 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.
- 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.
- 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.
- 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.
- Post less, but better. Your second post in someone’s feed counts at about 0.6x, and your third about 0.4x.
- 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).
- 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.