X Open Sources Its Algorithm And Reveals What it Takes to go Viral
Set Trending Topics as a preferred source on Google.
X has significantly expanded its open source push: the code behind the “For You” timeline – the feed users see by default when they open the app – is now available on GitHub together with its ranking engine, under the Apache 2.0 licence and published under the organisation xai-org. That is more than a detail: the platform now belongs to the space company SpaceX. Compared with earlier releases, the new additions include the model configuration, the filtering systems and the parameters used to weight individual signals. According to TechCrunch, which was able to speak to the company ahead of the announcement, the disclosed codebase is now roughly ten to fifteen times larger than before.
“You’ll get the core ranking code that pulls posts and ranks them for any given user,” Keith Coleman, VP of Product at X, told TechCrunch. Parts of it – such as the ranker and the score calculation – can be run outside the company, according to Coleman. Ahead of the release, external researchers reviewed the codebase and trained the scoring model themselves.
How the feed is assembled
The technical architecture is documented in some detail in the repository’s README. Posts come from two sources: the Thunder service holds recent posts from the accounts a user follows (“in-network”). Content from unfamiliar accounts (“out-of-network”) is supplied by Phoenix Retrieval and SimClusters, a method that groups accounts and posts into communities based on interaction patterns.
Both pools are then evaluated by the same model: Phoenix, a transformer that reads a person’s recent engagement history and predicts, for each post, how likely they are to take a given action – from likes, replies and reposts through clicks and dwell time to negative reactions such as blocking or reporting. The final score is the weighted sum of these probabilities. Posts older than 48 hours are removed by a filter before that stage.
What the weights reveal about reach
The real news value of the release lies in the now-visible weightings, which are stored in the file home-mixer/params/param.rs. As Business Insider breaks down, engagement is by no means equally valuable to X – and the like is the weakest of the classic interactions:
- The like (called “favorite” in the code) carries a weight of 0.5. It is therefore also the reference unit for every comparison currently circulating: any figure along the lines of “x times as much as a like” is simply the relevant parameter divided by 0.5. Notably, the like carried the same value of 0.5 in the predecessor code published in 2023.
- Replies, quotes and shares via DM each carry a weight of 5 – ten times as much as a like.
- Sharing by copying the link is by far the strongest positive signal: weighted roughly 40 times as heavily as a like (around 20 in absolute terms).
- A follow resulting from a post counts as much as eight likes (4 in absolute terms), a repost as much as two (1 in absolute terms).
The negative weights are considerably more drastic. A predicted report pulls in the opposite direction roughly 468 times as strongly as a like, a mute around 118 times, a “not interested” some 86 times and a block around 62 times. Business Insider concludes that ragebait – deliberately provocative content aimed at generating angry replies – is unlikely to be a particularly reliable growth lever. That is remarkable insofar as the platform has been criticised for precisely those dynamics since Musk’s takeover.
The important caveat
X itself warns in the repository against exactly the arithmetic these numbers invite: the weights scale predicted probabilities, not actual interaction counts. A report therefore does not cancel out 468 likes – and conversely, a like weight of 0.5 does not mean that ten likes are worth as much as one reply. What is multiplied in each case is the model’s estimated probability that the person in question will take that action, and that depends heavily on their own past behaviour.
The fact that the negative weights are so large also has to do with negative feedback being statistically rare. According to the company, X has added extra comments to the code so that people – and language models interpreting the code – are less likely to misread this point.
On top of that come structural adjustments applied after scoring that matter at least as much for reach as the signal weights themselves: each additional post by the same author within a feed is discounted (author diversity), posts from accounts a user does not follow are multiplied by a factor below 1 (out-of-network discount) – currently 0.75, according to code analyses – and accounts with few impressions receive a new-author boost. The discount applies to replies and reposts as well, which argues for putting important content into standalone posts rather than burying it in reply threads.
“Under the Hood”: a look at your own labels
Alongside the code release, X is launching a transparency tool called “Under the Hood” in the app’s settings. Anyone who has published at least ten posts in the past month can download aggregate statistics as a JSON file showing which labels were applied to their account or posts over the past calendar month – the labels, in other words, that determine in visibility filtering whether a post is shown normally, hidden behind an interstitial or not shown at all. For now the tool is running only for a randomised test group of accounts at least one year old.
With that, X is addressing a perennial issue: the accusation of shadowbanning. The combination of open code and individually visible labels is meant to allow users to look up a label in the repository and judge its effect for themselves.
What was not published
The disclosure is not complete – and X says as much. Not included in the repo are, for instance, the prompts for the Grok-based classifiers (Grox), which check posts for spam, rule violations or problematic media, as well as some of the labeling rules. The reasoning: otherwise the system could be deliberately gamed. There was criticism of this in earlier releases; researcher John Thickstun, for example, pointed out that withheld weights and parameters diminish the practical transparency gain – an objection the August update at least partly defuses.
Conversely, what is politically sensitive also becomes visible: the code contains a filter that, in the context of Brazil’s 2026 elections, removes posts from accounts reported to the country’s electoral court – unless the user follows the account themselves.
Musk justified the move as an attempt to improve fairness and gather feedback; earlier in the year he had described the algorithm itself as in need of improvement. X manager Coleman goes a step further: developers are to be able to submit changes via pull requests, which X engineers will then review. The algorithm should not only be visible to the public, but possibly also shaped by it. The repository, which has already collected around 27,500 stars, currently has several dozen open pull requests.
X is now a SpaceX product
The move can only be understood in the context of an ownership structure that has shifted twice in recent years. X Corp. has been a subsidiary of xAI since March 2025. In early February 2026, SpaceX then acquired the AI company xAI in an all-stock transaction, making xAI a wholly owned subsidiary of the space group.
The transaction valued SpaceX at around one trillion and xAI at around 250 billion US dollars. The social network X has since sat two levels below SpaceX – which also explains why the algorithm code lives under the GitHub organisation xai-org, and why Grok-based models such as Phoenix and the Grox classifiers are so deeply embedded in the recommendation logic.
For comparison: Meta, TikTok and YouTube have published research papers and high-level descriptions of their recommendation systems, but no runnable codebase. In that respect, X remains alone for now.

