Back to articles

How X's "For You" Feed Algorithm Works

How X's "For You" Feed Algorithm Works

xAI recently open-sourced its "For You" Ranking system which determines the content you'll see in your feed.

Here's a simple, step-by-step breakdown of how the algorithm works:

The Big Picture

The algorithm shows you posts from two sources: people you follow (in-network) and people you don't follow (out-of-network). It uses AI to predict what you'll like based on your past behavior.

Step-by-Step Process

1. Gather Your Context

The system looks at your engagement history (what you've liked, replied to, shared, etc.) It also grabs your following list and preferences

2. Collect Candidate Posts

The algorithm pulls posts from two places: Thunder (in-network): Recent posts from accounts you follow, stored in super-fast memory Phoenix Retrieval (out-of-network): Uses AI to find interesting posts from the entire platform by matching your interests to posts using similarity search

3. Add Extra Information

Each post gets enriched with more details like: Post text and media Author info (username, verification status) Video length (if it's a video)

4. Filter Out Bad Candidates (Pre-scoring)

The system removes posts that are: Duplicates Too old Your own posts From blocked or muted accounts Contains keywords you've muted You've already seen recently

5. Score Every Post

This is where the Grok-based AI transformer does the heavy work: Phoenix Scorer: Predicts how likely you are to engage with each post (like, reply, repost, click, etc.) Weighted Scorer: Combines all those predictions into one score (positive actions like "like" add points, negative actions like "block" subtract points) Author Diversity Scorer: Reduces scores if you're seeing too many posts from the same author Out-of-Network Scorer: Adjusts scores for posts from people you don't follow

6. Sort and Select

Posts are sorted by their final scores The top K posts are selected for your feed

7. Final Safety Check (Post-selection)

One last filter removes: Deleted posts Spam Violence/gore Duplicate conversation threads

8. Deliver Your Feed

You get a personalized, ranked feed of posts! Key Innovation The algorithm uses no hand-crafted rules about what makes a post "good." Instead, the Grok AI learns entirely from your behavior—what you engage with tells it what you want to see next.