X Opens Its Recommendation Algorithm to the Public, Revealing How the 'For You' Feed Ranks Posts and Limits Visibility

Social media platforms have spent years using recommendation systems to decide what people see, often making those systems some of the least visible parts of the platforms themselves. 

A post can receive strong engagement yet reach relatively few people, while another can suddenly appear in thousands of timelines. For users, the result can be difficult to explain, particularly when there is no clear indication of how ranking decisions were made.

X is now taking another step toward making that process more visible. 

The company has open-sourced a larger portion of the code behind its For You timeline and introduced a new transparency tool designed to show users whether labels have been applied to their accounts or posts that could limit their visibility. 

The release is available through X's x-algorithm repository on GitHub.

The move builds on X's earlier decision to publish parts of its recommendation system. 

In 2023, the company released source code covering parts of the recommendation infrastructure, including systems used for candidate generation, ranking and recommendation signals. 

That earlier repository was based largely on the architecture inherited from Twitter. X has since continued updating its recommendation technology, and the newer x-algorithm repository represents a more substantial look at the system currently used to construct the For You feed.

The newly published system provides considerably more detail about how posts move through the recommendation pipeline. 

X says the expanded release includes model configuration, filtering systems and core ranking components, making it roughly 10 to 15 times larger than its previous open-source release. 

The code is published under the Apache 2.0 license.

At a basic level, the For You system starts by gathering potential posts from two major sources. 

One is content from accounts a person follows, known as in-network content. The other comes from outside the user's network and is discovered through machine learning based retrieval. These candidates are then combined and passed through additional processing before being ranked for the individual user.

The ranking stage is particularly significant because X says it is powered by Phoenix, a transformer-based system derived from the architecture of the open-source Grok-1 model

Phoenix predicts the probability of different user actions for each candidate post, rather than assigning a single generic relevance score. Signals can include the likelihood that someone will like, reply to, repost or click on a post, among other interactions. The resulting predictions are combined to produce the ranking used to determine which posts appear higher in the feed.

This means that the For You timeline is not simply a chronological list of popular posts. 

The system is attempting to predict which individual pieces of content a particular user is most likely to engage with. The same post can therefore receive different treatment for different users because their engagement histories and interests provide different signals to the recommendation model.

The system also has several stages before ranking takes place. 

Candidate posts can be removed because they are duplicates, too old, already seen, from blocked or muted accounts, or otherwise ineligible. 

Additional information about the post and its author is then added before the ranking models evaluate the remaining candidates.

One of the more notable aspects of the newly published architecture is that X says it has moved away from traditional hand-engineered relevance features. 

Instead, the Grok-based transformer is intended to learn relevance patterns from sequences of user interactions. The model can therefore use a person's previous behavior to estimate how they may respond to a new post.

The open-source code does not mean that every detail of X's production recommendation infrastructure is suddenly available. 

The public repository is intended to provide the core architecture and enough implementation detail to explain how the system works, but production systems involve data, infrastructure, model weights and operational components that cannot necessarily be reproduced simply by downloading the repository. 

The code should therefore be viewed as a detailed representation of the recommendation system rather than a complete copy of everything running inside X.

The second part of the announcement addresses a different question that has long been difficult for users to answer: whether their own content is being restricted by the recommendation system. 

X is introducing an "Under the Hood" page that will allow eligible users to inspect labels applied to their accounts and individual posts that may affect visibility.

This creates an important connection between the source code and the transparency tool. 

The code explains which parts of the recommendation pipeline can affect visibility, while the tool gives individual users information about whether relevant labels have actually been applied to their content. In theory, users can therefore move from asking whether their reach has been limited to examining some of the mechanisms and labels involved.

The file registry.rs shows the order in which visibility rules are evaluated.

Image
X algorithm
In the param.rs file, X says these weights are used to combine Phoenix's predicted probabilities for each user action into a post's score

The distinction is important because visibility on a recommendation-driven platform can be affected long before a post is completely removed. 

A post can remain publicly accessible while being shown to fewer people through recommendation systems. X's new tool is intended to make some of those visibility-limiting mechanisms visible to the person who created the content.

Still, this does not make the system completely predictable. 

This is because algorithm is only one of the equation. The other is machine-learning models that can identify relationships in large quantities of behavioral data that are difficult to explain through a simple list of rules. 

Two posts with similar characteristics can still receive different rankings because the model is evaluating them in relation to a particular user's history and predicted behavior.

The ranking_scorer.rs is where the actual ranking calculation happens.

Image
X algorithm
X's open-sourced recommendation system reveals that the For You feed is not controlled by one algorithm, but by a pipeline of retrieval, filtering, ranking, visibility and blending systems

Even so, publishing the underlying architecture provides a substantially clearer picture than users previously had. 

It gives anyone the opportunity to inspect how candidate generation, filtering and ranking fit together, while the new label system provides a way for some users to inspect how visibility-related labels have affected their own content.

The significance of the move therefore extends beyond simply putting source code on GitHub.

 X is making an attempt to connect algorithmic transparency with user-level transparency. One side shows how the recommendation machinery is designed to work, while the other gives people information about how visibility controls may have been applied to their own accounts and posts.

For a platform where visibility can directly affect the reach of creators, organizations and individual users, that distinction matters. X's recommendation system will remain complex and constantly changing, and open-source code cannot explain every individual decision made by a machine-learning model. But users now have considerably more information about the architecture behind their For You feed, and some will also be able to see whether specific labels are affecting the distribution of their posts.

X says it intends to continue updating the open-source code as the recommendation system evolves. 

Published