Source Code Analysis

What Boosts Your Content

A deep dive into the X "For You" feed algorithm. Understand exactly what factors influence whether your content gets seen, with real numbers from the source code.

19Predicted Actions
1,500Candidate Posts
128History Lookback
Scroll to explore

How the "For You" Feed Works

Imagine the algorithm as a very smart friend who knows exactly what posts you enjoy.

1

Collecting Posts

The system collects ~1,500 posts as candidates from two sources:

  • Your Network: Recent posts from accounts you follow
  • Discovery: Interesting posts from people you don't follow yet (via Phoenix AI)
2

Learning About You

The algorithm studies your behavior from the last 128 interactions:

  • What you liked, replied to, or reposted
  • What you scrolled past quickly
  • What made you stop and read
  • Who you blocked or muted
3

AI Makes Predictions

For each candidate post, Grok AI asks:

  • "If I show this post, what will they do?"
  • Predicts probability of 19 different actions
  • Positive: Like, Reply, Repost, Follow
  • Negative: Block, Mute, Report, Not Interested
4

Calculating the Score

Each prediction gets multiplied by a weight:

  • Likes are valuable → +30x multiplier
  • Follows are most valuable → +50x multiplier
  • Reports are devastating → -200x multiplier
  • All weighted predictions are summed
5

Ranking & Showing

Posts are sorted by their final score:

  • Highest scores appear first
  • Top ~50-100 posts form your feed
  • Author diversity prevents spam
  • Out-of-network posts get penalized

The Journey of a Post

From creation to your "For You" feed in 12 steps.

1

Post Created

Someone creates a post

2

Ingestion

Stored in Thunder (real-time database) and indexed for Phoenix retrieval

3

You Open X

System fetches your last 128 engagements, following list, blocks, mutes

4

Candidate Sourcing

~1,500 posts collected from your network + AI discovery

5

Hydration

Post text, media, author info, video duration enriched

6

Pre-Scoring Filters

Remove duplicates, old posts, blocked authors, seen posts → ~500-1000 remain

7

Phoenix Scoring

Grok AI outputs 19 probability scores per post

8

Weighted Scoring

P(like)×30 + P(reply)×20 + P(follow)×50 - P(block)×150...

9

Author Diversity

2nd post from same author: 70%, 3rd: 50%, 4th: 35%

10

Out-of-Network Penalty

Not following? Score × 0.3-0.5 (30-50% penalty)

11

Selection

Sort by score, select top 50-100 posts

12

Your Feed

Final visibility filtering and de-duplication applied

Boost Factors with Numbers

The algorithm predicts action probabilities and multiplies by weights.

Positive Actions

Someone follows you after seeing post

The ultimate signal

+50x

Likes (Favorites)

Most common strong signal

+30x

Reposts (Retweets)

Shares with followers

+20x

Quote Tweets

Adds their own thoughts

+20x

Replies

Sparks conversation

+20x

Shares (any method)

Active choice to share

+20x

Video Quality Views

Meaningful watch duration

+10x

Profile Clicks

Wants to learn more

+2x

Post Clicks

Expanded to see more

+1x

Dwell Time

Time spent reading

+1x/sec

Negative Actions

Report

Flagged as problematic

-200x

Block Author

Never wants to see you

-150x

Mute Author

Wants to hide content

-100x

"Not Interested" Click

Explicitly rejected

-50x

Network Status

In-Network (they follow you)

Full score preserved

1.0x (100%)

Out-of-Network (they don't follow you)

Significant penalty

~0.3-0.5x (30-50%)

Author Diversity Penalty

1st post from you in batch

Full score

1.0x (100%)

2nd post from you in batch

Decay applied

~0.7x (70%)

3rd post from you in batch

Further decay

~0.5x (50%)

4th post from you in batch

Approaching floor

~0.35x (35%)

5th+ post from you in batch

Floor value reached

~0.2x (20%)
Myth Busting

What Does NOT Matter

Verification status is NOT used in the ranking algorithm.

Verification Status (Blue Check): NO DIRECT BOOST

The GizmoduckCandidateHydrator only fetches author_followers_count and author_screen_name. Verification status is NOT fetched, NOT stored, and NOT used in scoring.

"Blue checks get boosted"

No verification boost exists in the scoring code

"Verified accounts rank higher"

The algorithm doesn't check verification status

"Paying for verification helps reach"

No direct boost - but may affect perception

Note: Verification may indirectly help if verified users tend to get more engagement, which the model then predicts. But there's no "if verified, add +10 to score" rule.

Other Things That Don't Directly Boost

Hashtags

No code checks for or boosts hashtags

Posting time

No time-of-day multipliers exist

Post length

Short and long posts scored equally by engagement

Number of followers

Your follower count doesn't multiply your score

Account age

New and old accounts treated the same

Link inclusion

Posts with links not penalized or boosted

Image vs text

Media type doesn't have explicit weights

However: Indirect Effects

All these factors may INDIRECTLY affect your reach because the AI learned from billions of interactions. If posts with images consistently get more engagement, the model learns to predict higher engagement for image posts. This is implicit learning, not explicit rules.

The Complete Scoring Formula

Here's exactly how your score is calculated in 5 steps.

1

Phoenix ML Score (Grok Output)

For each candidate post, Grok outputs probabilities:

P(favorite)           = probability user will like
P(reply)              = probability user will reply
P(repost)             = probability user will retweet
P(quote)              = probability user will quote
P(follow_author)      = probability user will follow
P(not_interested)     = probability of "not interested"
P(block_author)       = probability user will block
P(mute_author)        = probability user will mute
P(report)             = probability user will report
predicted_dwell_time  = expected seconds on post
2

Weighted Combination

weighted_score = 
    P(favorite)      × FAVORITE_WEIGHT      (+)
  + P(reply)         × REPLY_WEIGHT         (+)
  + P(repost)        × REPOST_WEIGHT        (+)
  + P(quote)         × QUOTE_WEIGHT         (+)
  + P(follow_author) × FOLLOW_WEIGHT        (+)
  + P(dwell)         × DWELL_WEIGHT         (+)
  - P(not_interested)× NOT_INTERESTED_WEIGHT(-)
  - P(block_author)  × BLOCK_WEIGHT         (-)
  - P(mute_author)   × MUTE_WEIGHT          (-)
  - P(report)        × REPORT_WEIGHT        (-)
3

Score Normalization

normalized_score = normalize(weighted_score, candidate)

If weighted_score < 0:
    Negative scores scaled using NEGATIVE_WEIGHTS_SUM

If weighted_score ≥ 0:
    Offset by NEGATIVE_SCORES_OFFSET for separation
4

Author Diversity Adjustment

diversity_multiplier = (1 - FLOOR) × DECAY^position + FLOOR

Where:
  position = 0 for first post, 1 for second, etc.
  DECAY ≈ 0.7 (each additional post gets 70% of previous)
  FLOOR ≈ 0.2 (minimum 20% of score kept)

diversity_adjusted_score = normalized_score × diversity_multiplier
5

Out-of-Network Adjustment

If user follows this author (in-network):
    final_score = diversity_adjusted_score × 1.0

If user does NOT follow (out-of-network):
    final_score = diversity_adjusted_score × OON_WEIGHT_FACTOR
    
    Where OON_WEIGHT_FACTOR ≈ 0.3-0.5 (30-50% penalty)

Final Result

Posts are sorted by final_score (descending). Top K posts are selected for the feed.

How Grok Predicts Your Engagement

The Grok Transformer model architecture and what it learns.

Grok Transformer Architecture

128Embedding dimensions
MultiTransformer layers
MHAMulti-head attention

Candidate Isolation (Critical)

During attention computation:

User token can see: itself
History tokens can see: user + all history
Candidate tokens can see: user + history + ONLY ITSELF

Candidates CANNOT see other candidates!

This ensures each post's score is independent of the batch.

What Grok Learns From Billions of Interactions

User Patterns

"Users who liked posts A, B, C tend to also like posts similar to D"

Content Patterns

"Posts with certain characteristics get more engagement"

Author Patterns

"When user X sees posts from author Y, they usually engage"

Negative Patterns

"Users who block author Z often have similar characteristics"

The model has NO explicit rules like "boost posts with images" or "penalize posts with links".

If images historically get more engagement, the model implicitly learns to predict higher engagement for image posts.

Filters That Block Content

Before scoring even happens, many posts are filtered out entirely.

Pre-Scoring Filters

Applied before ML scoring

DropDuplicatesFilter

Same tweet_id appearing twice

CoreDataHydrationFilter

Posts missing author or empty text

AgeFilter

Posts older than MAX_POST_AGE threshold

SelfTweetFilter

Your own posts

RetweetDeduplicationFilter

Multiple retweets of same original post

IneligibleSubscriptionFilter

Subscription posts you can't access

PreviouslySeenPostsFilter

Posts you already scrolled past (bloom filter)

PreviouslyServedPostsFilter

Posts shown earlier in this session

MutedKeywordFilter

Posts containing your muted keywords

AuthorSocialgraphFilter

Posts from authors you blocked or muted

Post-Selection Filters

Applied after selection

VFFilter (Visibility Filtering)

Deleted, spam, violence, gore, etc.

DedupConversationFilter

Multiple posts from same conversation thread

Filter Details

Previously Seen Posts Filter

Uses a Bloom Filter sent from the client. Also checks explicit seen_ids list. Prevents showing posts you already scrolled past.

Muted Keyword Filter

Tokenizes your muted keywords and each post's text. Removes posts where any muted keyword appears.

Visibility Filter (VF)

Checks safety results from content moderation. Removes content flagged for deletion, spam, violence, gore, and other policy violations.

Summary Tables with Source Citations

Every claim verified against the actual source code.

What BOOSTS Your Reach

FactorLevelMultiplier
Source
Someone follows you from your postHighest~50xFOLLOW_AUTHOR_WEIGHT
Likes on your postVery High~30xFAVORITE_WEIGHT
Reposts of your postVery High~20xRETWEET_WEIGHT
Quote tweetsVery High~20xQUOTE_WEIGHT
RepliesVery High~20xREPLY_WEIGHT
Shares (DM, copy link)Very High~20xSHARE_*_WEIGHT
Video watch timeHigh~10xVQV_WEIGHT
Profile clicksModerate~2xPROFILE_CLICK_WEIGHT
Being followed (in-network)Critical1.0x vs 0.3-0.5xOON_WEIGHT_FACTOR

What HURTS Your Reach

FactorLevelMultiplier
Source
ReportsCatastrophic~-200xREPORT_WEIGHT
BlocksSevere~-150xBLOCK_AUTHOR_WEIGHT
MutesVery High~-100xMUTE_AUTHOR_WEIGHT
"Not Interested"High~-50xNOT_INTERESTED_WEIGHT
Out-of-network statusSignificant0.3-0.5xOON_WEIGHT_FACTOR
Multiple posts in batchModerate0.2-0.7xAUTHOR_DIVERSITY_DECAY

What Has NO Direct Effect

FactorSource Verification
Blue check / VerificationOnly fetches followers_count and screen_name
Follower countStored but NO scorer uses it
Account ageNot present in PostCandidate struct
Posting timeNo time-of-day logic in any scorer
HashtagsNot parsed or scored anywhere
LinksNot parsed or scored anywhere
Post lengthtweet_text not used in scoring
Verified Against Source Code

Fact-Check: Viral Claims

Popular claims circulating online, verified against the actual codebase.

"Verified accounts get +100 base score, unverified max +55"

FALSE

gizmoduck_hydrator.rs only fetches author_followers_count and author_screen_name. No verification field exists.

"Score multiplied by follower/following ratio"

FALSE

author_followers_count is fetched but never used in any scorer. No following_count field exists.

"Score multiplied by restriction status"

FALSE

No restriction_status, restricted, or similar field in PostCandidate or ScoredPostsQuery.

"First 30 minutes velocity staging (0-5 min → 5-15 min → 15-30 min)"

FALSE

No velocity tracking. No percentage-based follower sampling. Thunder sorts by recency but doesn't implement velocity windows.

"Reply engaged by author: +75, Reply: +13.5"

FALSE

Only ONE reply weight exists: REPLY_WEIGHT. No distinction between author-engaged vs regular reply.

"Profile click: +12, Repost: +1.0, Like: +0.5"

CANNOT VERIFY

Weight names exist but actual values are in params module marked 'Excluded from open source release for security reasons'.

"Report: -369 (instant death)"

CANNOT VERIFY

REPORT_WEIGHT exists and is negative (confirmed by code structure) but actual value not public.

"50% video completion is only +0.005"

FALSE

Video scoring is binary: if video > MIN_VIDEO_DURATION_MS, full VQV_WEIGHT applied. No percentage-based scoring.

"No more manual engineering rules, Grok 100% determines the algorithm"

PARTIALLY TRUE

README states 'eliminated every hand-engineered feature' for relevance. But post-ML scoring still applies manual multipliers (WeightedScorer, AuthorDiversityScorer, OONScorer).

Summary of Viral Claims

6 FALSE

No evidence in code

2 CANNOT VERIFY

Weights not public

1 PARTIALLY TRUE

ML + manual multipliers

Actionable Insights

Key Takeaways for Content Creators

What you need to know to succeed on the platform.

1

Engagement is Everything

30x-50x multipliers

The algorithm predicts engagement. Content that genuinely resonates will perform better because the model predicts higher like/repost/reply probabilities.

2

Negative Signals are Devastating

-150x to -200x multipliers

A single block is worth ~5 lost likes in negative impact. A report is worth ~7 lost likes. Avoid content that triggers these reactions.

3

Your Followers Are Your Foundation

2-3x advantage

In-network content gets 100% of its score; out-of-network gets 30-50%. Building genuine followers matters enormously.

4

Quality Over Quantity

5x penalty for spam

Your 5th post in a batch only gets ~20% of the score your 1st post gets. One great post beats five mediocre ones.

5

Verification Doesn't Help Directly

0x direct boost

There's no boost for being verified. If verified accounts seem to perform better, it's because they tend to get more engagement.

6

The AI Learns From Everyone

Billions of interactions

No explicit rules for hashtags, images, or post length. The model learned what works from billions of interactions.

7

Your History Matters

Last 128 engagements

The algorithm looks at your last 128 engagements. If you've been engaging with certain topics, you'll see more of that content.

The Bottom Line

Create content that genuinely resonates with your audience. Build real connections with followers. Avoid triggering negative reactions. The algorithm is designed to surface engaging content — make yours worth engaging with.

Built with v0