X Algorithm Explained: Ranking Weights From the Source Code

The X algorithm ranks your For You feed by predicting how likely you are to like, reply, share or report each post, then adding those predictions up with fixed weights. X publishes that code, weights included. We read it line by line at the October 27, 2026 commit, and this guide quotes every number from it, explains what that commit changed, and checks the Twitter algorithm claims going viral this week against the source.
Last updated October 28, 2026. Every weight and rule below is quoted from X's open-source repository at commit 2f25214, pushed October 27, 2026 at 01:28 UTC, with line numbers so you can check them yourself. We rechecked against the next commit, 5ed7963 (October 28, 02:49 UTC): it changed no ranking weight. X's own Help Center and posts by X staff fill in what the code leaves out.
How does the X algorithm work?
For each request, X collects candidate posts, predicts your reaction to each one, scores them and filters the result. Candidates come from accounts you follow (a system called Thunder) and from accounts you do not follow (Phoenix retrieval, SimClusters and a popular-posts list). The Phoenix model predicts the probability of each action, and the score is the sum of each weight times its predicted probability. Posts older than 48 hours are dropped before scoring.
What changed in the X algorithm on October 27?
No ranking weight changed. We diffed the October 27 commit against the one before it. It synced production settings dated October 26 at 16:00 UTC, put a test model (Experiment19) on 30% of shadow traffic, and flipped VMRankerSendDebiasInputs from false to true (param.rs line 508). That flag sends X's reranking step seven content features per post: whether it has video, the longest video's length, whether it has photos, the media count, text length, line breaks, and whether it has a link. The step in VMRanker that would use them is still switched off: UserDebiasEnabled defaults to false in vm-ranker/params.rs (lines 255 to 259), and the debias code returns early when it is off.
Does one report cancel hundreds of likes?
No, and X's engineers say so in the code. The weights multiply your predicted probability of each action, not raw counts. The comment block above them (param.rs lines 319 to 346) calls the reading "one report cancels 468 likes" incorrect, and notes a report is more than 1,000 times less likely than a like. That is exactly the claim this post spread on October 27:
https://x.com/b1rkh0ff/status/2114987434513408161
Does the X algorithm only boost paid accounts?
Not in the For You ranking code, but Premium does count for replies. We searched the scoring, filtering and reranking code at the October 27 commit and found no weight or multiplier for X Premium or verification. X's Help Center, though, says that when it ranks replies under a post it considers whether the replier is an X Premium subscriber. So paid accounts get a lift in reply threads, which the For You code does not cover. The question keeps coming up on Reddit:
https://www.reddit.com/r/Twitter/comments/1vcqzog/does_the_twitter_algorithm_only_give_reach_to/
X algorithm ranking weights, from the code
These are the X algorithm weights exactly as they appear in home-mixer/params/param.rs at commit 2f25214, from FavoriteWeight on line 348 down to ReportWeight on line 460. A positive weight raises a post's score when the model predicts you will take that action; a negative weight lowers it. Read each weight alongside how often the action happens: reports are so rare that they need a large weight to move the score at all.
| Predicted action | Weight |
|---|---|
| Share via copy link | 20.0 |
| Reply | 5.0 (plus 15.0 boost if you and the author follow each other) |
| Quote | 5.0 |
| Share via DM | 5.0 |
| Follow the author | 4.0 |
| Share | 2.0 |
| Repost | 1.0 |
| Like | 0.66 |
| Click dwell time (continuous) | 0.4 |
| Click | 0.3 |
| Open link | 0.2 |
| Photo expand, dwell | 0.05 each |
| Video open | 0.02 |
| Dwell time (continuous) | 0.006 |
| Profile click, video quality view | 0 |
| Not dwelled | minus 0.02 |
| Block author | minus 31.2 |
| Not interested | minus 52.272 |
| Mute author | minus 58.8 |
| Report | minus 234 |
When did the X algorithm weights last change?
On October 14, 2026, when X raised the like weight to 0.66. We replayed all 48 commits that touched param.rs since the synced file first appeared on August 13, 2026, and pulled out every change to a ranking weight:
| Date | Commit | Weight change |
|---|---|---|
| August 25 | 0d3cdd8 | Dwell 0 to 0.05; video open 0.05 to 0.07; video quality view 0.05 to 0 |
| September 29 | a707cc2 | Click 0.4 to 0.3; click dwell time 0 to 0.4; not interested minus 43.2 to minus 47.52 |
| October 7 | 78460ca | Post unexplored 0.02 to 0.015 |
| October 13 | e1a0375 | Like 0.5 to 0.6; video open 0.07 to 0.02; dwell time 0.004 to 0.006 |
| October 14 | 17c96bf | Like 0.6 to 0.66; not interested minus 47.52 to minus 52.272 |
Commits from October 15 to October 28 changed none of these weights; they only added new settings, such as weights for the video carousel. The mutual-follow reply boost predates the synced file: X's own write-up in the repository shows it was tested from July 10, 2026, launched at 20 on July 13, and cut to 15 on July 24. X's head of product announced it the day it launched:
https://x.com/nikitabier/status/2076747704248758617
How the For You feed is built, step by step
- Query hydration. X loads your recent engagement history, which the README calls the main input to the model, plus who you follow, block and mute, your muted keywords and posts you have already seen.
- Candidate sources. Thunder returns recent posts from accounts you follow. Phoenix retrieval, SimClusters and a popular-posts list add posts from accounts you do not follow.
- Candidate hydration. Each post gets its text, media, author details, labels and engagement counts.
- Pre-scoring filters. Duplicates, posts older than 48 hours, your own posts, blocked or muted authors, muted keywords, already-seen posts, and replies and reposts from accounts you do not follow are removed.
- Scoring. Phoenix predicts each action, the weights combine them, then three adjustments apply: repeated authors decay, posts from outside your network are discounted, and new authors get a boost.
- Reranking and selection. A separate service, VMRanker, reorders posts so neighbours are less alike, and the top-scoring posts are kept.
- Visibility filtering. After ranking, a safety system can still drop a post, or show it behind a notice or interstitial, based on labels.
- Blending. Ads, Who to Follow and prompts are inserted around the ranked posts.

The For You pipeline in the X algorithm, simplified from the README at commit 2f25214.
Viral X algorithm claims, checked against the code
| Claim | What the code says |
|---|---|
| "A single report is worth minus 355 likes" | Wrong reading. Weights apply to predicted probabilities, and the code's own comment rejects count equivalences like this one |
| "Copying the link is worth about 30 likes" | Wrong reading for the same reason. The copy-link weight is 20.0 against 0.66 for a like, but both multiply probabilities |
| "Your post has 48 hours" | True for For You. The AgeFilter drops posts older than 48 hours before scoring |
| "Replies only reach people who follow you" | Partly true. Replies from accounts a viewer does not follow are filtered out of that viewer's For You feed; replies under a post are ranked separately |
| "Bookmarks do nothing" | Half right. Bookmarks have no ranking weight, but ClientTweetBookmark is listed as a positive engagement in viewer_history.rs (line 30), the history the model reads |
| "A like is worth 0.5" | Outdated since October 13. The like weight was 0.5 until commit e1a0375 raised it to 0.6, then 0.66 on October 14. 0.5 survives as the fallback default in vm-ranker/params.rs (line 3) |
| "X ranks posts with a Heavy Ranker" | Outdated. The heavy ranker belongs to Twitter's 2023 release (the twitter/the-algorithm repository); the current For You feed is ranked by the Phoenix model |
How do I fix my X algorithm?
Retraining your feed works through the same inputs the code reads:
- Engage with what you want more of. Your recent likes, replies, reposts, bookmarks and follows are the main input to the ranking model.
- Use Not interested on posts you do not want; it is one of the weighted negative actions, at minus 52.272.
- Mute, block, or add muted keywords. Those posts are filtered out before scoring ever starts.
- Use the Following tab when you want only accounts you follow. X's Help Center confirms it shows posts from only those accounts.
How to measure whether an algorithm change affected you
The code tells you what changed; your own numbers tell you whether it mattered to you. Take a daily snapshot of your recent posts' metrics and compare before and after a commit date. GetXAPI's user tweets endpoint returns views, likes, replies, reposts, quotes and bookmarks for about 20 recent posts per call, at $0.001 per call.
import csv
import os
from datetime import datetime, timezone
import requests
API_KEY = os.environ["GETXAPI_KEY"]
FIELDS = ["viewCount", "likeCount", "replyCount", "retweetCount", "quoteCount", "bookmarkCount"]
def snapshot(username, out="post_metrics.csv"):
r = requests.get(
"https://api.getxapi.com/twitter/user/tweets",
params={"userName": username},
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=30,
)
r.raise_for_status()
taken = datetime.now(timezone.utc).isoformat(timespec="seconds")
new_file = not os.path.exists(out)
with open(out, "a", newline="", encoding="utf-8") as f:
w = csv.writer(f)
if new_file:
w.writerow(["taken_at", "post_id", "created_at"] + FIELDS)
for p in r.json()["tweets"]:
w.writerow([taken, p["id"], p["createdAt"]] + [p.get(k) for k in FIELDS])
snapshot("your_handle")
What we tested: on October 28, 2026 we ran this against @nikitabier and it wrote 22 posts with all six metrics in one call; his October 26 post showed 120,478 views. Run it daily with cron, and watch the repository's commit list for the date of the next change.
What this code does not tell you
- When the reranker will use the new inputs. The October 27 change sends content features to VMRanker, but the debias step is off in the published defaults. That setting lives in vm-ranker/params.rs, which is not marked as synced from production, so a production override would not show in the repository.
- Unpublished pieces. X holds back some rule files and the prompts of its Grox classifiers to limit gaming.
- Your personal ranking. Every viewer's predictions differ, so the same post scores differently for each person.
- Replies under a post, search and the Following tab. This repository covers the For You feed. Reply ranking is where X's Help Center says Premium counts.
Sources
- xai-org/x-algorithm README at commit 2f25214 (pipeline, filters, scoring formula, notable updates)
- home-mixer/params/param.rs at commit 2f25214 (ranking weights, lines 319 to 460)
- Diff of the October 27, 2026 commit (6258a15 to 2f25214)
- home-mixer/scorers/vm_ranker_debias_payload.rs (the debias inputs switched on October 27)
- vm-ranker/params.rs at commit 2f25214 (fallback weight defaults, UserDebiasEnabled off, lines 3 and 255 to 259)
- vm-ranker/scoring/debias.rs (the debias step returns early when UserDebiasEnabled is off)
- Diff of the October 28, 2026 commit (2f25214 to 5ed7963): no ranking weight changed
- Commit history of home-mixer/params/param.rs (every weight change since August 13, 2026)
- home-mixer/util/viewer_history.rs (bookmarks as a positive engagement in viewer history)
- docs/BIDIRECTIONAL_BOOST_CHANGE.md (how the mutual-follow reply boost rolled out)
- X Help Center: About your For you timeline on X (reply ranking and X Premium)
- Nikita Bier (X head of product) on X, July 13, 2026: the mutual-follow reply boost
- @b1rkh0ff on X, October 27, 2026: the viral ranking-math post checked in this guide
- Reddit r/Twitter: Does the twitter algorithm only give reach to paid accounts now?
- twitter/the-algorithm README (Twitter's 2023 release, with the heavy ranker)
- GetXAPI docs: User Tweets endpoint (post metrics used in the tracking script)
Checked 2026-10-28.
X algorithm: FAQ
Is the X algorithm open source?
Yes. X publishes the code behind the For You feed at github.com/xai-org/x-algorithm, including the ranking weights, the filters and the Phoenix model training code. A few pieces are held back to limit gaming, such as some rule files and the prompts used by its Grox classifiers.
How often does X update the algorithm?
The repository receives commits most days, mostly syncs of production settings. X says it aims to make experiments running on 10 percent of traffic or more visible in the code. Larger changes are listed under Notable Updates in the README; the latest entry is dated September 18, 2026.
Do replies help a post's reach on X?
A predicted reply carries a weight of 5.0, against 0.66 for a like, and replies between accounts that follow each other get an extra boost of 15.0 at the October 27 commit. Replies and reposts from accounts a viewer does not follow are filtered out of that viewer's For You feed.
Does posting links hurt reach on X?
The weights at the October 27 commit give opening a link a positive weight of 0.2, and no ranking weight penalises links. Since October 27, whether a post has a URL is also sent to X's reranking step as one of its content features; the published code does not say how the reranker uses it.
Is shadowbanning in the X algorithm?
Visibility limits live in a separate system the repository also publishes: visibility filtering decides per post and viewer whether to show it, show it behind a notice or interstitial, or drop it, based on labels other systems apply. X's Under the Hood page shows the labels applied to your own account and posts.
Originally published on getxapi.com, where it is kept current.
About the author
- GetXAPI is the cheapest Twitter and X API. $0.001 per call returns ~20 tweets ($0.05 per 1,000). Fetch tweets, profiles, followers. No dev account needed.
Comments
Join the discussionNo comments yet. Be the first to comment.




