---
title: "How the X Algorithm Works: Feeds, Ranking, Filters"
description: "How the X algorithm works, read from X's published code and Help Center: where posts come from, how they are filtered, scored and checked, and what is unknown."
url: https://kairopost.com/blog/how-the-x-algorithm-works
---

# How the X algorithm works: a plain guide

By Sami Kerr

Published

4 October 2026

Updated

13 October 2026

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.

### Contents15 sections

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 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](https://github.com/twitter/the-algorithm) 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 guide | What it means |
| --- | --- |
| **Code shows** | Something you can read in the repository or its README, with the file named |
| **X says** | Something on an X Help Center page or from an X account |
| **Our reading** | What we make of it. It can be wrong |
| **Unknown** | Not 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 you | What it cannot tell you |
| --- | --- |
| The stages and the order they run in | The chance the model gives your post, for any one viewer |
| Default weights, with a sync stamp of 8 October 2026 | Which values are live for you today, since tests run on small slices of traffic |
| The filters, by name and by purpose | The files X withholds: model prompts for its classifiers and some rules |
| Which actions the model predicts | Why 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 You | Following |
| --- | --- |
| Posts from accounts and Topics you follow, plus recommended posts | Posts only from accounts you follow |
| Ranked by a neural network trained on your interactions | Newest first, per the Help Center |
| Shaped by the accounts and Topics you follow, and by your interactions | Set 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](https://kairopost.com/blog/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 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](https://kairopost.com/blog/how-to-write-great-x-posts), in plain words.

| Filter, in plain words | What it means for you |
| --- | --- |
| The same post from more than one source | A post found twice is shown once |
| Posts older than 48 hours | After two days a post leaves the For You candidate pool |
| The viewer's own posts | You do not meet your own posts in For You |
| Posts already seen or already served | A viewer who has seen your post is not shown it again |
| Posts matching muted keywords | A muted word hides the post for that viewer |
| Posts from blocked or muted accounts | A block or a mute takes you out of that viewer's feed |
| Subscriber only posts the viewer cannot access | Locked posts are not shown to people without access |
| Reposts and replies from accounts the viewer does not follow | Out of network, original posts are what travel (the README adds conditions) |
| Repeated reposts of the same post | One repost of a post is enough |
| For new accounts, out of network posts below an engagement threshold | A brand new account's posts need some engagement before they travel to non followers |
| A configured percentage of posts, chosen the same way each time | Looks like a holdout for testing (our reading) |

Not the same as X's duplicate rules

The first filter removes one post found by two sources. It has nothing to do with X's limits on near identical posts, which we cover in [our guide to X duplicate posts](https://kairopost.com/blog/x-duplicate-posts).

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.

Definition

Candidate isolation

In Phoenix, candidates cannot look at each other when they are scored. A post's score depends only on the viewer and that post, not on which other posts are in the batch.

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.

| Group | Actions it predicts a chance for |
| --- | --- |
| Engagement | Like, reply, repost, quote, share, share by message, share by copying the link |
| Clicks | The post, the profile, a link, a photo expanding, a video opening, the quoted post |
| Attention | Video quality view, dwell, dwell time, click dwell time, active seconds |
| Author | Following the author |
| Negative | Not 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.

| Action | Default weight |
| --- | --- |
| Like | 0.5 |
| Repost | 1.0 |
| Share | 2.0 |
| Follow the author | 4.0 |
| Reply | 5.0 |
| Quote | 5.0 |
| Share by message | 5.0 |
| Share by copying the link | 20.0 |
| Open a link | 0.2 |
| Dwell | 0.05 |
| Not interested | minus 47.52 |
| Block the author | minus 31.2 |
| Mute the author | minus 58.8 |
| Report | minus 234.0 |

Weights are not exchange rates

The README says weights scale predicted probabilities, not raw engagement counts. It calls the conclusion that one report cancels out 468 likes incorrect.

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 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.

You can look at your own labels

X links a tool called Under the Hood from the README. It shows aggregate statistics about the visibility labels on your account and posts, and since 18 September 2026 it also shows limits applied because of required compliance with law.

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 claim | What the sources show | How sure |
| --- | --- | --- |
| Links get your post buried | In 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 link | Not found |
| Posting too often hurts you | No posting frequency rule found. The nearest thing is author diversity, which one file we read had switched off | Unclear |
| There is a magic hour | The 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 day | Not found |
| A shadowban hides your account | The documented mechanism is visibility filtering with labels, and Under the Hood shows the labels on your account | Check your labels |
| Premium or a badge boosts every post | The weights list actions, not account types. The only subscription rule we found hides subscriber only posts from people without access | Not found |
| One report cancels hundreds of likes | The README calls that conclusion incorrect | Contradicted |

Ask where a tip comes from

Every algorithm tip is a claim about how X works, so ask where it came from. A tip that points to a Help Center page or a file in the code is worth a test. A screenshot of one account's good week usually is not.

If you want the neighbouring facts, our guides cover [when to post](https://kairopost.com/blog/best-time-to-post-on-x), what the badges mean and [how automation rules work](https://kairopost.com/blog/x-automation-rules).

## 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](https://kairopost.com/blog/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@examplebakery Example

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](https://kairopost.com/blog/x-engagement-rate) post by post. Kairo Post's [analytics](https://kairopost.com/features/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.

- [Free tool Engagement rate calculator Work out engagement rate the right way.](https://kairopost.com/tools/engagement-rate-calculator)
- [Feature Analytics & Rewards What works, and how close you are to payouts.](https://kairopost.com/features/analytics)

## 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](https://github.com/xai-org/x-algorithm) github.com: · checked: 1 October 2026
2. [Phoenix README, xai-org on GitHub](https://github.com/xai-org/x-algorithm/blob/main/phoenix/README.md) github.com: · checked: 1 October 2026
3. [Home Mixer parameters (param.rs), xai-org on GitHub](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/params/param.rs) github.com: · checked: 1 October 2026
4. [Bidirectional follow boost change notes, xai-org on GitHub](https://github.com/xai-org/x-algorithm/blob/main/docs/BIDIRECTIONAL_BOOST_CHANGE.md) github.com: · checked: 1 October 2026
5. [New author scorer (author_cold_start.rs), xai-org on GitHub](https://github.com/xai-org/x-algorithm/blob/main/home-mixer/scorers/author_cold_start.rs) github.com: · checked: 1 October 2026
6. [Visibility filtering rules registry, xai-org on GitHub](https://github.com/xai-org/x-algorithm/blob/main/visibility-filtering/rules/registry.rs) github.com: · checked: 1 October 2026
7. [For You Home Timeline Recommendations, X Help Center](https://help.x.com/en/resources/recommender-systems/for-you-home-timeline-recommendations) help.x.com: · checked: 1 October 2026
8. [About your For you timeline on X, X Help Center](https://help.x.com/en/using-x/x-timeline) help.x.com: · checked: 1 October 2026
9. [Our approach to recommendations, X Help Center](https://help.x.com/en/rules-and-policies/recommendations) help.x.com: · checked: 1 October 2026
10. [Engineering on X, announcement of the open source release](https://x.com/XEng/status/2013471689087086804) x.com: · checked: 1 October 2026

Written by

## Sami Kerr, founder of Kairo Post

Keep reading

## More in How X ranks posts

[All posts on this topic](https://kairopost.com/blog#algorithm)

- (A post card repeated three times, each copy fainter than the last, with a small tag saying Reach can be restricted, beside the title How X treats duplicate posts and the label How X ranks posts.) How X ranks posts: ### [X duplicate content: how X handles duplicate and repetitive posts](https://kairopost.com/blog/x-duplicate-posts) X duplicate content explained: what X's rules say about repeated posts, what X can do about them and how to reuse an idea without copying it. 30 October 2026: 12 min read

## Post at the right moment. Starting today.

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

[Get started](https://app.kairopost.com/signup) [See pricing](https://kairopost.com/pricing)
