RM Elon Musk officially open-sourced the recommendation algorithm of the X platform

Elon Musk has officially released the recommendation algorithm of X (formerly Twitter) as open source, marking a major step toward transparency on the platform. The system is now almost entirely driven by artificial intelligence, which is responsible for filtering, scoring, and ranking content shown to users.
Musk acknowledged that the current version of the algorithm is still “clumsy” and far from perfect. However, he stated that X plans to update the open-source code roughly once every month, allowing the public to track how the system evolves over time. According to X, the newly released algorithm removes all manually engineered features and most human-defined rules, meaning that what users see in their feeds is largely determined by AI models rather than hand-crafted logic.

On Tuesday afternoon, Beijing time, X officially published its platform algorithm on GitHub, making it accessible to developers and the public. About ten days earlier, Musk had promised that the company would open-source the recommendation system—including the algorithms that decide which posts and advertisements are shown to users—within a week. Future releases will document changes and improvements made every four weeks.
After the code went live, Musk adopted an unusually modest tone, admitting that the system requires substantial refinement. Still, he emphasized that open-sourcing the algorithm allows users to observe the platform’s ongoing efforts to improve in real time.
A Recommendation System Fully Powered by AI

Musk previously revealed that X uses AI to evaluate more than 100 million posts generated each day. Based on this analysis, the system recommends content most likely to appeal to individual users. The newly published code confirms that X has shifted away from rule-based ranking toward a model-centric, AI-driven architecture.
According to X’s description on GitHub, the “For You” feed blends content from accounts a user follows with posts from accounts they do not follow, discovered through machine learning-based retrieval. All candidate content is then filtered and ranked using a transformer model built on Grok.
The platform highlights that manually designed features and most human-defined rules have been removed. Instead, the Grok model handles nearly all core decisions, determining what is “relevant” to a user by analyzing past interactions such as likes, replies, reposts, and other engagement signals.
How the Feed Is Generated

The feed generation process can be summarized as follows:
- The system gathers posts from followed accounts as well as from unfollowed accounts that AI predicts may interest the user. These posts are then filtered, scored, and ranked by machine learning models.
- Scoring is entirely based on historical user behavior. The AI prioritizes content that users are likely to click, reply to, like, comment on, or share, while reducing the visibility of posts that may trigger negative actions such as blocking or reporting.
- Before final delivery, the system applies author diversity checks to avoid showing too many consecutive posts from the same account and filters out content that violates platform policies. The highest-ranked posts are then displayed to the user.
Attention Effects and Content Distribution
Like most major social platforms, X’s algorithm continues to favor content that keeps users engaged for longer periods. However, the key difference is that creators’ posts are now evaluated in real time by AI, which dynamically matches content to users’ interests and behavioral patterns.
At the same time, the diversity mechanism actively limits repeated exposure from the same creator. As a result, advantages traditionally associated with large follower counts or high posting frequency are diminishing. Meanwhile, provocative material and low-quality spam are being deprioritized more aggressively, reducing their overall reach on the platform.

