How the X Algorithm Works, According to Its Own Source Code
X publishes the code that ranks the For You feed, including the actual weights. Here is what the numbers say, and what a business owner should do with them.
Last reviewed
X is the only major platform where you do not have to infer the algorithm. You can read it. The For You ranking code lives in a public repository, updated through August 2026, and it includes the actual weights used in production. X says so directly: "we run cron scripts that set the defaults in this repository's code to be the primary production values."
So this article is mostly quoting numbers, not interpreting vibes.
The shape of the system
The repository describes a feed built from two candidate streams: in-network posts from accounts you follow, and out-of-network posts found by machine learning retrieval and clustering. "Both are ranked together by the same model."
The scoring formula is one line:
Final Score = Σ (weighti × P(actioni))
A transformer model predicts the probability that this specific viewer will take each of a list of actions on your post. Each probability is multiplied by a weight and summed.
The 2023 predecessor to this system was described in Twitter's engineering blog, which is still useful for scale: the pipeline distills "roughly 500 million Tweets posted daily" down to about 1,500 candidates per request, drawn "50% In-Network Tweets and 50% Out-of-Network Tweets on average," ranked by "a ~48M parameter neural network." The architecture has been rebuilt since, but the funnel logic is the same.
The weights, as of August 2026
These are read straight from the parameter file. Positive actions:
| Predicted action | Weight | | --- | --- | | Share via copy link | 20.0 | | Reply from a mutual follow (boost) | 15.0 | | Reply | 5.0 | | Quote post | 5.0 | | Share via DM | 5.0 | | Follow author | 4.0 | | Share | 2.0 | | Repost | 1.0 | | Like | 0.5 | | Click on post | 0.4 | | Open link | 0.2 | | Photo expand / video open / video quality view | 0.05 | | Dwell | 0.0 | | Profile click | 0.0 |
Negative actions:
| Predicted action | Weight | | --- | --- | | Report | -234.0 | | Mute author | -58.8 | | Not interested | -43.2 | | Block author | -31.2 | | Not dwelled | -0.02 |
Before you over-read these, here is X's own warning, verbatim: "The weights scale the predicted probabilities of such actions (or predicted continuous values, e.g. dwell time) ... they do not scale the raw engagement counts, so e.g. it'd be incorrect to see that a report has 468 times higher weight than a like and conclude that e.g. '1 report cancels out 468 likes'."
Read correctly, the ranking is still telling you something plain. A like is the cheapest signal in the system. Someone copying your link to send it somewhere else is worth forty times a like in the sum. Replies and quotes sit in the middle, and a reply from someone you mutually follow carries a large extra boost.
Three adjustments after scoring
The README lists what happens to the score afterward:
- Author Diversity: "each post after an author's first is multiplied by a decaying factor, down to a floor." Posting eight times in a session does not get you eight slots.
- Out-of-Network Discount: "posts from accounts the viewer does not follow are multiplied by a factor below 1, as are replies and reposts from accounts the viewer does follow." Your reply to someone else is discounted in your followers' feeds relative to your original post.
- New-Author Boost: "posts from authors whose impressions are below a threshold are lifted toward a target position."
That last one is genuinely useful to know if you are starting a business account. There is a documented lift for accounts with few impressions.
The filters that quietly decide everything
The repository lists the pre-scoring filters in order. Two of them matter more than any posting tip:
AgeFilter: posts older than 48 hours are removed. X is a two-day platform. On LinkedIn a post can still be circulating a week later. Here, if it did not work in two days, it did not work.
PreviouslySeenPostsFilter, plus a backup and a session-level filter. You cannot get repeated impressions on the same person by luck.
There is also OONRetweetReplyFilter, which removes "reposts and replies from accounts the viewer does not follow," and a NewUserMinEngagementFilter that holds out-of-network posts below an engagement threshold from new accounts' feeds.
X also runs a separate visibility filtering system, with rules that "can only drop" for out-of-network recommendations, "spam caught at high recall, for instance. The same post is allowed to a follower." That is the closest thing to a documented shadowban mechanism on any platform: reduced distribution to strangers, normal delivery to followers, driven by account labels. X is piloting a tool at x.com/i/underthehood that shows an account which of those labels it has.
Premium, and what X actually claims it buys
From X's help documentation: "Now, people on X will see a slight preference for replies from verified accounts over other replies. We're currently testing the levels at which we prioritize content from Premium subscribers relative to the other factors we consider in conversation rankings."
That is a claim about reply ranking in conversations, not about your posts winning the For You feed. Premium also raises the composition limit to "up to 25,000 characters."
Hard limits worth knowing
- Posting: "50 original posts and 200 replies per day for unverified accounts," per X's limits page. Note that the same help page still contains an older, contradictory line about 2,400 updates per day. When a platform's own documentation disagrees with itself, take the stricter number.
- Video: non-subscribers can upload "videos up to 140 seconds long with a maximum file size of 512MB." Premium subscribers can upload "videos shorter than 4 hours at 1080p."
- Direct messages: 500 per day.
What a founder should do differently on X
Optimize for the send, not the like. Copy-link shares and DM shares carry the heaviest positive weights in the model. The post that gets forwarded to a colleague is worth far more than the one that gets tapped. Write things people would want to be seen sending.
Treat replies as the product. Replies and quotes carry ten times the weight of a like, and a reply from a mutual follow carries a large boost on top. The account that has fifty real mutuals who reply is structurally advantaged over one with five thousand passive followers.
Assume a 48 hour shelf life. Nothing you post survives the age filter. That changes the calculus: on X, repeating yourself across weeks is not lazy, it is required.
Do not bait. Report, mute, not-interested and block are the largest weights in the entire system, and they are negative. The tactics that reliably produce those reactions are the tactics that will quietly cost you the most.
Do not read the weights as a cheat code. They scale predicted probabilities for one specific viewer. You cannot manufacture your way past a model that is predicting whether a particular person will care.
The part nobody automates is the mutual-follow network the weights keep rewarding, which is built one real relationship at a time.
When this was last confirmed
The weights and filter lists here were read directly from the public repository in August 2026. X states that many values are read from a configuration system and that it runs experiments on portions of traffic, so treat the numbers as production defaults on the day they were checked, not as constants. The 2023 engineering blog post is included for the scale figures and the funnel description; the ranking model it describes has since been replaced.
Sources
Every number and factual claim above comes from one of these. If we could not source it, we cut it.
- 01X For You Feed Algorithm (README)
xai-org/x-algorithm, GitHubAugust 2026github.com
- 02home-mixer/params/param.rs (production ranking weights)
xai-org/x-algorithm, GitHubAugust 2026raw.githubusercontent.com
- 03Twitter's Recommendation Algorithm
Twitter EngineeringMarch 2023blog.x.com
- 04About X Premium
X Help CenterAugust 2026help.x.com
- 05X limits
X Help CenterJune 2026help.x.com
- 06X videos
X Help CenterAugust 2026help.x.com
This is what an hour in the Ripple Room is for. Eight business owners, one live call, and real comments from people who know your business.
Apply nowKeep reading
How Facebook Decides What People See
Meta publishes a quarterly report on what Americans actually see in Feed. The numbers explain why your Page reach fell, and what still works.
Read the guide
How Instagram Ranks Feed, Reels and Explore
Instagram runs several ranking systems, not one. Here is what Adam Mosseri and Meta have actually published, and what Meta told investors in 2026.
Read the guide
How Pinterest Distribution Works, and Who It Suits
Pinterest is a search engine wearing a social network's clothes. Its own documentation says a Pin can gain engagement years after publication.
Read the guide