The X Algorithm, Decoded

X open-sourced their entire For You feed algorithm. Here's what it actually says about how your posts get ranked — no hype, just code.

19
Engagement signals
7
Pipeline stages
0
Manual rules
1
AI model (Grok)

The 7-Stage Pipeline

Every time you open your For You feed, your request passes through these stages in milliseconds.

01

Query Hydration

The algorithm fetches your entire context: engagement history, who you follow, topics you care about, mutual follows, even your IP address for location signals.

It pulls your recent likes, replies, reposts, followed topics, starter packs, and creates a bloom filter of posts you've already seen.

02

In-Network Candidates

Thunder (an in-memory post store) retrieves recent posts from accounts you follow with sub-millisecond lookups.

This is the 'people you chose to follow' portion of your feed. Posts are fetched in real-time from a distributed cache.

03

Out-of-Network Candidates

Phoenix's Two-Tower retrieval model finds posts from people you don't follow but might like, based on embedding similarity.

Your user embedding is compared against millions of post embeddings to find the most relevant content from across the platform.

04

Pre-Scoring Filters

Duplicates, posts you've already seen (bloom filter), self-posts, blocked/muted authors, and age-expired content are all removed.

This stage reduces the candidate pool from thousands to hundreds, keeping only fresh, relevant content.

05

Phoenix Scoring

The Grok transformer predicts 19 different engagement probabilities for every remaining post, then multiplies each by a weight.

Score = Σ(weight × P(action)). Positive signals (like, reply, share) add to your score. Negative signals (block, mute) subtract.

06

Author Diversity

If the same author appears multiple times, each subsequent post gets exponentially penalized to ensure feed variety.

Post #2 from the same author → 70% of original score. Post #3 → 49%. Post #4 → 34%. This prevents any single account from dominating your feed.

07

Final Selection

The top K posts by final score are selected, validated, and assembled into your For You feed in ranked order.

Ads are blended in at this stage with brand-safety checks. The final feed is a mix of in-network, out-of-network, and promoted content.

How Your Score Is Calculated

The Phoenix transformer predicts 19 different actions for every post. Each prediction gets multiplied by a weight, then summed into your final score.

Score = Σ(weight × P(action))
Positive Signals (13)
Share via DMVery High
Follow AuthorVery High
Share via Copy LinkVery High
ReplyHigh
Repost / RetweetHigh
Like / FavoriteHigh
Quote TweetHigh
Video Quality ViewMedium
Dwell Time (binary)Medium
Dwell Time (continuous)Medium
Profile ClickMedium
Photo ExpandLow
ClickLow
Negative Signals (5)
ReportVery High
Block AuthorVery High
Not InterestedHigh
Mute AuthorHigh
Not Dwelled (scrolled past)Low

Key insight: A single block or report can outweigh dozens of likes. Negative signals have disproportionate power because they actively subtract from your score.

8 Things We Didn't Expect

Reading the actual source code revealed some things that no one was talking about.

🧠

Grok AI Judges Every Post

AI Gatekeeper

A Grok Vision-Language Model scores every post 0 to 1. Score ≥ 0.4 = "banger" status and gets a ranking boost. It reads both your text AND images.

🤖

There's a "Slop Detector"

Anti-AI Spam

Grok has a dedicated classifier that detects AI-generated low-quality content ("slop"). If your post reads like generic ChatGPT output, it gets penalized.

📍

Your IP Address Is a Signal

Location Signal

Your IP is hashed and used as an embedding feature for location-based content relevance. The algorithm knows roughly where you are.

📨

DM Shares Are the #1 Signal

Highest Weight

Sharing a post via DM has the highest positive weight of all 19 signals. The algorithm interprets this as the strongest endorsement possible.

🎬

Videos Get Transcribed

Multimodal

ASR (automatic speech recognition) converts video audio to text, which is then embedded alongside the visual content for multimodal understanding.

📉

Author Diversity Decay

Diminishing Returns

Your 2nd post in someone's feed scores 70% of the original. 3rd post: 49%. 4th: 34%. Posting too frequently in a short window hurts each subsequent post.

🔒

Candidate Isolation

Fair Scoring

Your post's score doesn't depend on what other posts are in the same batch. Scores are consistent and cacheable — no competition effects.

🚫

Zero Hand-Engineered Features

Pure ML

Unlike the 2023 algorithm, there are ZERO manual rules or hand-tuned features. Everything is learned by the Grok transformer end-to-end.

Actionable Takeaways

Based on the actual code, here's what you should change about your posting strategy.

01

Optimize for shares, not just likes

DM shares and copy-link shares carry the highest positive weight. Create content people want to send to a friend privately.

Write posts that make people think "my friend needs to see this."

02

Avoid triggering blocks & mutes

A single block outweighs dozens of likes. Controversial content that gets engagement but also blocks is a net negative.

Engagement bait that annoys people will actively kill your reach.

03

Write for Grok's quality score

Grok evaluates your post quality (text + images). You need ≥ 0.4 to be a "banger." Original, insightful, well-crafted content wins.

Be specific, add data, share unique perspectives. Generic takes get low scores.

04

Don't sound like AI slop

The slop detector penalizes content that reads like generic AI output. Personal voice, specific details, and authentic tone matter.

Write like a human. Use first-person, specific numbers, real experiences.

05

Use media (especially video)

Images trigger photo_expand signals. Videos unlock the VQV (video quality view) signal. Videos also get transcribed for better embedding.

Add an image at minimum. Video with clear speech gets the most signals.

06

Don't spam-post

Author diversity decay means your 3rd post in someone's feed window scores only 49% of your first. Quality over quantity.

Post 2-3 high-quality posts per day instead of 10 mediocre ones.

Score Your Tweet

Paste a tweet and see how it scores against the algorithm's actual ranking signals.

0 / 280

Write or paste a tweet to see how it scores against the algorithm.