Inside the X Recommendation Architecture: How Tweets Travel the Feed
Every time a user opens X (formerly Twitter), the recommendation engine scans through billions of candidates to assemble the personalized For You feed. While creator mythologies claim virality is governed by arbitrary shadowbans, the reality is documented in open-source production code: X relies on a multi-stage machine learning pipeline consisting of Candidate Sourcing, Heavy Ranking, and Heuristic Filtering.
Candidate Retrieval
50% In-Network (accounts followed) and 50% Out-of-Network candidates retrieved via GraphJet and SimCluster vector spaces.
The Heavy Ranker
A multi-head transformer calculates the exact probability of 16 distinct reader actions (replies, shares, bookmarks, blocks).
Visibility Filtering
Heuristic rules strip engagement-bait, deprioritize reply chains, and discount accounts without author diversity.
The Mathematical Formula Behind Tweet Scoring
The final ranking score computed by the Heavy Ranker is a linear combination of predicted action probabilities multiplied by their production weights. Below are the verified parameter weights from home-mixer/params/param.rs:
| Viewer Action | Algorithm Weight | Viewer Action | Algorithm Weight |
|---|---|---|---|
| Share via Copy Link | +20.0 | Post Click / Read More | +0.3 |
| Direct Reply | +5.0 | External Link Click | +0.2 |
| Quote Tweet | +5.0 | Video Open | +0.07 |
| Share via Direct Message (DM) | +5.0 | Photo Expansion | +0.05 |
| New Profile Follow | +4.0 | Dwell Time (per second) | +0.004 |
| Native Retweet / Repost | +1.0 | "Not Interested" Feedback | -47.52 |
| Passive Like | +0.5 | Account Block | -31.2 |
| Dwell Stay (minimum threshold) | +0.05 | Mute Account | -58.8 |
| Quick Scroll-Past Penalty | -0.02 | User Abuse/Spam Report | -234.0 |
Why Dwell Time Decides Immediate Tweet Survival
Before a viewer clicks like or reply, the recommendation algorithm observes dwell time: the milliseconds a viewer pauses while scrolling past your post. If a reader stops for several seconds, the post gains a positive dwell increment (+0.004 per second). Conversely, if thousands scroll past without pausing, the post accumulates negative dwell penalties (-0.02), causing X's candidate engine to suppress further impression allocation.