Open Source Code Breakdown · Commit a389166

How X Decides What You See

An interactive, visual map of the «For You» feed: from thousands of source candidates through Phoenix scoring and safety checks to the final result set.

One feed request

1
1. Retrieve3,000+ candidates
In-network follows + neural vector matching
2
2. Filtereligibility before scoring
Deduplication, blocks, mutes & age >48h
3
3. Predict15+ action probabilities
Phoenix ML model predicts viewer response
4
4. Select35-post result cap
Diversity reranking, author decay & safety gates

A deterministic pipeline of 7 decisions, not a single opaque black box.

Core unit of ranking

Real-time dynamic computation

Post × Specific Viewer × Current MomentA post has no static, universal score. The algorithm predicts personalized action probabilities for a specific viewer at this exact second.

30-Second Summary

What Happens When You Refresh the Feed

Every feed request follows these four phases; exact live latency is not published in the repository.

  1. Up to 3,000+ potential posts
    1. Gather CandidatesParallel retrieval from Thunder (your follows), Phoenix (vector semantic matching), and SimClusters (community interest graphs).
  2. Instantly drops ineligible posts
    2. Hard FilteringRemoves posts older than 48 hours, already seen items, blocked/muted authors, and out-of-network replies before costly ML scoring.
  3. Predicts 15+ action probabilities
    3. Phoenix Neural ModelThe deep learning model calculates exact probabilities for likes, replies, retweets, link copies, dwell time, and reports.
  4. Balances the final feed
    4. Diversity & SafetyApplies public weights, penalizes author spam (Author Decay), forces topic diversity (DPP), and runs safety gatekeepers.

Full Journey

One query. Seven decisions.

Click any stage to explore its mechanics, interactive visual simulation, input/output data, and practical takeaways.

Stage 1 of 7

1. Gather Context

Before touching posts, the system inspects the viewer: recent actions, followed creators, active communities, language, and muted keywords.

Viewer ProfileDynamic Context Vector
Active Interests
AI & TechStartupsDesign
Follows Graph482 accounts
Language & Localeen-US (UTC-5)
Mutes & Blocks14 rules active

The request combines recent engagement sequences with follows, blocks, mutes, locale, and other viewer context.

Inputs
  • Recent dwell & clicks
  • Social graph
  • Language & country
  • Blocks, mutes & reports
OutputReal-time viewer context vector

Real-world Example: If you spent the last 10 minutes watching machine learning demos and muted political keywords, those two signals immediately bias your search space.

Why it matters: That is why the exact same post receives completely different probability distributions for different people. There is no universal post score.

Creator Takeaway: Your audience is not a monolith: a post thrives when it aligns with the active interests of your core followers.
Evidence in Source Code

Snippet is pinned to commit a389166, ensuring permanent reproducibility.

Open pinned snippet on GitHub

Candidate Retrieval

Three Primary Routes Feed the Recommendation Funnel

The system gathers candidates from distinct sources to balance familiar creators you follow with relevant discoveries.

In-Network (Follows)

Thunder

Direct Social GraphUp to 1,200

Fresh posts from accounts you actively follow. Posts you already saw are filtered out at query time.

Evidence in Source Code

Configuration limits for candidate sources and pool sizes.

Open source candidate limits on GitHub
Out-of-Network (Neural Match)

Phoenix

Vector Embedding IndexUp to 1,000

Transforms your recent reading history into an embedding vector and retrieves nearest-neighbor posts globally.

Evidence in Source Code

Configuration limits for candidate sources and pool sizes.

Open source candidate limits on GitHub
Community Interest Graphs

SimClusters

Semantic Topic ClustersUp to 800

Finds posts that are trending within your shared interest clusters. Public cosine similarity threshold is >0.5.

Evidence in Source Code

Configuration limits for candidate sources and pool sizes.

Open source candidate limits on GitHub

How Source Candidates Narrow Down to a 35-Post Result

3,000+1. Raw Source ProposalsCeiling across Thunder, Phoenix & SimClusters
≤2,8002. Phoenix Scoring CapEligible candidates sent to action prediction
DPP3. Score & DiversifyWeighted score, Author Decay & semantic reranking
354. Result-Size CapBefore blending with ads, prompts and other modules

Counts are code-level ceilings and defaults, not a promise that every request fills each stage.

Interactive Simulation

Probability × Weight = Score Contribution

Test how predicted engagement probabilities and negative penalties combine into the final ranking score.

14% × +0.5
Baseline positive engagement signal (+0.5).
4% × +5
Meaningful conversation starter (+5.0 = 10× likes).
0.8% × +20
Highest organic amplification signal (+20.0 = 40× likes).
1.2% × +4
Strong signal of creator affinity (+4.0 = 8× likes).
0.01% × -234
Catastrophic penalty (-234.0; 468× the like coefficient at equal predicted probability).

Simulated Base Score

0.455
Positive-Weight Dominant
In this simulation, positive weighted terms clearly exceed the negative term.
Like+0.070
Reply+0.200
Copy Link / Share+0.160
Follow Author+0.048
Report / Spam-0.023
Evidence in Source Code

Production formula combines calibrated log-odds and dynamic experiment offsets.

Open ranking scorer formula on GitHub
⚠️
The Math of a Report Penalty

1 Report (-234.0) = 468 Likes (+0.5) or 11.7 Link Shares (+20.0)

This compares coefficient size at equal predicted probability. Phoenix scores probabilities, not raw action counts, so it is not a literal exchange rate.

Frequent Action · Low Weight

12% Like chance × 0.5 = +0.060Common action, provides steady baseline support.
vs

Rare Action · High Weight

0.4% Copy Link chance × 20 = +0.080Low probability, but delivers 33% more score impact than the like!

Which post from this author is it in the current candidate pool?

Author outside viewer's network (Out-of-Network)Public default: × 0.75 multiplier
1. Base Predictions0.455Sum of weighted probabilities
× 1
2. Author Decay Penalty0.4551st post: 100% full weight (no decay)
× 1.00
3. Connection Discount0.455Final score entering Top K selection

Public Defaults

How Much Each Predicted Action Weighs

In the open source codebase, like is the baseline unit (weight = 0.5). Compare how other interactions scale relative to a like.

Base Scoring FormulaScore = Σ ( Weight_i × P(Action_i) )

Phoenix first predicts probabilities [0.0...1.0]. Then public weights turn them into mathematical score contributions.

Positive Action Weights

What boosts score when predicted with equal probability

Predicted ActionScaleWeightvs Like
Copy linkHighest organic amplification signal+20
Reply to mutual follow5.0 base + 15.0 conversation boost for mutual connections+20
ReplyActive conversation starter+5
Share via Direct Message (DM)Private peer recommendation+5
Quote tweetContextual commentary+5
Follow authorDirect creator affinity signal+4
Share (native share sheet)+2
Repost (Retweet)+1
Like (Favorite)baseline+0.5
Post clickTapping to expand tweet detail+0.4
URL click (External link)Navigating to linked website+0.2
Photo expansion+0.05
Video playback started+0.05
Video quality view (>5s)+0.05
Quote tweet click+0.05
Unexplored post boostExploration bonus enabled by default in-network+0.02
Continuous reading dwell timeScore per second of sustained reading dwell+0.004

Negative Action Penalties

What drastically reduces score when predicted

Negative ActionLog ScalePenalty Weight
Report postSevere violation signal (468× the like coefficient at equal predicted probability)-234
Mute authorViewer explicitly silences author (about 118× the like coefficient)-58.8
«Not interested in this»Explicit negative feedback in feed (about 86× the like coefficient)-43.2
Block authorHard social cut (about 62× the like coefficient)-31.2
Did not linger (Immediate bounce)User immediately scrolled away without reading-0.02

Logarithmic scale: otherwise a -0.02 bounce penalty would be invisible next to a -234 report penalty.

🧮

Interactive Weight-Equivalent Calculator

Compare public coefficient magnitudes using like weight (+0.5) as the baseline. This is not a reach forecast.

Coefficient-equivalent total:+70 likes
Evidence in Source Code

Public default scoring parameters and penalty definitions.

Open parameters file on GitHub

Post-Scoring Adjustments

Why a High Raw Score Still Doesn't Guarantee #1

Recommendations optimize for the entire feed experience: the algorithm penalizes repetitive posting, applies network distance thresholds, gives trial slots to new creators, and balances topics.

Author Diversity

Author Decay: Consecutive posts decay exponentially

Multiplier = 0.75 × 0.5^(n-1) + 0.25

Post 1100%
Post 262.5%
Post 343.75%
Post 434.375%
Post 529.688%

This is a continuous decay curve, not a hard ban. Post #1 keeps 100%, Post #2 gets 62.5%, Post #3 gets 43.75%, Post #4 gets 34.38%, approaching a floor of 25%.

Network Distance

Out-of-Network posts must clear a 25% higher hurdle

In-Network1.00×Out-of-Network0.75×

Posts from creators you do not follow receive a default 0.75× multiplier, prioritizing relevant content from your existing social graph.

Cold Start Engine

Small-author exploration: potential trial near the 16th ranked score

≤ 1,000Followers ceiling< 1,000Post impressions≈ 16thTest feed slot

When all experiment, rank, freshness, impression, and safety gates pass, the scorer can raise one best eligible original post toward the score at zero-based slot 15. This is not guaranteed placement.

Topic Diversity (DPP)

DPP Algorithm prevents repetitive topic monopolies

AI & TechScienceDesignSpaceAI News
DPP balances relevance with orthogonal semantic distance: AI → Science → Design → Tech → AI.

Determinantal Point Processes (DPP) mathematically balances individual relevance against mutual semantic similarity.

Myths vs Reality

Myth vs What the Code Actually Shows

Separating social media folklore from verified open source code facts.

MYTH

«Likes are the primary goal for reach»

CODE REALITYLikes carry a modest weight of 0.5.At equal predicted probability, the link-copy coefficient (+20.0) is 40× the like coefficient, while reply (+5.0) is 10×. This compares model coefficients, not real-action exchange rates.
MYTH

«Bookmarks are ignored by the algorithm because there's no weight in the formula»

CODE REALITYBookmarks are present in public engagement data, but not as a separate default linear coefficient.The release includes bookmark events, counts, and engagement hydration. It does not publish a complete causal path from one bookmark to Phoenix embeddings or guaranteed additional reach.
MYTH

«External links will kill your reach»

CODE REALITYURL clicks carry a positive weight of +0.2 in the scorer.While pure in-app post expansion is +0.4, external link clicks still contribute positively. Quality external links don't get banned.
MYTH

«Posting 10 times a day multiplies your chances»

CODE REALITYAuthor Decay heavily suppresses rapid subsequent posts.Your 2nd post in the pool gets a 0.625× multiplier, and the 4th gets 0.34×. Spreading out standalone quality thoughts performs far better.
MYTH

«Replying to viral accounts exposes you to their audience»

CODE REALITYOut-of-network replies are filtered out before ML scoring.The OON Retweet & Reply Filter drops replies from non-followed accounts immediately from recommendation pipelines.
MYTH

«Safety filters just dock a few score points»

CODE REALITYVisibility Filtering is a hard gatekeeper after ranking.If a post triggers a Drop policy, it is completely removed from recommendations, regardless of how high its engagement score was.
MYTH

«Hashtag stuffing guarantees topic categorization»

CODE REALITYPhoenix uses dense neural text embeddings, not keyword matching.Semantic understanding comes from the entire sentence context and SimClusters embeddings, rendering hashtag spamming obsolete.

Practical growth system

Build the Next Growth Lever—not Just a Bigger Number

Follower count is not a public ranking weight. Use these ranges to locate your current constraint, then move on when you have the proof for the next stage. Each plan is designed for your next ten standalone posts—not as a promise of reach.

Real threshold in code≤ 1,000

The code has one threshold. The other ranges are navigation.

The public defaults set both the author follower cap and the post impression threshold at 1,000. An eligible standalone original or quote post can be considered by the cold-start scorer. The 0–100, 101–500, and 501–1,000 ranges are planning bands, not extra ranking thresholds.

Real threshold in code Practical navigation

Eligibility only puts one qualifying candidate in position for a possible test. It still needs enough initial rank, the right experiment and corpus conditions, freshness, visibility, and a strong viewer-specific prediction.

Account stage0–100

Prove Why Someone Should Follow

01 · Clarity
What is holding growth back

A new reader cannot tell in a few seconds who the account is for or why they should come back.

Proof to build at this stage

One clear promise, three repeatable subject areas, and the first substantive responses from intended readers.

Do not optimize yet

Posting volume, broad topic coverage, and viral benchmarks.

Three jobs at this stageEarn the proof before adding scale
Promise

Audience → problem → useful outcome in one sentence.

Proof

Ten standalone posts built around real questions.

Conversation

Useful replies that bring the right people back.

Plan for the next ten posts

5 actions
  1. 01
    Write the promise in one line

    Use: “I help [audience] solve [problem] through [kind of value].” Make the bio, pinned post, and recent feed support the same sentence.

    Practical inferenceBasis for this advice

    A follow decision is easier when the post and profile promise the same result. This is an editorial strategy, not a ranking coefficient.

  2. 02
    Build a bank of 15 real questions

    Collect the exact language from conversations, search, comments, and people in the niche. Each question should be specific enough to become a standalone post.

    Practical inferenceBasis for this advice

    A concrete question anchors the post in an observed need instead of a guessed topic.

  3. 03
    Run a ten-post original sprint

    Use three shapes: error teardown, evidence-led observation, and short instruction. Give every post its own context, claim, and payoff.

    Public codeBasis for this advice

    The cold-start path excludes replies and reposts. A standalone original or substantive quote post has the clearer route to an unfamiliar viewer.

  4. 04
    Use replies as audience research

    After publishing, find several discussions around the same problem and add a fact, example, or clarifying question. Save the language that earns substantive replies.

    Practical inferenceBasis for this advice

    Replies can build relationships and reveal audience language, but they do not automatically expose you to a large author’s audience.

  5. 05
    Review the batch—not one lucky post

    For each of the ten posts, record subject, shape, substantive replies, shares, profile visits, and follows. Decide only after several attempts.

    Public codeBasis for this advice

    The public scorer combines many predicted actions. One like spike or impression spike does not prove a durable format.

How to run the cycle
Collect

Choose three questions from one audience and one shared problem.

Publish

Answer them completely in three different post shapes.

Review

Record who responded and which action repeated.

Move to the next stage whennew readers understand the account promise, and one post shape has twice produced substantive replies, shares, or follows.
Where this logic comes from5
Open-source defaultsThe two 1,000 thresholds

The published defaults set the author follower cap and the eligible post impression threshold to 1,000, with cold-start enabled by default in this snapshot.

Open-source codeSmall-author cold-start path

Eligibility excludes replies and reposts, checks the follower cap and impression threshold, then promotes only the best eligible candidate when the remaining gates pass.

Open-source codeReplies serve relationships, not broad OON discovery

The For You pipeline removes out-of-network replies and reposts before scoring. Original standalone posts have a clearer route to non-followers.

Official X guidanceConversation builds community

X recommends useful replies, questions, listening, and a recognizable human voice for relationship-building—not automated reply volume.

Official X guidanceTest concise, conversational creative

X advises concise copy, restrained hashtags, clear calls to action where useful, accessible media, and repeated testing against real response.

Practical Implications

How to Guarantee You Won't Get Reach

Not a get-rich-quick blueprint. These are mechanical consequences derived directly from the codebase logic.

01Confirmed by Code

Publishing rapid-fire bursts of posts

The author's 2nd post in the current candidate pool receives a 0.625× multiplier, 3rd gets 0.4375×, 4th gets 0.34375×.

What to do instead:Avoid flooding the same candidate window with overlapping standalone posts; the code does not publish a guaranteed time interval.
Evidence in Source Code

Code snippet verifying this architectural behavior.

Open source reference on GitHub
02Confirmed by Code

Relying on reply-guy growth hacks

Replies and reposts from accounts outside the viewer's network are filtered out before scoring in this pathway.

What to do instead:To reach audiences beyond your follower graph, publish original standalone posts that make complete sense on their own.
Evidence in Source Code

Code snippet verifying this architectural behavior.

Open source reference on GitHub
03Confirmed by Code

Provoking mutes, blocks, and reports

Phoenix explicitly predicts negative reactions, and public penalty weights (-234 for reports, -58.8 for mutes) overpower hundreds of positive likes.

What to do instead:Build engagement around genuine insight or entertainment rather than deceptive rage-bait that prompts user reports.
Evidence in Source Code

Code snippet verifying this architectural behavior.

Open source reference on GitHub
04Confirmed by Code

Banking on old posts staying in circulation

The primary candidate pipeline for For You hard-filters all posts older than 48 hours.

What to do instead:Reintroduce evergreen insights as refreshed standalone posts when relevant to current discussions.
Evidence in Source Code

Code snippet verifying this architectural behavior.

Open source reference on GitHub
05Cautious Takeaway

Optimizing exclusively for raw clicks

A click carries a modest weight of 0.4. Immediate bounces (-0.02) and lack of follow-through engagement yield weak overall scores.

What to do instead:Target meaningful follow-through: deep reading dwell time, link shares, quotes, and author follows.
Evidence in Source Code

Code snippet verifying this architectural behavior.

Open source reference on GitHub
06Cautious Takeaway

Hunting for a single magic algorithm hack

Downstream from the ML model, DPP diversity, safety policies, dynamic A/B experiments, and anti-gaming heuristics all take effect.

What to do instead:Focus on clarity and genuine value for your specific niche audience rather than trying to game a single metric.
Evidence in Source Code

Code snippet verifying this architectural behavior.

Open source reference on GitHub

Executive Summary

If You Only Remember Five Concepts

The core architectural rules of the open source recommendation engine distilled into 5 key principles.

01
Relevance is personalized

The exact same post produces completely different predictions for different viewers based on their active interest vectors.

02
Freshness is table stakes

Candidate eligibility strictly expires after 48 hours in the primary recommendation pipeline.

03
Sharing vastly outweighs likes

A single link copy (+20.0) contributes as much score as 40 individual likes (+0.5).

04
Original posts travel; replies don't

Out-of-network replies are filtered out, while original standalone posts remain eligible to reach global audiences.

05
Ranking and safety are separate

Candidates compete on weighted ML scores first, but independent visibility rules can still drop posts before rendering.

Scope & Transparency

Open Source Gives a Map, Not an X-Ray of Production

Understanding the boundaries between the public repository snapshot and live production servers.

What is genuinely open

  • Home Mixer pipeline architecture and core defaults
  • Phoenix training code and serving engine
  • Thunder, SimClusters, VMRanker, and DPP diversity algorithms
  • Visibility Filtering and safety label registries
  • Synthetic datasets, unit tests, and reference parameters
?

What is not published

  • Production user graph data and live trained model checkpoints
  • Internal cluster orchestration and real-time telemetry
  • Live A/B experiment parameter overrides and cohort assignments
  • Grox system prompts and proprietary anti-bot rules
  • Any tool that can calculate a guaranteed real-world impression score
Honest Conclusion

We can understand the exact mechanics, pipeline stages, and public defaults. We cannot promise «do X and get Y impressions»: the model is deeply personalized, parameters are subject to dynamic experimentation, and anti-abuse safeguards remain closed.

Mastery Check

How Well Do You Understand the X Algorithm?

Test your comprehension with 10 challenging, real-world questions grounded directly in the open-source codebase. Review your results with in-depth technical breakdowns.

Questions Answered: 0 / 100%
Q1Candidate SourcingHard
Single choice

What is the primary architectural responsibility of Phoenix in the candidate generation phase (~1,500 total candidate posts)?

Q2Scoring WeightsIntermediate
Single choice

According to the public scoring weights table in the repository, which positive user engagement signal carries the highest mathematical coefficient?

Q3Negative PenaltiesHard
Select all that apply

Which of the following statements regarding negative ranking signals and penalties in the open-source algorithm are ACCURATE? (Select all that apply)

Q4Author DecayExpert
Single choice

If an author has multiple high-scoring tweets selected for the same user's feed session, how does the Author Diversity Decay formula (0.75 × 0.5^(position-1) + 0.25) modify their scores?

Q5Heuristic FilteringHard
Select all that apply

Which candidate posts are completely DROPPED by the Heuristic Filtering stage before Heavy Ranker neural scoring takes place? (Select all that apply)

Q6Topic Diversity (DPP)Expert
Single choice

Why does the Re-ranking stage execute a Determinantal Point Process (DPP) algorithm on scored candidate posts?

Q7Network CalibrationHard
Single choice

Why does the scoring formula apply an Out-of-Network scaling factor (~0.75×) to candidate posts from non-followed accounts?

Q8Myths vs RealityHard
Select all that apply

Based on what the open-source code actually demonstrates, which of the following common beliefs are FALSE MYTHS? (Select all that apply)

Q9Pipeline ArchitectureExpert
Single choice

Why does the candidate generation phase only return compact 64-bit Tweet IDs, deferring full tweet text, media data, and creator trust vectors to the Hydration stage?

Q10Codebase BoundariesIntermediate
Single choice

Which of the following critical components is NOT published in the open-source xai-org/x-algorithm repository?

Primary Code References8 pinned references to commit a389166