How the X algorithm works: a plain guide

By Sami KerrPublished Updated 17 min read
Many small dots fall through three horizontal screens and end as three post cards in a stack, beside the title How the X algorithm works and the label How X ranks posts.

The short answer

The X algorithm is a pipeline that runs each time someone opens the For You feed: it gathers candidate posts, filters out the ineligible ones, predicts how the viewer would react to each, adjusts the scores, applies visibility rules and mixes in ads. X publishes the code, but not every rule or live setting.

Key takeaways

  • There is no single X algorithm. The For You feed is rebuilt for each viewer in stages: gather, filter, score, adjust, check visibility and blend.
  • The scoring model predicts the chance that the viewer will like, reply, share, click, mute or report, then multiplies each chance by a weight. Weights do not multiply raw counts.
  • People who do not follow you can only reach your post through two out of network sources, and visibility filtering can still drop it before it is shown.
  • In the files and pages we read there is no link penalty, no posting frequency rule and no best hour. Some rules are withheld, so that is not proof they do not exist.
  • Treat every algorithm tip as a claim and ask which file or Help Center page it comes from.

You are trying to work out why one post travels and another sits still. The first thing to know about the X algorithm is that no single formula decides it. A pipeline runs every time someone opens the For You feed, and X has published the code for it.

This guide walks that pipeline in order: where posts come from, what gets removed, how what is left is scored, what changes the score afterwards and what decides whether a post can be shown at all. Every claim is labelled as something the code shows, something X says, or our own reading, so you can tell which is which.

How does the X algorithm work in one picture

Each time you open For You, X builds the feed again from scratch. The code describes six stages: gather candidate posts, filter, score, adjust, check visibility, then blend in ads and other items. X's Help Center describes the same shape in plainer words.

It says X finds content inside and outside your network, ranks it with a neural network trained on your interactions, and filters harmful, abusive or spammy content before showing it. It also says the system distils roughly 500 million posts a day down to a handful of top posts for your feed.

One feed, built in six stages Six columns labelled Gather, Filter, Score, Adjust, Check and Blend. Six small posts start in the Gather column. Two posts fall out at Filter and are marked removed. The four left are reordered at Score. At Adjust one post is lifted to the top. At Check one more post falls out and is marked removed. At Blend an amber ad joins, and the last column holds the finished feed of three posts and an ad. Gather Filter Score Adjust Check Blend removed removed ad
One feed, built in six stagesWatch the first stage hand six posts forward: two fall out at the filter, one post is lifted at the adjust stage, one falls at the visibility check, and an ad joins at the end.
  1. Gather. Three sources supply candidate posts: one for accounts you follow, two for accounts you do not.
  2. Filter. Posts that cannot or should not be shown to this viewer are removed before any scoring.
  3. Score. A model predicts how likely the viewer is to act on each post, and weights turn those chances into one number.
  4. Adjust. Rules change the score for variety, for accounts the viewer does not follow and for new authors.
  5. Check. The top posts go through visibility filtering, which answers allow, notice, interstitial or drop.
  6. Blend. Ads, Who to Follow and prompts are mixed in with the posts.

3

candidate sources

x-algorithm README, Candidate Sources

19

filters before scoring

x-algorithm README, filter table

48 hours

oldest post that stays in the pool

x-algorithm README, age filter

3

visibility answers

x-algorithm README, Visibility Filtering

What does X publish, and what can't the code tell you

X publishes the code that builds the For You feed at github.com/xai-org/x-algorithm, under an Apache 2.0 licence. The README says "our aim is for the public to be able to understand how posts are distributed on X". That makes it the best primary source there is, and it is still not the whole picture.

An older release exists. X first published recommendation code in March 2023, in an earlier repository that showed parts of the system. Write ups from that time describe that version, not the one in this guide.

X's engineering account announced the release, saying the new algorithm is powered by the same transformer architecture as xAI's Grok model. The Phoenix README adds that earlier releases shipped a sample model, while the current release ships the production code. An article about an older release may describe something that no longer runs. For the accounts X suggests rather than the posts, see how Who to follow chooses accounts.

Label in this guideWhat it means
Code showsSomething you can read in the repository or its README, with the file named
X saysSomething on an X Help Center page or from an X account
Our readingWhat we make of it. It can be wrong
UnknownNot published, so nobody outside X can say
Three trays of index cards. The code shows: stages and order, default weights, filter names. X says: follows plus recommendations, learns from your interactions, Following is newest first. Nobody outside sees: live settings for you, withheld rules, why one post won.
Sort every algorithm claim into one of these three trays before you act on it.
What the code can tell youWhat it cannot tell you
The stages and the order they run inThe chance the model gives your post, for any one viewer
Default weights, with a sync stamp of 8 October 2026Which values are live for you today, since tests run on small slices of traffic
The filters, by name and by purposeThe files X withholds: model prompts for its classifiers and some rules
Which actions the model predictsWhy one post did better than another

For You or Following: which feed is your post competing in

The two feeds work differently. According to the Help Center, Following shows posts only from accounts you follow, newest first. For You mixes accounts and Topics you follow with recommended posts and ranks them for you.

For YouFollowing
Posts from accounts and Topics you follow, plus recommended postsPosts only from accounts you follow
Ranked by a neural network trained on your interactionsNewest first, per the Help Center
Shaped by the accounts and Topics you follow, and by your interactionsSet only by which accounts you follow

The code ships separate servers for the three: for_you_server.rs, following_feed_server.rs and ranked_following_feed_server.rs. The Help Center page we could read describes Following as newest first. If your app shows a sort option next to Following, check which one is selected before you draw conclusions about reach.

In a newest first feed, timing is plain arithmetic: an older post sinks as newer ones arrive. We cover that in our guide to the best time to post on X. The rest of this guide is about For You.

Where do the posts in a For You feed come from

Three sources run at the same time, and each one returns candidate posts. Before they run, X loads context about the viewer: recent engagements (the main input to the model), the follow list, blocks and mutes, muted keywords, posts already seen and followed topics.

Three sources fill one pool of candidates Three source boxes on the left. Thunder, for accounts you follow, is marked in network. Phoenix retrieval, for posts nearest your taste, and SimClusters, for who engages with what, are marked out of network. Dots leave each box in three waves and land in a pool on the right labelled candidates. Thunder accounts you follow IN NETWORK Phoenix retrieval nearest your taste OUT OF NETWORK SimClusters who engages with what OUT OF NETWORK candidates
Three sources fill one pool of candidatesOne source is for accounts the viewer follows. The other two find posts from accounts the viewer does not follow.

In network

Thunder

Holds recent posts in memory as they are published and returns those from accounts the viewer follows.

Out of network

Phoenix retrieval

Turns the viewer and each post into vectors, then returns the posts nearest the viewer.

Out of network

SimClusters

Groups accounts and posts by who engages with what, then finds candidates through those groups.

Our reading: a post reaches people who do not follow you only through the two out of network sources. Both are driven by what the viewer, and people who engage like them, have engaged with. Follower count is not one of the sources. For what the weights mean for replies, reposts and likes in particular, see our guide to X engagement signals.

Which posts are filtered out before ranking

The README lists 19 filters that run before any scoring. Most are housekeeping. Here are the ones that matter most to a person writing posts, in plain words.

Filter, in plain wordsWhat it means for you
The same post from more than one sourceA post found twice is shown once
Posts older than 48 hoursAfter two days a post leaves the For You candidate pool
The viewer's own postsYou do not meet your own posts in For You
Posts already seen or already servedA viewer who has seen your post is not shown it again
Posts matching muted keywordsA muted word hides the post for that viewer
Posts from blocked or muted accountsA block or a mute takes you out of that viewer's feed
Subscriber only posts the viewer cannot accessLocked posts are not shown to people without access
Reposts and replies from accounts the viewer does not followOut of network, original posts are what travel (the README adds conditions)
Repeated reposts of the same postOne repost of a post is enough
For new accounts, out of network posts below an engagement thresholdA brand new account's posts need some engagement before they travel to non followers
A configured percentage of posts, chosen the same way each timeLooks like a holdout for testing (our reading)

The 48 hour limit is an age cap on candidates. It is one of the few hard numbers about time in the whole pipeline, and we come back to it when we look at the claim that some hours are magic.

How does X score the posts that are left

A transformer model called Phoenix reads the viewer's recent engagement history and each candidate post, and predicts the chance of many actions at once. Then a scorer combines those chances with weights: final score equals the sum of weight times chance, action by action.

A score is a walk along one number line A number line from 0 to 0.1. A marker starts at 0. A like, with a made up chance of 10 in 100 and the default weight 0.5, steps it right by 0.05. A reply, with a chance of 1 in 100 and weight 5.0, steps it right by another 0.05. A report, with a chance of 1 in 5,000 and weight minus 234, steps it back left by about 0.047. The marker ends near 0.05, labelled score 0.05. Like: 10 in 100 × 0.5 Reply: 1 in 100 × 5.0 Report: 1 in 5,000 × minus 234 0 0.1 score 0.05
A score is a walk along one number lineMade up chances with the real default weights of 8 October 2026. Each action takes a step, and a rare report can undo a lot of likes.

The model predicts five groups of actions, according to the README.

GroupActions it predicts a chance for
EngagementLike, reply, repost, quote, share, share by message, share by copying the link
ClicksThe post, the profile, a link, a photo expanding, a video opening, the quoted post
AttentionVideo quality view, dwell, dwell time, click dwell time, active seconds
AuthorFollowing the author
NegativeNot interested, mute author, block author, report, not dwelled

The weights live in a parameter file whose header says it is mirrored from configuration defaults, last synced 8 October 2026. These are the defaults, not a promise about what is live. X re-syncs the file often: by 13 October 2026 a like was 0.66 and not interested minus 52.272.

ActionDefault weight
Like0.5
Repost1.0
Share2.0
Follow the author4.0
Reply5.0
Quote5.0
Share by message5.0
Share by copying the link20.0
Open a link0.2
Dwell0.05
Not interestedminus 47.52
Block the authorminus 31.2
Mute the authorminus 58.8
Reportminus 234.0

Read it as chance times weight

A heavy weight on a rare action can add as much as a light weight on a common one. The walk above shows it with made up chances.

Read it as count times weight

Your likes are not multiplied by 0.5 and then cancelled by a report. The model scores the chance of each action for each viewer.

Two things follow, and they are our reading. A post has no single score, because the chances depend on who is looking. And the table is a map of what the model is asked to care about, not a recipe, because the README says live values come from a configuration system and are tested on a small share of traffic.

What changes the score after ranking

After scoring, a few adjustments reshape the list. The README describes three, and the docs folder describes a fourth.

README

Author diversity

Each post after an author's first is multiplied by a decaying factor, down to a floor. In one scorer file we read, this setting was written as off, so the code alone cannot say whether it applies today.

README

Out of network discount

Posts from accounts the viewer does not follow are multiplied by a factor below 1. So are replies and reposts from accounts the viewer does follow.

README

New author boost

Posts from authors whose impressions are below a threshold are lifted toward a target position.

Docs folder

Mutual follow boost

Original posts from people you follow and who follow you back get extra weight on the predicted chance that you reply.

A separate reranking service also trades a little score for less similarity between neighbours in the list, using a determinantal point process over the posts' embeddings. In plain words, it avoids stacking near twins side by side.

The new author boost, in numbers

The default settings in the parameter file say a post qualifies when all of these hold:

  • the author has no more than 50,000 followers
  • the post has fewer than 200 impressions
  • the post is no more than 7,200 seconds (2 hours) old
  • the post is an original post, not a reply or repost

The settings name target slots 15 and 16, which we read as the places in the ranked list where an eligible post is lifted to. The code also checks which experiment group the viewer and the author belong to, so it may apply to only part of your audience.

The fourth adjustment is the best documented change in the repository. The docs folder uses it as a worked example of how a change gets published.

  1. 10 July 2026

    Test begins

    Random users get a boost value of 5, 10, 15 or 20. Most users have 0.

  2. 13 July 2026

    Broad launch

    After positive early results, a value of 20 goes out widely while testing of other values continues.

  3. 24 July 2026

    Lowered to 15

    The notes say people were not seeing as much discussion as they wanted, with many posts coming from accounts they did not follow during the World Cup.

Our reading: a value that went from a test to a broad launch to a lower number in two weeks is a reminder that these numbers are tuned by people, often on feedback. Do not build a posting plan on a number that is likely to change next month.

Who decides whether a post can be shown at all

Visibility filtering does. After the top posts are selected, the scorer's order stops mattering for any post that visibility filtering drops. The README puts it in one line: "Ranking decides the order. Visibility filtering decides whether a post can be shown at all."

The first rule that says drop ends the check A shaft with four rule rows: Author state, Blocks and mutes, Safety labels and Spam. A mint post falls past every row and lands on the ALLOW verdict. A second, rose post stops at the Safety labels row, which says drop, and slides out to the DROP verdict. The Spam row beneath it is marked not asked. A third verdict, INTERSTITIAL, sits beside the Blocks and mutes row. Author state Blocks and mutes Safety labels Spam not asked INTERSTITIAL DROP ALLOW
The first rule that says drop ends the checkThe mint post passes every rule group. The rose post is dropped at one rule, and the rules below it are never asked.

For each post and viewer, visibility filtering gives one of four answers:

  • Allow: show the post normally.
  • Notice: show the post with a notice attached to it.
  • Interstitial: show it behind a gate the viewer can tap through, for example for adult or graphic media.
  • Drop: do not show it.

"The first rule that answers drop ends the evaluation," says the README. A further set of rules applies only to recommendations from accounts the viewer does not follow, and those rules can only drop. Spam caught at high recall is the README's example.

The rules registry groups the Home timeline rules into things like author state (suspended, deactivated or protected accounts), the viewer's blocks and mutes, safety labels, spam, legal takedowns and sensitive media. X's Help Center adds that it restricts the reach of posts that violate its policies, for example by excluding them from search, trends and recommended notifications, or by limiting discoverability to the author's profile.

A Community Note is a different thing: contributors write and rate it. If one appears on your post, read our guide to X Community Notes.

What gets mixed in after ranking

The ranked posts are one source for the final feed. The README says the others add ads, Who to Follow, prompts and push to home items. A blender interleaves them, the default ads blender reorders posts so that ads sit next to them, and Who to Follow and prompts go at fixed positions.

  • Ranked posts come from the pipeline above.
  • Ads are placed by the blender.
  • Who to Follow and prompts sit at fixed slots.

Our reading: a post's place in someone's feed is not a clean read of its rank. Ads and fixed slots sit around it, so two posts with similar scores can look further apart on the screen than they were in the ranking.

What else lives in the repository

The repository is bigger than the feed. Most of it is the machinery that labels posts and accounts, which is what visibility filtering reads.

A map of the repository in four districts. Builds your feed: home-mixer, thunder, phoenix, simclusters. Labels posts and accounts: grox, agatha. Decides what can be shown: visibility-filtering, scarecrow. Shows you the labels: under-the-hood. Arrows run from labels to rules to the feed.
The folders that matter to a creator, grouped by what they do.

Two label systems are worth knowing by name:

  • Grox holds classifiers for categories such as spam, adult content and violent media.
  • Agatha labels accounts from how many blocks, reports and spam reports they receive relative to favorites.

Our reading: the second one is why audience fit matters more than a big number. An account that collects blocks and reports for every like it earns can pick up a label, and labels feed the visibility rules. Three narrower questions have their own guides: how X ranks replies under a post, why posts reach the wrong audience and whether editing a post hurts its reach.

The README is open about what it leaves out: the model prompts used by the Grox classifiers and some rules, to reduce the risk that people use them to game the system.

Which X algorithm myths does the code support

Most algorithm advice is a claim about a rule. Here are common claims and what the primary sources show. "Not found" means not found in the files and pages we read, and because some rules are withheld, that is not proof of absence.

The claimWhat the sources showHow sure
Links get your post buriedIn the weights we read, opening a link has a small positive weight, 0.2. We found no rule that lowers a post for containing a linkNot found
Posting too often hurts youNo posting frequency rule found. The nearest thing is author diversity, which one file we read had switched offUnclear
There is a magic hourThe only time rules we found are the 48 hour age filter and the 2 hour window of the new author boost. Nothing names an hour of the dayNot found
A shadowban hides your accountThe documented mechanism is visibility filtering with labels, and Under the Hood shows the labels on your accountCheck your labels
Premium or a badge boosts every postThe weights list actions, not account types. The only subscription rule we found hides subscriber only posts from people without accessNot found
One report cancels hundreds of likesThe README calls that conclusion incorrectContradicted

If you want the neighbouring facts, our guides cover when to post, what the badges mean and how automation rules work.

What does this mean for the posts you write

None of this is a recipe, and nothing here promises reach. But the pipeline does give you better questions to ask of a draft. Everything in this list is our reading of the sources above.

Questions to ask of a draft

  • Who is the one reader who would reply to this, and what would they say?
  • Would someone send it to a friend or copy its link? Those actions carry some of the highest default weights.
  • Does the first line give a reason to stay? The model predicts dwell, and our guide to X hooks shows how to write that line.
  • Could the wrong reader mute, block or report it? The biggest weights in the table are the negative ones.
  • Is it an original post? Out of network, reposts and replies are filtered.
Example Bakery@examplebakeryExample

We are moving weekend bread pickup from 9am to 8am. If you could only take one loaf home, which one: seeded rye or plain sourdough?

Example. Our reading: a question that the right reader can answer in a few words.

Do not read this as a licence to bait. The negative weights are the largest in the table, and a post that earns mutes and blocks pays for it with every viewer who reacts that way.

To check your own results, calculate your engagement rate post by post. Kairo Post's analytics shows which topics and hours work for your own account, which is a better guide than a general tip.

How to keep up as the algorithm changes

The code, the weights and the filters all change. The only reliable habit is to check the source rather than the summary.

  1. Open the README and the docs folder

    Look for dated change notes. The bidirectional follow notes are the model of what a published change looks like.

  2. Read the sync stamp

    The weights file header says when it was last mirrored from configuration. If the date is old, the numbers may be too.

  3. Open Under the Hood for your account

    Check whether any visibility labels apply to you before you blame the ranking.

  4. Ask where every tip comes from

    If it cannot point to a file or a Help Center page, treat it as speculation and test it on your own posts.

Your plan for this week

  • Open the README once and find the six stages in it.
  • Open Under the Hood and note any labels on your account.
  • Rewrite the first line of your next post so the right reader has a reason to stay.
  • Compare your last 10 posts by engagement rate, and write down what the top two have in common.

In the product

How Kairo Post does this

Everything above works by hand. Kairo Post does the same work for you, with your approval before anything goes out.

Questions people ask

Is the X algorithm open source?
You can read it. X publishes the code behind the For You feed at github.com/xai-org/x-algorithm under the Apache 2.0 licence. The README also says a limited set of files is not published, such as the model prompts used by its content classifiers and some rules, so readable is not the same as complete.
Does the X algorithm use Grok?
X's engineering account said the new algorithm is powered by the same transformer architecture as xAI's Grok model. The Phoenix README adds that earlier releases shipped a sample model ported from Grok 1, and that the current release ships the production implementation. The ranking model in the code is called Phoenix.
Is the Following feed in order of time?
X's Help Center says the Following timeline shows posts only from accounts you follow, newest first. The published code also contains a ranked Following variant. If your app shows a sort option next to Following, check which one is selected before you judge your reach.
Do replies count for more than likes?
In the default weights, a reply is 5.0 and a like is 0.5. But the README says weights scale predicted probabilities, not raw counts, so you cannot read them as a price list. A rare action with a high weight and a common action with a low weight can add the same amount.
How can I see whether X limited my posts?
X offers a tool called Under the Hood, linked from the README, that shows aggregate statistics about the visibility labels on your account and posts. As of 18 September 2026 its reports also show limits applied because of required compliance with law, and in which country.
How often does the X algorithm change?
There is no published schedule in the README. Many values are read from a configuration system and tested on small slices of traffic, and the weights file carries a sync stamp of 8 October 2026. The docs folder shows one example, a July 2026 change that went from a test to a broad launch to a lower value in two weeks.
Does the time I post matter for the X algorithm?
The published code names no best hour. It does contain an age filter that drops posts older than 48 hours from For You candidates, and a new author boost that applies to posts up to 2 hours old by default. Timing still matters in the Following feed, where newer posts sit higher.

Sources

Every rule, limit and figure in this post was checked against these on the date shown.

  1. x-algorithm README, xai-org on GitHub

    github.com · checked

  2. Phoenix README, xai-org on GitHub

    github.com · checked

  3. Home Mixer parameters (param.rs), xai-org on GitHub

    github.com · checked

  4. Visibility filtering rules registry, xai-org on GitHub

    github.com · checked

  5. For You Home Timeline Recommendations, X Help Center

    help.x.com · checked

  6. About your For you timeline on X, X Help Center

    help.x.com · checked

  7. Our approach to recommendations, X Help Center

    help.x.com · checked

Written by

Sami Kerr, founder of Kairo Post

Keep reading

All posts on this topic

Post at the right moment.
Starting today.

Connect an account, describe your voice and let Kairo Post do the legwork.