GitHub Repos advanced 3 min read May 18, 2026 · Updated May 19, 2026
Public Preview Sign in free for the full digest →

X's Ranking Algorithm Is Public

“A 'report' costs −369 points; a 'like' earns +0.5 — X's feed algorithm penalizes outrage 738× harder than it rewards positivity, and the full weight table is now public code.”

X's Ranking Algorithm Is Public
1 Views
0 Likes
0 Bookmarks
Source · github.com

“"We know this algorithm is dumb and needs major improvements, but at least you can see us struggling to improve it." — Elon Musk (source: basenor.com, fetched 2026-05-18)”

You know that feeling when a social feed surfaces content you reported last week, and the company's only explanation is 'our algorithm thought you'd like it'? Until this repo, every major social platform kept its ranking logic proprietary. If you wanted to build a recommendation system, you worked from academic papers and behavioral experiments — no ground truth. This codebase gives you the first public look at a production social feed pipeline: a four-component system whose engagement weight table, filter stages, and transformer attention mask are now all readable.

recommendation-systemrustmachine-learningopen-sourcesocial-mediatransformerjax

Every time you open X, Home Mixer fires a request that pulls candidates from two parallel sources: Thunder retrieves posts from accounts you follow using a Kafka-fed in-memory store with sub-millisecond lookups, while Phoenix retrieval uses a two-tower embedding model to find out-of-network posts that match your interest profile via dot-product similarity. Both batches get enriched with metadata, then filtered for duplicates, old posts, and blocked authors. Surviving candidates go into Phoenix's ranking transformer — a Grok-1-derived architecture that scores each post in isolation: no candidate attends to other candidates in the batch, only to your history and context. The model simultaneously predicts 19 engagement types and combines them with asymmetric weights (a 'report' costs −369 points; a 'like' earns +0.5). The ranked list exits via gRPC.

01
Candidate isolation in the ranking transformer — each post's score is computed independently of all other posts in the batch, making scores deterministic and cacheable server-side so X can reuse them across requests without re-running the ...
02
Multi-task engagement prediction — Phoenix simultaneously predicts 19 action types (replies, reposts, bookmarks, reports, 2-minute link dwell time, and more) in a single inference pass using a shared transformer backbone with per-action ou...
03
Asymmetric negative signal weighting — a 'report' carries −369 weight versus +0.5 for a 'like', penalizing outrage-bait 738× harder than it rewards positive engagement; the ranking optimizes for long-term retention over short-term click vo...
04
Two-tower retrieval with dot-product similarity — user and candidate embeddings are computed separately and matched via nearest-neighbor search, so retrieval over millions of posts scales without a full cross-attention pass over the entire...
05
Composable Rust trait pipeline — Sources, Hydrators, Filters, Scorers, and Selectors are implemented as swappable traits in the candidate-pipeline module, so you can replace or extend any stage without rewriting orchestration logic
06
Grok-1-derived transformer backbone — the ranking model reuses xAI's open-source transformer architecture with a custom attention mask for candidate isolation, giving a documented path from an open-weight foundation model to a production r...
07
Runnable mini model checkpoint — Phoenix ships with a 4-layer, 128-dimension checkpoint and a ~537k-post sports demo corpus so you can run retrieval and ranking end-to-end locally without building any training infrastructure
Who it’s for

If you're an ML engineer designing a recommendation pipeline, this gives you a concrete reference for candidate isolation, multi-task engagement scoring, and the Rust/Python serving split — all non-obvious design choices that are well-documented here. If you're a backend engineer curious how high-throughput ranking pipelines are structured in Rust, the composable trait-based candidate pipeline is worth a read. This is not useful yet if you need a production-ready recommendation library: the released weights are a mini checkpoint trained on a demo corpus, training infrastructure is absent, and...

Worth exploring

Worth reading if you're designing a recommendation pipeline and want a concrete production reference for candidate isolation, multi-task scoring, and the Rust/Python serving boundary. The May 15 update makes it experimentally runnable for the first time, lowering the barrier from architecture reading to hands-on study. Not worth adopting in production: the checkpoint is a 4-layer, 128-dim mini model against a demo corpus, production weights are absent, the single CI-agent contributor signals no external contribution path, and there are no versioned releases.

Developer playbook
Tech stack, code snippet, sentiment, alternatives.
PM playbook
Adoption angles, user fit, positioning.
CEO playbook
Traction signals, ROI, build vs buy.
Deep-dive insight
Full long-form analysis, no fluff.
Easy mode
Core idea, fast — when you need the gist.
Pro mode
Technical nuance, edge cases, tradeoffs.
Read the full digest
Go beyond the preview

Deep-dive insight, Easy and Pro modes, plus action playbooks — the full breakdown is one tap away.

Underrated tools. Unfiltered takes.

Read the full digest in the Snaplyze app for deep-dive insight, Easy and Pro modes, and the playbooks you can actually use.

Install Snaplyze →