How the X (Twitter) algorithm actually works
X is the only large platform that publishes the code ranking its main feed. It also had to add a comment to that code correcting the most-repeated claim about it.
9 minute read
This is the one major feed whose source you can read
Every other guide to a social algorithm is inference from measurement. This one does not have to be. Twitter published a version of its recommendation code in 2023, and xAI replaced it on 20 January 2026 with a new repository covering the Grok-derived system now running the For You feed. TechCrunch reported the release alongside a $140 million European transparency fine handed down the month before, and some observers called the whole exercise transparency theatre. That criticism has force, but it does not change the fact that the code is there. A second release on 13 and 14 August 2026 added the scoring parameters and the visibility-filtering systems, and that is the version worth reading, because the January drop did not include the numbers.
Where candidates come from, and a figure that quietly disappeared
Each request assembles a fresh feed from two pools. In-network candidates come from a service called Thunder, which keeps recent posts from accounts you follow in memory. Out-of-network candidates come from Phoenix retrieval, a learned model that finds posts by embedding similarity, and from SimClusters, which works by community clustering. Both pools are then ranked by the same model, so following someone does not put them in a protected lane. The number everyone quotes — that around half the feed is in-network — comes from the 2023 repository's README, which said roughly 50% of posts came from the in-network search index. The 2026 repository does not restate it. If you see that figure cited as current, it is being carried forward from a system that no longer runs.
Being ranked and being allowed to appear are separate systems
Two mechanisms can stop a post reaching you, and only one of them is ranking. Before scoring, a chain of filters removes candidates outright: anything older than 48 hours, your own posts, duplicates, posts you have already been shown, posts matching your muted keywords, accounts you block or mute, and — importantly for reach — every reply and repost from an account you do not follow. Visibility filtering is a different system again, deciding whether a post appears normally, sits behind an interstitial, or is dropped, based on labels other models attach. X published those label definitions on 13 August 2026, eighteen for posts and twelve for accounts, alongside a pilot tool called Under the Hood that lets eligible accounts download aggregate statistics on their own labels. The Grok prompts that generate several of those labels are deliberately not published.
Phoenix, the model that does the ranking
Phoenix is a transformer, and the same trunk serves both retrieval and ranking. Its main input is your recent engagement history — the production configuration encodes up to 1,022 positions of it — plus context features such as hour of day, post age and surface. For each candidate it outputs one probability per action across a taxonomy of dozens, along with regression heads for continuous values like dwell time. The design detail worth knowing is candidate isolation: candidates can attend to you and to your history, but not to each other. That makes a post's score depend only on you and that post, not on whatever else happened to be in the same batch. There is no hand-written relevance rule anywhere in it.
The weights, and the sentence X had to add to its own README
The final score is a weighted sum across those predicted probabilities. The default weights sit in the public parameter file, and the spread is wide: a predicted like is 0.5, a repost 1.0, a reply 5.0, a quote 5.0, and a share by copied link 20.0. A predicted reply on an original post by someone you mutually follow gets a further boost of 15.0 on top, taking it to 20.0. What matters more than the ordering is what the numbers mean. On 14 August 2026 X added a note to the README, and matching comments in two source files, stating that the weights scale predicted probabilities rather than raw engagement counts — so reading them as count equivalences is simply wrong.
The negative signals, and whether mass-reporting works
The same file carries negative weights: not interested at -43.2, block author at -31.2, mute author at -58.8, report at -234.0, and a penalty for scrolling past without dwelling. Those look enormous next to a like at 0.5, and that gap is the source of the widely-shared claim that one report cancels 468 likes. X's own comments say plainly that this is incorrect, and explain why: a report is more than a thousand times rarer than a like, so it needs a large multiplier for the prediction to move the score at all. The code makes a second point about brigading — predictions are personalised, so hostile accounts mostly affect what people like them are shown, and engagement only counts on posts served through the Home Timeline.
Three adjustments applied after the score
The weighted sum is not the last word. Author diversity multiplies each successive post from the same author by a decaying factor, defaulting to a decay of 0.5 down to a floor of 0.25, which is why one account cannot occupy your feed no matter how well it scores. An out-of-network discount multiplies posts from accounts you do not follow by 0.75, and the same discount is applied to replies and reposts from accounts you do follow; inside a topic timeline the factor is 0.5. A new-author boost lifts posts from authors below an impressions threshold toward a target position. A separate reranking service then reorders the result before it is served.
The link question the code does not settle
This is where honest reading runs out. Buffer's analysis of 18.8 million posts from 71,000 accounts, running to August 2025, found link posts from non-Premium accounts at roughly a 0% engagement rate against about 0.40% for text posts, with the collapse dating from March 2025. Elon Musk said in July 2026 that X had not penalised linked posts for over a year, and PPC Land's review of the released code found no rule targeting URLs anywhere in it. All three can be true at once: opening a link carries a weight of 0.2 against 20.0 for a copied-link share, so a link asks for the cheapest action in the model. Post the substance natively and put the link in a reply.
FAQ
Is the X algorithm really open source?
Substantially, yes. xAI published the code behind the For You feed on 20 January 2026 and added the scoring parameters and visibility-filtering systems on 13 and 14 August 2026. Some pieces are deliberately withheld, including the Grok prompts used for content classification and some rule definitions, and the live parameter values can differ from the defaults in the repository.
Does one report really cancel out 468 likes on X?
No, and X added comments to its own code saying so. The ratio is real — report is weighted at -234.0 against 0.5 for a like — but those weights multiply predicted probabilities, not counts of actual engagement. A report is more than a thousand times less likely than a like, so it needs the larger multiplier to influence ranking at all.
Is half the For You feed still from accounts you follow?
That figure comes from the 2023 repository, which stated that around 50% of posts came from the in-network search index. The 2026 repository describes in-network and out-of-network sourcing without publishing a split, so the number is no longer verifiable. What is documented is that out-of-network posts are discounted by a factor of 0.75 after scoring.
How long do posts stay in the For You feed?
The age filter drops candidates older than 48 hours before they reach the ranker, so that is the hard outer limit for organic distribution through the recommendation system. Posts can still be reached directly, through search, or from a profile after that, but they stop being eligible for the For You feed.
Sources
- x-algorithm: the algorithm powering the For You feed on X · xAI
- the-algorithm: source code for the X recommendation algorithm (2023 release) · Twitter
- X open sources its algorithm while facing a transparency fine and Grok controversies · TechCrunch
- Do posts with links affect content performance on X? · Buffer
- X drops year-old link penalty, Musk tells Zuckerberg on platform · PPC Land
Related pages
Keep reading
More Creator Growth →How to use Twitter (X) in 2026
Most guides to this platform describe features that no longer exist. Communities shut down in May 2026, DMs became Chat, and the home screen now has more than two tabs.
9 minute readHow to use Pinterest: the setup, the formats and the search mindset
Pinterest reported 640 million monthly active users in its Q2 2026 results, and almost none of them are scrolling a friend feed — they are searching. That changes what you publish, how you title it, and how long it keeps working.
8 minute readHow to make money on Pinterest, and what each route is actually worth
Pinterest shut its Creator Rewards programme in November 2022 and never replaced it with an ad revenue share. Every dollar you make on Pinterest arrives from somewhere off Pinterest — here is where, and roughly how much.
8 minute readTurn one long video into a week of posts
300 credits for 3 days · no card
Start free