X has published the source code behind its “For You” recommendation algorithm, the system responsible for deciding which posts appear at the top of hundreds of millions of feeds every day. The code, hosted in the xai-org/x-algorithm GitHub repository, represents a complete rewrite of the platform’s earlier recommendation engine.
Elon Musk announced on January 10, 2026, that X would open-source the full recommendation algorithm within seven days. The actual release landed on January 20. The repository replaces a partial 2023 open-sourcing of an older Scala-based version with a ground-up rebuild in Rust and Python.
How the algorithm decides what you see
The system works through a multi-stage pipeline. First, it retrieves candidate posts from across the platform, pulling from accounts a user follows, trending topics, and content similar to what the user has previously engaged with. Then a ranking model predicts how likely a user is to interact with each post, sorting them accordingly.
The ranking model prioritizes shares, comments, and other forms of active engagement. Posts that generate replies and reposts get boosted. Posts that attract reports, mutes, or simply fail to hold attention get penalized.
Under the hood, the algorithm employs advanced transformer models, specifically something called the Phoenix model, which has been enhanced with elements drawn from xAI’s Grok technology.
The pipeline also includes visibility filters, safety modules, and classification layers designed to handle content moderation signals. A May 15, 2026, commit updated over 18,000 lines across 187 files.
Transparency or theater?
The release makes X one of the first major social platforms to openly share a recommendation system’s source code. Meta, TikTok, and YouTube have all published research papers and high-level descriptions of their algorithms, but none have dropped a working codebase on GitHub for the public to inspect.
Significant portions of the algorithm, including key operational weights and exact configuration settings, remain redacted. Expert John Thickstun noted that the omitted weights and parameters limit the practical transparency of the release. Without those components, independent researchers cannot fully reproduce the algorithm’s behavior or audit its outputs.
On August 13, 2026, the repository received another round of significant updates, adding configuration parameters and a new transparency tool called “Under the Hood” that surfaces label statistics for posts. This tool gives users some visibility into why specific content was surfaced or suppressed.
What this means for social media and beyond
The move arrives at a time when regulatory pressure on algorithmic transparency is intensifying globally. The EU’s Digital Services Act already requires large platforms to disclose how their recommendation systems work.
Disclosure: This article was edited by Editorial Team. For more information on how we create and review content, see our Editorial Policy.

1 day ago
14








English (US) ·