Pages / #twitter / #for-you-feed
X recommendation algorithm
X's For You timeline gathers posts from accounts you follow and accounts you don't, then ranks them by how likely you are to reply, repost, like or linger.
Score your postInteractive
- Candidates per request (2023)
- About 1,500
- In- vs out-of-network (2023 average)
- 50 / 50
- Reply vs like weight (2026 code)
- 5.0 vs 0.5
- Oldest post considered (2026 code)
- 48 hours
- Ranking model (2026)
- Phoenix, a transformer
- Source code
- github.com/xai-org/x-algorithm
The For You pipeline
In words
Two halves of the pool
2/4
For each request, Twitter said in 2023, it pulls about 1,500 candidate posts from people you follow (in-network) and people you don't (out-of-network) 1. On average the timeline was half and half, though this varied by user 2, and the in-network search index supplied about 50% of posts 3. The 2026 code keeps the split: recent posts from followed accounts, plus posts found by ML retrieval for accounts you don't follow 4.
2 of 4 quotes found in their sources
-
Twitter's Recommendation Algorithm (Twitter Engineering blog, March 2023, archived) web.archive.org
For each request, we attempt to extract the best 1500 Tweets from a pool of hundreds of millions through these sources.
Quote source could not be read -
Twitter's Recommendation Algorithm (Twitter Engineering blog, March 2023, archived) web.archive.org
the For You timeline consists of 50% In-Network Tweets and 50% Out-of-Network Tweets on average, though this may vary from user to user
Quote source could not be read -
twitter/the-algorithm README (GitHub, 2023) github.com
Find and rank In-Network posts. ~50% of posts come from this candidate source.
Quote found in the source -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
It combines in-network content (from accounts the viewer follows) with out-of-network content (discovered through ML-based retrieval and other mechanisms)
Quote found in the source
How a post is scored
6/8
In 2023 the heavy ranker was a neural network of about 48 million parameters 1 whose ten outputs were each the probability of an engagement 2. The 2026 code ranks with a transformer and adds the predictions up as weight times probability 34. A reply is weighted 5.0 against 0.5 for a like 56, and X notes the weights multiply your own predicted probability, not raw counts 7. Posts from accounts you don't follow are then multiplied by a factor below 1 8.
6 of 8 quotes found in their sources
-
Twitter's Recommendation Algorithm (Twitter Engineering blog, March 2023, archived) web.archive.org
Ranking is achieved with a ~48M parameter neural network that is continuously trained on Tweet interactions
Quote source could not be read -
Twitter's Recommendation Algorithm (Twitter Engineering blog, March 2023, archived) web.archive.org
outputs ten labels to give each Tweet a score, where each label represents the probability of an engagement
Quote source could not be read -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
filters content based on a variety of inputs, and ranks posts using a transformer model
Quote found in the source -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
Final Score = Σ (weight_i × P(action_i))
Quote found in the source -
xai-org/x-algorithm home-mixer/params/param.rs (ranking weights, 2026) raw.githubusercontent.com
"rust_home_mixer_reply_weight", 5.0
Quote found in the source -
xai-org/x-algorithm home-mixer/params/param.rs (ranking weights, 2026) raw.githubusercontent.com
"rust_home_mixer_favorite_weight", 0.5
Quote found in the source -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
The weights are a multiple on your own predicted probability of Liking, Reporting, etc, which is substantially driven by your own behavior.
Quote found in the source -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
posts from accounts the viewer does not follow are multiplied by a factor below 1
Quote found in the source
Filters and what X published
4/5
Before scoring, the 2026 pipeline drops duplicates, posts older than 48 hours and the viewer's own posts 1. Whether a post may be shown at all is a separate decision, made by visibility filtering 2. Twitter first released its recommendation code in March 2023 3. xAI's newer repository adds the weights that blend predictions into a score 4, while some spam rules stay private to make the system harder to game 5.
4 of 5 quotes found in their sources
-
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
duplicates across sources · older than 48 hours · the viewer's own
Quote found in the source -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
Ranking decides the order. Visibility filtering decides whether a post can be shown at all.
Quote found in the source -
Twitter's Recommendation Algorithm (Twitter Engineering blog, March 2023, archived) web.archive.org
released the code powering our recommendations
Quote source could not be read -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
Adds key configuration parameters (including weights used to blend predicted action values into a score for a post)
Quote found in the source -
xai-org/x-algorithm README (X For You feed algorithm, 2026) raw.githubusercontent.com
To reduce the risk of gaming to circumvent these systems, some rules aren't currently in this repository.
Quote found in the source