X just open-sourced the code for the “For You” algorithm
Everything you need to know in 1 tweet and 1 image:
1. The Raw Inputs (Data)
Everything starts with three big buckets of data:
- Social graph → who you follow, who follows you, your network connections.
- Tweet engagement → likes, retweets, replies, bookmarks.
- User data → your profile, behavior, what you click, what you ignore.
This is the “fuel” that powers the whole system.
2. Feature Engineering
The raw data runs through different models/features that try to make sense of it:
- GraphJet → real-time graph of tweets, retweets, follows.
- SimClusters → groups people and tweets into communities of interest (like “AI Twitter” or “NBA Twitter”).
- TwHIN → Twitter’s “heterogeneous information network,” basically a map of user-to-tweet relationships.
- RealGraph → predicts the strength of connections between users.
- TweepCred → credibility scoring.
- Trust & Safety signals → moderation, blocks, mutes, NSFW filters.
Think of this layer as the “filters” that figure out what’s worth even considering.
3. Candidate Sourcing (Home Mixer)
This is where tweets get pulled in as “candidates” to potentially show you:
Search Index (find relevant tweets directly)
- CR Mixer, UTEG, FRS (different mixers pulling tweets from clusters, graphs, and recency)
They pull from different pools so you don’t just see the same circle of people.
4.Heavy Ranker
Now the candidates run through a big neural network (the heavy ranker).
It scores tweets based on predicted engagement: likelihood you’ll like, retweet, reply, spend time reading.
5. Heuristics & Filtering
After the ML ranker, some hand-coded rules kick in:
Social proof → is it liked by people you follow?
- Author diversity → don’t show 10 tweets in a row from the same person.
- Visibility / T&S → block spam, NSFW, muted accounts.
- Content balance → avoid overwhelming you with one type of content.
- Feedback fatigue → avoid showing you the same tweet repeatedly.
6. Mixing
Finally, the ranked tweets get mixed with:
- Ads (obviously).
- Who to follow suggestions.
7. What does this mean for you?
Probably not much.
- Pick a niche
- Write valuable tweets
- Reply to people in your niche with value
- You'll grow and build an audience
X is a beautiful place to grow an audience to meet interesting people and get insight for what businesses to build for
It's worth being here.
Enjoy.