R&D intermediate 2 min read Mar 19, 2026 · Updated Apr 1, 2026
Public Preview Sign in free for the full digest →

X open-sourced its new feed algorithm — 0 hand-crafted rules, 100% Grok transformer

“X killed every hand-crafted rule in its feed algorithm. Now it's 100% transformer.”

X open-sourced its new feed algorithm — 0 hand-crafted rules, 100% Grok transformer
9 Views
2 Likes
0 Bookmarks
Source · blog.bytebytego.com

“We have eliminated every single hand-engineered feature and most heuristics from the system. — xAI Engineering Team, x-algorithm README”

You know that feeling when you open a social app and the feed feels random or stale? Traditional recommendation systems rely on hand-crafted rules: boost posts with hashtags, penalize long posts, favor recent content, weight by follower count. Engineers tune these weights manually. The problem: rules break, edge cases multiply, and the system becomes unmaintainable. X's old codebase had hundreds of heuristics baked into the ranking pipeline.

machine-learningrecommendation-systemsrusttransformersopen-sourcexaigrok

Think of it as a two-stage funnel. Stage 1 (Retrieval): A two-tower model encodes you and every post into mathematical vectors. Finding relevant posts becomes a similarity search — your vector dot-producted against all post vectors. Stage 2 (Ranking): A Grok-based transformer predicts 18 different actions you might take (like, reply, block, report). Each action gets a weight, positive for good actions, negative for bad ones. Final score = weighted sum. The clever bit: during ranking, posts can't 'see' each other — they only attend to your context. This makes scores deterministic and cacheable.

01
Two-tower retrieval — why YOU care: Finds relevant posts from accounts you don't follow by computing similarity between your engagement history and all posts. No more echo chamber of just people you follow.
02
Grok-based transformer ranking — why YOU care: Predicts 18 engagement types (like, reply, repost, block, report) instead of a single 'relevance' score. Content you'd hate gets pushed down because 'block' and 'report' carry negative weights.
03
Candidate isolation — why YOU care: Posts can't attend to each other during scoring. A post's score doesn't change based on what else is in the batch. This makes the system deterministic and enables aggressive caching at scale.
04
Zero hand-engineered features — why YOU care: No manual tuning of 'hashtag weight' or 'post length penalty.' The model learns what matters from data. Simpler codebase, fewer bugs, faster iteration.
05
In-memory Thunder store — why YOU care: Posts from accounts you follow are served from memory in sub-millisecond time. No database hits for the hot path. Your feed loads instantly.
06
Composable pipeline architecture — why YOU care: The Rust codebase uses traits for each pipeline stage (source, hydrator, filter, scorer, selector). Add a new data source or swap a model without rewriting the pipeline.
07
Multi-action prediction with weighted scoring — why YOU care: The model predicts probabilities for 18 actions, each with a weight. Positive actions (like, share) boost the score. Negative actions (block, report) tank it. Fine-grained contr...
Who it’s for

If you're building a recommendation system, feed ranking, or any ML-powered personalization — this is production-grade reference code. The architecture patterns (two-tower retrieval, candidate isolation, composable pipelines) apply beyond social media. Not useful if you need a quick tutorial — this is a full production codebase with real infrastructure dependencies.

Worth exploring

Yes — this is rare. A production-scale recommendation system, fully open-sourced, with the actual ML architecture documented. The Rust codebase is clean and the README explains the design decisions. Even if you never run it, the patterns are worth studying. The main gotcha: this is infrastructure, not a library. You can't 'npm install' a feed algorithm. Expect to adapt the architecture, not copy-paste code.

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 →