Elon Musk: latest X algorithm published on GitHub
Musk linked to the xai-org/x-algorithm repository in a post that showed 38,767 likes and 4,982 reposts.
By Staff ยท
Why it matters
Putting the algorithm code on GitHub signals a push toward greater transparency and gives developers and researchers a concrete artifact to inspect, debate, and build against.

Elon Musk (@elonmusk) said in a post on X that the latest X algorithm has been published to GitHub, linking to the xai-org/x-algorithm repository.
"The latest X algorithm has been published to GitHub," Musk wrote on X. The post showed 38,767 likes, 4,982 reposts, 4,884 replies, and 17,343,423 views.
Publishing the code to a GitHub repository makes it accessible in one place for developers and researchers to review and discuss.
Musk did not include additional details in the post about what changed in this latest version.
In a separate post interpreting the release, Nav Toor characterized it as the actual source code for the For You ranking system and summarized what he said the code shows. According to Toor's read of the repository, highlights include:
- The model predicts 15 action probabilities per post (including favorite, reply, repost, quote, click, profile click, video view, photo expand, share, dwell, follow author, not interested, block, mute, report), and reach is a weighted sum across them.
- Negative actions carry heavy penalties; bookmarks are not among the tracked predictions.
- Dwell time and profile clicks are explicit positive signals; quotes are weighted more than reposts; follow-after-engagement is tracked.
- An Author Diversity Scorer attenuates repeated scores from the same author, discouraging same-author saturation.
- Posts are scored in isolation against a user's taste model; Toor says there are no hand-engineered boosts in the ranker, with a Grok-based transformer learning from behavior.
- Out-of-network discovery uses a two-tower retrieval system Toor refers to as Phoenix; visibility filters run after ranking to remove spam and harmful content.
These points reflect Toor's interpretation of the code he reviewed; Musk's post did not elaborate beyond the GitHub link.