Twitter (X) Algorithm: How the For You Feed Ranks Posts
The Twitter algorithm that builds the For You feed on X (formerly Twitter) gathers posts from accounts you follow and from accounts you don’t, predicts how likely you are to reply, share, like, mute or report each one, weights and adds those predictions into one score, then filters and reorders the result. X publishes this code on GitHub, so this guide is built from X’s own README and ranking parameter file rather than from older summaries. Checked against GitHub: xai-org/x-algorithm (README and repository metadata)
For the same mechanics on other networks, see how social media algorithms work.
Table of Contents
- How does the Twitter algorithm work?
- Which signals does the X algorithm reward and punish?
- What removes a post from the For You feed?
- Is the Twitter algorithm on GitHub? What changed since 2023
- Following vs For You: how do the two timelines differ?
- Does X Premium boost reach in the algorithm?
- Do links hurt reach on X?
- What gets a post’s reach restricted on X?
- How to go viral on Twitter without gaming the algorithm
- Twitter algorithm FAQ
How does the Twitter algorithm work?
For You is assembled fresh for each request from two pools: recent posts from accounts you follow (in-network) and posts X finds elsewhere (out-of-network). One transformer model, reading your recent engagement history, ranks both pools together. Out-of-network posts come from X’s Phoenix retrieval, SimClusters and a shared list of popular recent posts. Checked against GitHub: xai-org/x-algorithm README (Overview)
The model predicts, for every candidate post, your probability of each action: like, reply, repost, quote, share, share via DM or copy link, clicks, dwell time and video watch time, following the author, and negative actions such as “not interested”, mute, block, report and “not dwelled”. It multiplies each prediction by a weight, positive or negative, and sums them into one score. Checked against GitHub: xai-org/x-algorithm README (Scoring and Ranking)
X’s Help Center describes the same job in plain terms: narrowing the roughly 500 million posts it says are made each day down to a handful of top posts for you. Checked against X Help Center: For You Home Timeline RecommendationsArchived copy, 12 October 2026 View the archived copy For who is on the other side of those posts, see how many people use X.
The values in the code track production: X’s README says cron scripts set the defaults in the repository’s code to the primary production values. Checked against GitHub xai-org/x-algorithm: README (Experiments and Configuration)
Which signals does the X algorithm reward and punish?
Shares via copy link or DM, replies, quotes and follows carry the largest positive weights in X’s published parameters; reports, mutes, “not interested” and blocks carry large negative ones. Read the table with X’s own warning first: the weights scale each viewer’s predicted probability of an action, not raw engagement counts, so “one report cancels out N likes” is a misreading. Checked against GitHub: xai-org/x-algorithm README (Notable Updates, 14 Aug 2026; Scoring and Ranking)
| Predicted action | Weight in param.rs | Direction |
|---|---|---|
| Share via copy link | 20.0 | Positive |
| Reply | 5.0 | Positive |
| Quote | 5.0 | Positive |
| Share via DM | 5.0 | Positive |
| Follow the author | 4.0 | Positive |
| Share (generic) | 2.118 | Positive |
| Repost | 1.0 | Positive |
| Like | 0.708 | Positive |
| Click | 0.274 | Positive |
| Open a link | 0.2 | Positive |
| Not dwelled | -0.02 | Negative |
| Block the author | -31.2 | Negative |
| ”Not interested” | -53.07 | Negative |
| Mute the author | -58.8 | Negative |
| Report | -234.0 | Negative |
Weights are read from X’s param.rs; the stamps give the date we checked the file. Positive weights: Checked against GitHub xai-org/x-algorithm: home-mixer/params/param.rs Negative weights: Checked against GitHub xai-org/x-algorithm: home-mixer/params/param.rs
Two code comments explain the extremes. Reports weigh so much because their baseline probability is more than 1,000 times lower than a like’s; without the large weight the prediction could not move the ranking at all. Checked against GitHub xai-org/x-algorithm: home-mixer/params/param.rs (code comment) And mass blocking or reporting by bad actors does not significantly suppress a post, X says, because ranking predicts each viewer’s own likelihood, and only actions on posts served in the Home timeline count: navigating to a post directly has no ranking effect. That comment covers ranking only, not the separate visibility system. Checked against GitHub xai-org/x-algorithm: home-mixer/params/param.rs (code comment)
One dated change sits on top of the reply weight. X began A/B testing a “bidirectional follow” boost on 10 July 2026, which raises the weight on your predicted reply to an original post from someone you mutually follow. It rolled out a value of 20 to many users on 13 July and set it to 15 on 24 July 2026. Checked against GitHub xai-org/x-algorithm: docs/BIDIRECTIONAL_BOOST_CHANGE.md
What removes a post from the For You feed?
Before scoring, X filters out posts older than 48 hours, posts you have already seen, your own posts, posts with your muted keywords and posts from accounts you block or mute. After scoring, adjustments, a reorder step and a separate visibility system can still move or drop a post.
Filters listed in X’s README:
- Age: posts older than 48 hours are removed from For You candidates. Checked against GitHub xai-org/x-algorithm: README (Filtering)
- Viewer filters: your own posts, posts already shown or served earlier in the session, posts matching your muted keywords, posts from accounts you block or mute, and reposts and replies from accounts you don’t follow. Checked against GitHub xai-org/x-algorithm: README (Filtering)
- New accounts: for new accounts, out-of-network posts below an engagement threshold are removed. X doesn’t say whether “new” means the viewer or the author, or what the threshold is. Checked against GitHub xai-org/x-algorithm: README (Filtering)
- Out-of-network rules: extra visibility rules apply only when a post is recommended to someone who doesn’t follow the author. They can only drop a post, and the same post is still allowed to a follower. Checked against GitHub xai-org/x-algorithm: README (Filtering)
- Holdouts: one filter removes a configured percentage of posts, another a percentage set by each post’s like count, chosen deterministically per post and viewer. X gives no percentages. Checked against GitHub xai-org/x-algorithm: README (Filtering)
After scoring, three adjustments apply: an author-diversity factor that decays each additional post from the same author, a discount for posts from accounts you don’t follow, and a boost toward a target position for authors with few impressions. Checked against GitHub: xai-org/x-algorithm README (Scoring and Ranking) A separate VMRanker service then reorders the result, so the weighted score is not the final word on order. Checked against GitHub xai-org/x-algorithm: README (Scoring and Ranking)
Last, ranking and visibility are different systems: ranking sets the order, while visibility filtering decides whether a post can be shown at all, using your blocks and mutes and labels attached to posts and accounts. Checked against GitHub: xai-org/x-algorithm README (Overview; Key Design Decisions)
Is the Twitter algorithm on GitHub? What changed since 2023
Yes. X’s current For You code is in the xai-org/x-algorithm repository on GitHub, created on 19 January 2026 under the Apache 2.0 licence, with dated “Notable Updates” in its README. Checked against GitHub: xai-org/x-algorithm (README and repository metadata) The 2023 release is history: treat any number from it as superseded.
| When | What changed | Source |
|---|---|---|
| 31 March 2023 (historical) | Twitter published an explanation of its For You algorithm and released the code, saying the goal was full transparency. | Checked against Twitter Engineering blog: Twitter's Recommendation Algorithm (archived)Archived copy, 5 December 2023 View the archived copy |
| 2023 (historical) | Three steps: fetch about 1,500 candidates from hundreds of millions, rank them with a machine-learning model, then apply heuristics and filters. | Checked against Twitter Engineering blog: Twitter's Recommendation Algorithm (archived)Archived copy, 5 December 2023 View the archived copy |
| 2023 (historical) | For You was on average half in-network, half out-of-network, varying by user. The 2026 code gives no split. | Checked against Twitter Engineering blog: Twitter's Recommendation Algorithm (archived)Archived copy, 5 December 2023 View the archived copy |
| 2023 (historical) | Ranking used a neural network of about 48 million parameters; the 2026 code ranks with a transformer model instead. | Checked against Twitter Engineering blog: Twitter's Recommendation Algorithm (archived)Archived copy, 5 December 2023 View the archived copy |
| 19 January 2026 | xai-org/x-algorithm repository created. | Checked against GitHub: xai-org/x-algorithm (README and repository metadata) |
| 10 to 24 July 2026 | Bidirectional follow boost tested, rolled out at 20, then set to 15. | Checked against GitHub xai-org/x-algorithm: docs/BIDIRECTIONAL_BOOST_CHANGE.md |
| 13 August 2026 | Release adds the configuration parameters (including the weights), the For You filtering systems, Phoenix training code and SimClusters as an out-of-network source. | Checked against GitHub xai-org/x-algorithm: README (Notable Updates, August 13th, 2026) |
| 14 August 2026 | Brazil2026ElectionFilter added under Brazilian electoral law; removed on 26 October 2026 after the elections. | Checked against GitHub xai-org/x-algorithm: README (Notable Updates) |
| 18 September 2026 | ”Under the Hood” reports also show whether visibility was limited to comply with law, and in which country. | Checked against GitHub xai-org/x-algorithm: README (Notable Updates, September 18th, 2026) |
| 8 and 13 October 2026 | Ranking model changed to better estimate time spent on each post; retrieval trained to surface posts people read all the way through. | Checked against GitHub: xai-org/x-algorithm README (Notable Updates) |
Not everything is public. X says it withholds a limited set of files to reduce gaming, such as its LLM prompts and some rule files, and it is piloting the “Under the Hood” tool that shows people the visibility-limiting labels on their own account and posts. Checked against GitHub: xai-org/x-algorithm README (What's not in this repo?) X also runs experiments on a small share of traffic and aims for those at a notable share, such as 10% or more, to be visible in the repository, so the values you get may differ from the file. Checked against GitHub xai-org/x-algorithm: README (Experiments and Configuration)
Following vs For You: how do the two timelines differ?
Following shows posts only from accounts you follow; For You mixes posts from accounts and Topics you follow with recommended posts, chosen with signals such as how popular a post is and how people in your network interact with it. Checked against X Help Center: About your For you timeline on X (archived)Archived copy, 29 September 2026 View the archived copy
Can you reset your X algorithm?
X’s Help pages on For You describe no reset button. They describe three levers instead: change the accounts and Topics you follow, report content you are not interested in, or switch to Following, which X describes as posts from accounts you follow in reverse chronological order, not personalised. Checked against X Help Center: For You Home Timeline RecommendationsArchived copy, 12 October 2026 View the archived copy Checked against X Help Center: About your For you timeline on X + For You Home Timeline RecommendationsNot verified Instagram works differently: see how to reset your Instagram algorithm.
Does X Premium boost reach in the algorithm?
X publishes no Premium multiplier for For You: its ranking parameter file contains no parameter that names Premium, verification or a blue check. Checked against GitHub xai-org/x-algorithm: home-mixer/params/param.rs (searched for premium / verified / blue) That is one file; reply ranking works elsewhere, and there X names Premium as one factor.
X’s Help Center says that when ranking replies in a conversation it considers factors such as whether the original author replied, whether the reply is from someone you follow, or whether the person is a Premium subscriber. Checked against X Help Center: About your For you timeline on XArchived copy, 29 September 2026 View the archived copy It describes the effect as a slight preference for replies from verified accounts, with the levels still being tested. Checked against X Help Center: About X Premium (How does prioritized ranking work?)Archived copy, 17 November 2026 View the archived copy The plan list matches: “reply prioritization” in Basic, “larger” in Premium and “largest” in Premium+. Checked against X Help Center: About X PremiumArchived copy, 17 November 2026 View the archived copy
Otherwise the tiers add features step by step: Basic includes editing and longer posts, Premium adds the checkmark and reduced ads, and Premium+ adds SuperGrok and no ads in most places. Checked against X Help Center: About X Premium For the full list, see what X Premium includes.
Do links hurt reach on X?
X’s published For You filters list no link penalty, but that is an absence, not a promise. None of the filters in its README targets posts with links, and param.rs gives opening a link a small positive weight (0.2). We found no X statement that links are demoted, but the visibility rules and the reorder service were not audited line by line, so this is an absence, not a promise that links are safe. Checked against GitHub xai-org/x-algorithm: README (Filtering) + param.rsNot verified
What gets a post’s reach restricted on X?
Breaking X’s Authenticity policy can get a post excluded from search, trends and recommended notifications, removed from the For You and Following timelines, and downranked in replies. Checked against X Help Center: AuthenticityArchived copy, 23 September 2026 View the archived copy
The policy bans buying or selling accounts or usernames, follow-for-follow and engagement exchanges, paying to inflate metrics, follow churn, and using or promoting third-party services that do these things. Checked against X Help Center: Authenticity X’s Automation rules allow helpful automated posts through the API but ban non-API automation, such as scripting the X website, which can lead to permanent suspension. Checked against X Help Center: Automation rulesArchived copy, 1 October 2026 View the archived copy
How to go viral on Twitter without gaming the algorithm
Write posts people want to reply to and pass on, publish while your audience is online, and avoid what makes people mute or report you. That is our reading of the published weights above, not an X guarantee:
- Aim for replies, quotes and shares. Shares via copy link or DM, replies and quotes carry the highest positive weights in the table above. Write posts with a point of view people want to answer or pass on, not posts that beg for likes or replies.
- Post inside the 48-hour window. Posts older than that drop out of For You candidates, so timing matters: check the best time to post on X for your audience.
- Keep hashtags to two. X recommends no more than 2 hashtags per post. Checked against X Help Center: How to use hashtagsArchived copy, 1 October 2026 View the archived copy More detail: how many hashtags to use on X.
- Avoid negative signals. Reports, mutes, “not interested” and blocks carry far larger weights than a like, in the opposite direction.
- Fit the post. Check length with the free X character counter before you publish.
- Measure, then adjust. Read your X impressions to see which posts travelled.
Scheduling itself is not a known penalty: no platform documents one for posts published through its official API. Checked against Absence finding across the sources in this ledgerNot verified If you want to schedule posts on X, here is where Outfeed fits.
Plan and schedule your X posts with Outfeed AI
Twitter algorithm FAQ
Is the Twitter algorithm open source?
Yes. The Twitter algorithm is on GitHub: X publishes the code for its For You feed in the xai-org/x-algorithm repository, created in January 2026, with dated notes on changes. Checked against GitHub: xai-org/x-algorithm (README and repository metadata) Twitter first released recommendation code in March 2023. Checked against Twitter Engineering blog: Twitter's Recommendation Algorithm (archived)Archived copy, 5 December 2023 View the archived copy X says it holds back a limited set of files, such as some prompts and rule files, to reduce gaming. Checked against GitHub: xai-org/x-algorithm README (What's not in this repo?)
Does X Premium boost your posts in the For You feed?
X’s published For You ranking parameters contain no Premium or verification weight. Checked against GitHub xai-org/x-algorithm: home-mixer/params/param.rs (searched for premium / verified / blue) X’s Help Center says replies from verified accounts get a slight preference in conversation ranking and that it is still testing how much. Checked against X Help Center: About X Premium (How does prioritized ranking work?)Archived copy, 17 November 2026 View the archived copy
How long does a post stay eligible for For You on X?
X’s published code lists an age filter that removes posts older than 48 hours from the For You feed. Checked against GitHub xai-org/x-algorithm: README (Filtering)
Do links reduce reach on X?
None of the For You filters X lists in its code targets posts with links, and opening a link carries a small positive weight in its published parameters. We found no X statement saying links are demoted. Checked against GitHub xai-org/x-algorithm: README (Filtering) + param.rsNot verified
Which posts appear in Following rather than For You on X?
Following shows posts only from accounts you follow. For You mixes posts from accounts and Topics you follow with recommended posts, chosen with signals such as how popular a post is and how people in your network interact with it. Checked against X Help Center: About your For you timeline on X (archived)Archived copy, 29 September 2026 View the archived copy