$ git clone https://github.com/xai-org/x-algorithm

The New
Open-Source
X Algorithm

On August 13, 2026, xAI released the X algorithm as open source, documenting in detail how the whole system decides what you see. This page is a summary of that drop and a quick reference for anything to do with how X ranks, filters and labels a post.

weights synced 2026-08-12 commit a389166 2,014 files · Rust + JAX + Scala
$ git log --oneline
a389166  2026-08-13  <- this page
0bfc279  2026-05-15
aaa167b  2026-01-20  first drop
$ ls
home-mixer/   phoenix/   grox/
thunder/  simclusters/  vm-ranker/
visibility-filtering/ ...
$
// THE DROP

What August 13 actually released

Three drops so far. The first two showed the plumbing. This one shipped the parts that matter: the production weights, the real model, and the moderation stack.

Timeline

2026-01-20

Initial open-sourcing

Pipeline code, demo model derived from Grok-1. No weights.

2026-05-15

Refresh

Incremental sync of the same scope.

2026-08-13

The real thing

+363k lines: weights, Phoenix training and serving code, the whole labeling stack.

Now public

  • Production scoring weights, auto-synced from prod config (param.rs)
  • Phoenix: real training + serving code (JAX + Rust), with synthetic data to run it yourself
  • Visibility filtering: the full two-tier rulebook
  • Grok classifiers (grox), media models, reputation systems (agatha, bdsm, user-cred-v2)
  • SimClusters + retrieval index machinery
  • Under the Hood transparency tool: x.com/i/under_the_hood

Still withheld

  • The Grok classifier prompts (.j2 templates)
  • Most botmaker spam rules (20 published; rule IDs visibly span past 25,000)
  • Bot-detection thresholds, redacted as the sentinel value 9.99

Stated reason: reduce gameability.

// home-mixer/

One feed load, end to end

Click through the six stages. Ranking decides the order; whether a post can appear at all is a separate system (visibility filtering), fed by labels computed off the request path.

~3,000 sourced
1,200 Thunder + 1,000 retrieval + 800 SimClusters
survive pre-scoring filters
age, seen, muted, OON replies/RTs...
all scored by Phoenix
one forward pass, per viewer
top 50 selected
by final adjusted score
visibility filtering + dedup
per-viewer rules · one branch per thread
35 posts served
+ ads, Who to Follow at slot 6, prompts
// thunder/ · phoenix/ retrieval · simclusters/

Where candidates come from

THUNDER

in-network · up to 1,200

  • In-memory store of the last 48 hours of everyone's posts
  • Read for the accounts you follow, reverse-chronological, unscored
  • Per-author read caps: 50 originals, 30 replies + reposts, 100 videos
PHOENIX RETRIEVAL

out-of-network · up to 1,000

  • Two-tower model: your history becomes one vector, dot product against 10-28M post embeddings
  • Main corpus: posts with at least 1 fav in the last 24h
  • A post is its semantic IDs + author hashes. No post-ID embedding: pure content + author similarity
SIMCLUSTERS

out-of-network · up to 800

  • 145,000 communities computed weekly from the follow graph
  • Seeds: posts you recently engaged with. Returns posts co-liked by the same communities
  • Cluster affinity decays with an 8h half-life; ~8+ favs to register; posts < 48h, score > 0.5

What the model knows about the viewer

behavior
the last 1,024 engagement actions: which post, which author, which action, dwell, hour of day
explicit
last 15 each of favs, replies, reposts, bookmarks, shares
implicit
last 15 each of photo expands and 10s+ video views
profile
country, language, geo from IP, age bracket, stated + inferred gender, installed apps (WhatsApp, Discord, TikTok, Twitch, ChatGPT, Grok...)
Personalization is almost entirely behavioral. No interest tags, no keyword profile, no follower-count feature.

Killed before scoring

AgeFilter
older than 48 hours. A hard wall
OONRetweetReply
replies + reposts from accounts you don't follow: dropped entirely
Seen / Served
anything already seen; last 100 served posts within 10 minutes
MutedKeyword
case-insensitive, contiguous-phrase match
Socialgraph
authors you block or mute, and authors who block you
For You is a 48-hour marketplace, and plain retweets contribute nothing to non-follower reach.
// ranking_scorer.rs, runnable

The Score Lab

The real formula with the real production weights: score = Σ weight × P(action), then the offset, same-author decay and the OON discount, exactly as the code applies them. Drag the probabilities and watch what the feed would do.

SCORE_LAB v1 · weights of 2026-08-12
ENGAGEMENT · P(action) %
ATTENTION
NEGATIVE SIGNALS · P(action) %
FINAL SCORE
0.000
+ 0 positive 0 negative
CONTEXT
Your Nth post in this load
CONTRIBUTIONS
Probabilities here are illustrative; in production Phoenix predicts them per viewer from their last 1,024 actions. Negative weights already price in how rare those actions are.
// home-mixer/params/param.rs

Every weight on the board

Square-root scale so the small ones stay visible. Toggle the mutual-follow condition to see the reply weight jump.

Caveat, straight from the code comment: weights bake in value AND typical propensity. Copy-link is weighted 40× a fav partly because it is ~40× rarer. Directionally: shares > replies > reposts > likes.
// after the sum

Same-author decay, live

multiplier = 0.75 × 0.5k + 0.25

k = how many of your posts rank above this one in the same pool. Pick your post:

100%

Floor is 25%. Your posts compete inside one load; they never stack. Thread dedup then keeps only your best-scoring branch.

The other two adjustments

OON ×0.75
posts from non-followed accounts, AND replies/reposts from followed accounts. Topic feeds: ×0.5
negative floor
a net-negative sum is squashed into a band just above zero (offset 0.001): bad posts sink rather than being excluded by score
cold start
one original from a ≤1,000-follower author (<24h, <1,000 views) gets lifted to slot ~15-16 per eligible load
DPP rerank
a determinantal point process trades a little score for less similarity between neighbors (theta 0.65, top 150)
// docs/BIDIRECTIONAL_BOOST_CHANGE.md

Case study: the mutual-follow boost

Reply weight on original posts from mutual follows. Not replies, not reposts. xAI published this change with full diffs as the template for how future updates will appear.

5.020.04× on the reply term
JUL 10

A/B test starts

Random users get +5, +10, +15 or +20. Most stay at 0.

JUL 13

Shipped at +20

Rolled out broadly after strong early results.

JUL 24

Dialed to +15

World Cup feedback: discussion from non-followed accounts was getting crowded out.

Training wheels for small accounts

  • Cold-start audition: one original per load lifted to slot ~15-16 (author ≤1,000 followers, post <24h, <1,000 views)
  • TAIL index: a retrieval corpus reserved for authors under 1,000 followers
  • Exploration head: posts under 3% follower reach in 24h earn a learned bonus (weight 0.02, in-network)
Launching a new account is mechanically easier than folklore says, if the early posts convert their audition impressions.

Negative feedback, in fav units

118
favs erased by one expected mute
468
favs erased by one expected report
a mute hurts about twice a block
These are per-viewer predictions: the model learns which audiences would mute you. Reach into the wrong crowd poisons distribution while the like counter goes up.
// phoenix-rankall index windows · log scale

OON shelf life: video is a different asset class

How long a post stays a retrieval candidate for people who don't follow you. Originals only: replies, reposts and community posts never enter these indexes. Re-indexing fires when favs cross 1, 2, 4, 8, 16...

32fav · post_creation · tail
24h
1fav (main corpus)
24-48h
imagine (Grok media)
4 days
video (>10s)
up to 30 days
evergreen video
5 YEARS
24h1 week1 month1 year5y
A text or image post is an OON candidate for 1-2 days. A >10s video: up to 30 days, and evergreen video for years. Cutting content to video is a shelf-life decision, and the 10 seconds are strict.
// grox/ · agatha/ · bdsm/ · user-cred-v2/

Grok reads every post

Off the request path, continuously: post published → category screen (10 safety categories) → policy classifiers → labels. The labels come back at serve time as the visibility rulebook.

escalationbigger posts get bigger models+
Posts crossing 128 favs get re-checked by a bigger Grok model; at 1,024 favs, bigger still (adult / violent-media categories). Reach buys scrutiny, never immunity.
the big trapengagement bait is a labeled offense+
Engagement baiting ("reply if / like if / RT if") and engagement farming are classified per post → SPAM_HIGH_RECALL: invisible to all non-followers for the label's duration. High-reputation accounts are not exempt from this one.
repliesGrok scores those too+
A reply scored 0 by Grok gets RiskyHighVizReply for 14 days: demoted in reply ranking. Substantive replies from brand accounts; never drive-by promo.
quality passyes, there is a slop score+
Grox writes tags, topics, isHighQuality and a slop_score per post. The slop_score has no visible consumer in the repo yet: plumbing installed, consequences pending.
reputationfour systems that decide what sticks to you+
agatha: blocks/reports relative to favs received, extreme percentiles (>0.9975) → spam labels. bdsm: a behavior transformer reading raw action cadence, 8 bot archetypes, thresholds redacted. user-cred-v2: PageRank over the follow graph; score ≥54 (fallback >25k followers) exempts you from most automated spam labeling, but never from bait or NSFW labels. Escalation: 3 of your last 5 posts labeled NSFW-high-precision labels the whole account for 7 days.
withheldwhat you can't read+
All classifier prompts (.j2 templates) and most botmaker rules are excluded to reduce gameability. The Under the Hood tool shows the labels on your own account instead: x.com/i/under_the_hood.
// visibility-filtering/rules/registry.rs

The two-tier rulebook

First drop wins and evaluation stops. "Hidden from non-followers" is literally the second tab.

  • Suspended / deactivated authors; viewer blocks and mutes
  • SPAM, PDNA, BOUNCE, the FOSNR family (hateful conduct, violent speech, abuse, civic integrity)
  • Legal takedowns by country; age gating
  • NSFW and gore for followers: shown behind an interstitial, not dropped
  • Any NSFW signal, post-level or account-level
  • SPAM_HIGH_RECALL, DO_NOT_AMPLIFY, MALICIOUS_URL
  • Compromised / impersonation / abusive account labels
  • DMCA and geo-restricted media
The same post stays visible to followers. As a recommendation to strangers, it simply never appears.
// folklore, checked against the source

Myths vs. the code

Click a claim to see what the repo actually says.

// tripwires in the code

HARD NOs

Each of these is a mechanical tripwire in the published code, with the label it fires. Where a reputation exemption exists, the URL panel below spells it out.

Engagement bait, ever

"Reply if / like if / RT if", follow trains, vote-with-a-like. Grok classifies per post and the label hides it from every non-follower. High credibility does not exempt you.

SPAM_HIGH_RECALL

Bought followers or engagement

Credibility is PageRank over the follow graph: mass from low-cred accounts rounds to zero. Meanwhile agatha tracks blocks and reports relative to favs received, so fake numbers push the exact ratios that get you labeled.

AGATHA_SPAM · challenge / suspend

Team engagement in lockstep

The bot detector reads raw action sequences with timing; "engagement amplifier" is one of its eight archetypes. Staggered, organic replies from accounts that behave like humans, or don't bother.

bdsm → enforcement

Drive-by promo replies

Grok scores replies too. A zero lands a 14-day reply demotion, and low-quality links at-mentioning non-followers have their own dedicated spam rule.

RISKY_HIGH_VIZ_REPLY · 14d

Sketchy or shortened URLs, anywhere

URL reputation rules label posts on sight, and a bad link in a pinned post labels the whole account for 7 days. Canonical domains only, especially in pins.

MALICIOUS_URL · DO_NOT_AMPLIFY · account 7d

Copypasta across posts or accounts

Duplicate-text clustering runs on word and character n-grams. Identical captions across your account network get swept together in one pass.

COPYPASTA_SPAM

Grey-zone media on brand accounts

Media models score every image and video. Three NSFW-labeled posts among your last five labels the account for 7 days: everything hidden from non-followers.

account NSFW · 7d

Trading mutes for likes

The formula prices one expected mute at ~118 favs and one report at ~468, predicted per viewer. Rage-reach compounds negatively while the like counter climbs.

-58.8 mute · -234 report

Building a beat around plain retweets

RTs from non-followed accounts are hard-dropped and never indexed for retrieval; even in-network they run at 0.75x. Quote or original, always.

OONRetweetReplyFilter
This list covers what the published code punishes mechanically. Some botmaker rules are withheld; assume the unpublished ones rhyme with these.
// botmaker-rules/scarecrow/bot/ · url_event rules

How X judges your links

Every domain and URL carries a stored reputation grade, like a credit score X keeps for the whole web. When you post a link, the system unwraps it (t.co, then every redirect behind it) into a chain of hops and judges the whole route. The service that assigns grades is not published; the punishments are.

WHITELIST · GOOD

The safe grades. A chain is only clean if its final stop holds one of these.

LOW_QUALITY

Spam-adjacent. Punished in context: bad final stop, @-mention promo, or a pinned post.

BAD

Spam grade. The post is labeled SPAM, and every other post carrying the URL gets swept too.

UNSAFE

The malicious tier: phishing/malware class. Four labels at once, including MALICIOUS_URL.

HOW YOU POST IT
DESTINATION'S GRADE

Exemptions: the at-post-time rules skip high-PageRank accounts (cred score 54+, fallback 25k+ followers) and government-verified accounts. The retroactive sweeps that fire when a grade CHANGES skip nobody.

Your preview image is part of the link

The media models score every link card. An OG image graded near-certain NSFW (0.999+) writes a verdict on the URL itself for 7 days, labeling up to 5,000 posts that carry it. An article can be clean and still get poisoned by its thumbnail.

What to actually do

  • Post the real destination URL (rdy.gg/article), never a shortener: every extra hop is a grade you don't control
  • Keep OG images unambiguous on anything you publish
  • Treat pinned posts as the highest-stakes link slot: that's where a link problem becomes an account problem
// instant levers

Do this today

One-time moves where the mechanism applies the moment you act. None of this rescues weak content: every lever multiplies P(action)s the post itself has to earn.

0 / 10 done
// implications for the day job

The playbook

Ten operating rules derived from the code above. Check off what you already run.

0 / 10 running