X has open-sourced the code behind its “For You” feed recommendation system, publishing an updated algorithm repository on GitHub and describing the system as powered by a Grok-based transformer model. The release follows a promise by Elon Musk to open source the new X algorithm and to repeat transparency updates every four weeks.
The newly shared documentation and code aim to show how X gathers, filters, and ranks posts for a user’s feed, mixing content from accounts a user follows with posts pulled from outside their network. Musk also wrote that X’s algorithm is “dumb” and needs “massive improvements,” while saying users can watch the platform “struggle” to improve it in real time “with transparency.”
What X released and how it’s licensed
TechCrunch reported that X published an accessible write-up on GitHub along with a diagram explaining how its feed-generating code works. PPC Land said X released the code and architecture behind its overhauled recommendation algorithm under an Apache 2.0 open source license on GitHub.
AlternativeTo reported that the “For You” feed code is on GitHub under the Apache-2.0 license and described the release as a transparency move that lets the public examine how content is ranked and promoted on the platform. AlternativeTo also said the repository includes roughly 100 files and just under 10,000 lines of code, with 63% written in Rust and 37% in Python.
How the “For You” feed works
TechCrunch said the algorithm considers a user’s engagement history and reviews recent in-network posts when selecting content. TechCrunch also said X analyzes out-of-network posts—content from accounts the user may not follow—using a machine-learning-based approach to find posts the system thinks a user may like.
CGTN similarly said the algorithm collects potential posts from in-network sources (people the user follows) and out-of-network sources (new discoveries from across X). CGTN reported that the system uses an AI model to filter and rank posts, with scoring rules based entirely on the user’s past interactions.
CGTN said posts with higher scores are selected to build the feed, and the scoring tool analyzes past behavior to predict preferences, aiming to increase positive actions such as likes and reduce negative actions such as blocks. TechCrunch added that X’s system is AI-based and “relies entirely” on a “Grok-based transformer” to “learn relevance from user engagement sequences,” while also stating there is no “manual feature engineering for content relevance.”
Filters, safety checks, and variety controls
TechCrunch said the system filters out posts from blocked accounts and content tied to muted keywords, and it also removes content deemed too violent or spam-like. After filtering, TechCrunch said the algorithm ranks remaining posts using signals tied to predicted engagement, including the likelihood a user will like, reply, repost, favorite, or otherwise engage.
CGTN reported additional filtering steps, including removing recently viewed content and posts from blocked accounts before scoring, then filtering out deleted or inappropriate content after scoring. CGTN also said the system aims to keep content varied by preventing repeated posts from the same creator.
A shift from older, more manual logic
AlternativeTo said that, unlike X’s earlier 2023 open-source approach, the new system relies on a Grok-based transformer model and removes nearly all hand-coded logic, learning ranking strategies from user engagement patterns. AlternativeTo also claimed this reduces the impact of tactics such as hashtag stuffing or posting at “so-called optimal times.”
PPC Land described the change as replacing manual heuristic rules with transformer architecture powered by xAI’s Grok language model, calling it a shift from what it characterized as the platform’s earlier “spaghetti code and manual filters.” PPC Land also said the new release includes technical documentation explaining how X evaluates content and accounts, and it exposes parts of the recommendation pipeline such as the RecsysBatch input model and scoring functions written in Rust.
PPC Land reported that X redacted specific weighting constants that would reveal exactly how much different engagement types contribute to overall scoring. That means readers can see the structure and components, while some numeric details that would show precise weighting are not included in the public release described by PPC Land.
Transparency questions and mounting pressure
TechCrunch noted that Twitter (as it was then known) partially open-sourced its algorithm in 2023, but the release was criticized as “transparency theater” and “incomplete.” TechCrunch also said Musk’s earlier stance was that “code transparency” would be “incredibly embarrassing at first” but could lead to rapid improvements and help “earn your trust.”
TechCrunch reported that X did not release its first transparency report until September 2024, after previously releasing multiple transparency reports a year. TechCrunch also said X was fined $140 million in December by European Union regulators, who argued the platform violated transparency obligations under the Digital Services Act and that the verification check mark system made it harder for users to judge account authenticity.
TechCrunch additionally reported that X has faced scrutiny related to Grok, including attention from the California Attorney General’s office and congressional lawmakers tied to claims that Grok has been used to create naked images of women and minors. Against that backdrop, TechCrunch said some observers may view the new open-source push as more “theater,” even as X presents it as transparency.
