How the X Algorithm Works: Ranking Weights From the Code
How the X (Twitter) algorithm ranks the For You feed, with every weight quoted from X's open-source code, what changed on October 27, and which viral claims are wrong.

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 UTC, with line numbers so you can check them yourself. 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
UTC, put a test model (Experiment19) on 30% of shadow traffic, and flippedVMRankerSendDebiasInputs 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.
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:
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:
Does the twitter algorithm only give reach to paid accounts now?
from r/Twitter
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 |
The mutual-follow reply boost is the one weight with a public history. 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:
Start building with GetXAPI
$0.05 per 1,000 tweets. $0.10 free credits. No credit card required.
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. The like weight is 0.66 at the October 27 commit |
| "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 |
The cheapest Twitter API. Try it free.
$0.05 per 1,000 tweets. $0.10 free credits. No credit card required.
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
- How the reranker uses the new inputs. The October 27 change sends content features to VMRanker; the published code shows what is sent, not how it is weighted.
- 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)
- 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 October 28, 2026.
X algorithm: FAQ
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.
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.
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.
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.
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.
Check out similar blogs
More guides on the Twitter/X API, scraping, and pricing.
Featured in
Where GetXAPI's data and pricing get cited.
















