X For You Feed Algorithm
The published code that decides which posts people see in the For You feed on X.
- Coding needed
- Developers only
- Cost
- Free
The published code that decides which posts people see in the For You feed on X.
This project contains the core code that chooses and orders posts in the For You feed on X, the social network. It mixes posts from accounts you follow with posts from accounts you don't follow. Those second posts are found by machine learning and other methods.
A transformer model (a type of AI model) called Phoenix looks at a person's recent activity. It predicts how likely they are to like, share, block or report each post, or how long they might spend on it. These predictions are combined into one score using weights kept in the code. Filters then remove posts, for example ones from blocked or muted accounts or ones older than 48 hours.
The release also includes the systems that label posts and accounts and decide whether a post can be shown at all. It includes code to train the Phoenix model, plus fake practice data so a test training run can be tried. The README also describes an 'Under the Hood' tool. Its makers say it lets people see statistics about labels on their account and posts that can limit visibility.
Researchers, developers and curious readers who want to understand how a large social media feed is ranked and filtered.
Developers only. This is source code for reading and study, and running any part of it requires programming skills. New to this? Start here.
Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?