X Open-Sources 'For You' Recommendation Algorithm in Push for Transparency
Key Takeaways
- •X published the full source code for its "For You" recommendation algorithm on GitHub on January 20, 2026, following Elon Musk's announcement ten days earlier.
- •The algorithm is a complete rewrite in Rust and Python that replaces a partial 2023 open-sourcing of an older Scala-based version.
- •The ranking system uses a transformer model called Phoenix, enhanced with xAI's Grok technology, and prioritizes active engagement such as shares and comments while penalizing posts that attract reports or fail to retain user attention.
- •Expert John Thickstun noted that key operational weights and configuration settings remain redacted, preventing independent researchers from fully reproducing or auditing the algorithm's behavior.
- •An August 2026 update introduced a transparency tool called "Under the Hood" that surfaces label statistics for individual posts, giving users visibility into why specific content was promoted or suppressed.

X has published the source code powering its "For You" recommendation algorithm — the system that determines which posts surface at the top of hundreds of millions of user feeds each day. Hosted in the xai-org/x-algorithm GitHub repository, the release represents a complete rewrite of the platform's previous recommendation engine.
Elon Musk announced on January 10, 2026, that X would open-source the full recommendation algorithm within seven days. The code was published on January 20. It replaces a partial 2023 open-sourcing of an older Scala-based version with a ground-up rebuild written in Rust and Python.
How the Algorithm Determines What Users See
The system operates through a multi-stage pipeline. It first retrieves candidate posts from across the platform, drawing from accounts a user follows, trending topics, and content similar to what the user has previously engaged with. A ranking model then predicts the likelihood of user interaction with each post and sorts them accordingly.
The ranking model prioritizes shares, comments, and other forms of active engagement. Posts that generate replies and reposts receive a boost, while posts that attract reports, mutes, or fail to hold user attention are penalized.
Under the hood, the algorithm employs advanced transformer models — specifically a model called Phoenix, which has been enhanced with elements drawn from xAI's Grok technology. The pipeline also incorporates visibility filters, safety modules, and classification layers designed to handle content moderation signals. A May 15, 2026, commit updated more than 18,000 lines across 187 files.
Transparency or Theater?
The release makes X one of the first major social media platforms to openly share a recommendation system's source code. Meta, TikTok, and YouTube have each published research papers and high-level descriptions of their algorithms, but none have released a working codebase on GitHub for public inspection.
Significant portions of the algorithm, however, remain redacted — including key operational weights and exact configuration settings. Expert John Thickstun noted that the omitted weights and parameters limit the practical transparency of the release, as independent researchers cannot fully reproduce the algorithm's behavior or audit its outputs without those components.
For researchers who have spent years requesting greater access to platform recommendation systems, the release offers a starting point even in its incomplete form. The ability to inspect the pipeline architecture and classification layers — even without every production weight — enables a level of structural scrutiny previously unavailable on any major platform.
On August 13, 2026, the repository received another round of significant updates, adding configuration parameters and a new transparency tool called "Under the Hood." This tool surfaces label statistics for individual posts, giving users some visibility into why specific content was surfaced or suppressed.
Implications for Social Media and Beyond
The move comes at a time when regulatory pressure on algorithmic transparency is intensifying globally. The European Union's Digital Services Act already requires large platforms to disclose how their recommendation systems operate, and similar legislative efforts have been discussed in the United States and United Kingdom. Whether competitors respond by releasing their own codebases — or whether X's approach becomes a regulatory benchmark — remains an open question for the industry.