·

14 min read

What X’s Open Recommendation Code Still Says, Two Years On

What X's Open Recommendation Code Still Says, Two Years On

Somewhere in your feedback channel, someone has probably repeated a claim about how X ranks posts and cited “the algorithm they open sourced” as the reason. Chances are neither of you has opened the repository. The 2023 announcement is the thing everyone remembers. The repository it pointed to is a different object, one that keeps changing underneath that memory, and the two have drifted apart in a way that is easy to check and rarely is.

What shipped in 2023, and what has actually changed since

The 2023 repository is github.com/twitter/the-algorithm, created on 2023-03-27 according to GitHub’s own repository metadata. It is no longer the only one: since 2026-01-19 X has also published github.com/xai-org/x-algorithm, whose README describes it as “the core code that determines which posts a viewer sees in the For You feed on X” (README.md, line 3, commit b220448). It is not a one-time dump a company posted and abandoned, which matters because most secondhand coverage of “the X algorithm” treats it as a frozen artifact from launch week. Queried against the GitHub commits API at the time of this research, the main branch had taken 31 commits in total since creation. That is a moving number by definition: anyone re-running the same query after X pushes again will get a higher one, and should re-check before citing it.

The most recent of those 31 commits is dated 2025-09-03, with the message “update for-you recommendations code,” and GitHub records it as pushed to the repository on 2025-09-08. Counting from that push to this piece’s publication date is 385 days, a little over twelve and a half months. Compare that cadence to the volume of secondhand explainer content produced about “how the X algorithm works” in the same period, almost none of which appears to have opened the diff.

What the code documents, component by component

The repository’s own README lays out its architecture as a table, not prose, and the safest way to describe the system is to reproduce that table rather than paraphrase the 2023 blog post about it. This is what the README stated when fetched directly for this piece, on 2026-09-23:

Component File path What the README says it does
SimClusters src/scala/com/twitter/simclusters_v2/README.md Community detection and sparse embeddings into those communities
TwHIN the-algorithm-ml, projects/twhin/README.md Dense knowledge graph embeddings for Users and Posts
real-graph src/scala/com/twitter/interaction_graph/README.md Model to predict the likelihood of an X User interacting with another User
tweepcred src/scala/com/twitter/graph/batch/job/tweepcred/README Page-Rank algorithm for calculating X User reputation
light-ranker src/python/twitter/deepbird/…/earlybird/README.md Light Ranker model used by search index (Earlybird) to rank posts
heavy-ranker the-algorithm-ml, projects/home/recap/README.md Neural network for ranking candidate posts, one of the main signals used to select timeline posts post candidate sourcing
home-mixer home-mixer/README.md Main service used to construct and serve the Home Timeline, built on product-mixer
visibility-filters visibilitylib/README.md Filters content for legal compliance, quality, trust and revenue protection, via hard-filtering, visible treatments and coarse-grained downranking
pushservice light and heavy rankers pushservice/README.md; pushservice/src/main/python/models/light_ranking and heavy_ranking Light ranker pre-selects candidates for notifications; heavy ranker is a multi-task model predicting open and engagement probability for a sent notification

Every description in that table is the README’s own wording at its own named file path, not a gloss on the original announcement. Two entries, TwHIN and heavy-ranker, live in a second repository, the-algorithm-ml, which the main README links out to directly rather than duplicating.

What X said in 2023, and where it says it now

The public record behind the release is two dated posts, both from 31 March 2023: the engineering blog post titled “Twitter’s Recommendation Algorithm,” and a companion post on the company blog, “A new era of transparency for Twitter,” which frames the code release as part of a broader openness push and states plainly that Twitter made “the decision not to release training data or model weights associated with the Twitter algorithm at this point.”

Checking the engineering blog’s own “Open source” tag listing, as archived on 2026-01-05, the newest entry under that tag is still that same 31 March 2023 post. Nothing about ranking has been added to that topic listing since. The blog is no longer where X records ranking changes, though: the README of xai-org/x-algorithm keeps a dated “Notable Updates” log, with six entries between 13 August and 26 October 2026 at commit b220448 (README.md, lines 32–72). This describes the public blog record as archived and checked on that date, not X’s internal engineering activity, which this piece has no way to see. An attempt to re-check the live blog.x.com listing directly on 2026-09-23 was blocked by an automated bot challenge that returned no readable page, so the archived snapshot is the most recent version this research could actually read. A reader citing this finding later should try the live page again first.

What the 2026 xai-org/x-algorithm repo changes

Since 19 January 2026, X has published a second repository, github.com/xai-org/x-algorithm, under the Apache-2.0 license. Its README describes it as “the core code that determines which posts a viewer sees in the For You feed on X,” and it keeps a dated “Notable Updates” log, with six entries between 13 August and 26 October 2026 at the commit checked here, b220448, dated 3 November 2026.

Three differences matter for anyone citing the 2023 code. First, the weights are public again. home-mixer/params/param.rs sets FavoriteWeight at 0.66, ReplyWeight at 5.0, ShareViaCopyLinkWeight at 20.0 and ReportWeight at −234.0, and the README says cron scripts set these defaults “to be the primary production values.” Second, the repository states how to read them: each weight multiplies the viewer’s predicted probability of an action, not a raw count, and the README calls reading “1 report cancels out 468 likes” from them a misconception (README.md, line 370). Third, ranking now runs on Phoenix, a transformer model, rather than the 2023 MaskNet heavy ranker, and visibility filtering is published in visibility-filtering/rules/levels.rs, which keeps a longer rule list for posts recommended from accounts the viewer does not follow.

It is still not the whole system. The README says “some botmaker rules aren’t currently in this repository” and that Grox prompts are left out to reduce gaming (README.md, lines 440–447). It also shows what a change looks like when it does arrive: docs/BIDIRECTIONAL_BOOST_CHANGE.md walks through a reply-weight boost for original posts from mutual follows, set to 20 on 13 July 2026 and lowered to 15 on 24 July 2026. The update is the diff itself, dated and readable, which is the record this piece was looking for on the engineering blog. One question that code can now answer is whether X penalises links: what the For You code does with a link post reads the open-link weight, the URL rules and the visit actions.

The specific claims worth checking before you repeat them

Most of what circulates as folklore about X’s ranking traces back to the 2023 announcement rewritten in someone else’s words, not to a specific file. Before repeating any of the following as fact, the method is the same each time: find the exact file that would have to say it, read what it actually says, and drop the claim if no such file exists.

  • “Verified accounts get an automatic ranking boost.” Not in the For You score, as of commit b220448 of xai-org/x-algorithm. The weighted sum is built in home-mixer/scorers/value_model.rs from Phoenix’s predicted action probabilities plus the author id and in-network, reply, repost and mutual-follow flags; no verification field is passed in, and none of the weights in home-mixer/params/param.rs is keyed to verification. Verification does appear elsewhere. user-cred-v2/ValidUserInfo.scala counts blue, gray, gold and verified-organisation accounts as “premium”, and user-cred-v2/UserCredV2App.scala gives the uniform share of the account-reputation PageRank’s teleport mass only to those accounts. The separate reply-ranking model takes author_verified as a learned input (recsys_reply_two_tower_v2_model.py, line 155). And government (gray) verification exempts an author from several spam-labelling rules, for example Tweet_Spam_High_Recall_RTF_All_Bad_URL_Sources.bot, lines 20–23. Those are an input and an exemption, not a fixed boost, and the code does not say how much any of them moves a post.
  • “Getting reported or blocked enough times quietly reduces your reach platform-wide.” Partly, and not platform-wide, as of commit b220448 of xai-org/x-algorithm. In ranking, not interested, block, mute and report carry weights of −52.272, −31.2, −58.8 and −234.0 (home-mixer/params/param.rs, lines 496–514), but each multiplies the viewer’s own predicted probability of that action. The comment above them (lines 389–401) says reports from bad actors “will primarily affect recommendations for users who are similar to the bad actors” and that only actions on posts served in Home Timeline count. A viewer’s own block or mute drops that author’s posts for that viewer (author_rules.rs, lines 42–54). The account-level path is separate: RateBasedLabels.scala computes blocks, reports (over 180 days) and spam reports per out-of-network like for each account, and rule 21278 applies a one-week AGATHA_SPAM_TOP_USER label when the matching model scores pass 0.99 or 0.999. That label drops the account’s posts from notifications to non-followers (levels.rs, lines 89–100). In For You, account labels such as ABUSIVE_HIGH_RECALL and DO_NOT_AMPLIFY drop posts only in the recommendations rule list (levels.rs, lines 315–357), which home-mixer applies to posts from accounts the viewer does not follow (vf_candidate_hydrator.rs, lines 92–106). So reports and blocks can feed labels that limit distribution beyond the people who blocked or reported, but in the published code those limits apply to non-followers. The README says some labelling rules are withheld, so this is a floor, not the whole picture.
  • “Replies that keep a thread going with the original author get ranked higher than one-off replies.” In the 2026 code this is checkable, and the answer is narrower than the claim. The For You score weights the predicted probability of a reply at 5.0 (home-mixer/params/param.rs, line 403) and adds 15.0 to that weight only for original posts, not replies or reposts, from accounts the viewer mutually follows (lines 404–409; xai-value-model/inputs.rs, lines 20–22). Nothing in that weighted sum rewards a reply for keeping a thread going with the original author. The separate reply-ranking model does take fav_by_root_author and focal_author_reply as inputs (recsys_reply_two_tower_v2_model.py, lines 156–157), but as learned features with no published weight. All paths are at commit b220448.

None of this is a claim that these mechanisms don’t exist. It’s a claim that stating them as confirmed requires a path, not a memory of a 2023 headline. Claims about Community Notes need the same treatment against their own published documentation, read in how Community Notes on X reach a brand post.

Reading one component yourself, start to finish

Here is the walk any reader can repeat in under five minutes. Start at the main README’s architecture table and find the heavy-ranker row. It links out to a second repository, the-algorithm-ml, at the path projects/home/recap/README.md. That file, read directly, describes the heavy ranker as a parallel MaskNet model producing several separate predicted-engagement probabilities, named things like “scored_tweets_model_weight_fav”, “scored_tweets_model_weight_reply”, and “scored_tweets_model_weight_negative_feedback_v2”, which are then combined into one score by a weighted sum. The same file states that the specific weight values it lists are “current” as of a date written into the file itself, April 5, 2023, and it links to one exact location for the live version of those weights: home-mixer/server/src/main/scala/com/twitter/home_mixer/product/scored_tweets/param/ScoredTweetsParam.scala, line 84.

Fetching that exact file today, 2026-09-23, it runs 881 lines and none of the named weight parameters the linked README describes appear in it anymore; line 84 now sits inside an unrelated content-exploration parameter block. That doesn’t prove the weighting logic left the codebase, it may have moved elsewhere in a repository this size. It does prove the specific cross-repository citation a reader would have followed to find “the current weights” no longer resolves to weights at all, three and a half years after the file it points to was written. Anyone repeating those 2023 figures as X’s current ranking weights is citing a page that has since moved. The current figures are published in a different repository: home-mixer/params/param.rs in xai-org/x-algorithm sets them at lines 402–520 (at commit b220448, FavoriteWeight 0.66, ReplyWeight 5.0, ReportWeight −234.0), and its README says cron scripts set those defaults “to be the primary production values” (README.md, line 432).

What this changes about reading the next platform statement

The finding here is narrow and specific to the 2023 repository: 31 commits and a fresh push in September 2025, against an engineering blog whose own open-source topic has recorded nothing new about ranking since March 2023, and a cross-repository citation that pointed at real weights in 2023 and points at something else now. The For You record has since moved to xai-org/x-algorithm, which logs its changes in its own README and had 62 commits on main at commit b220448, according to the GitHub commits API on 2026-11-03. That gap is not evidence of bad faith. It’s what happens by default when an artifact is maintained on an engineering cadence and a statement about that artifact is published once, on a communications cadence, and neither team goes back to reconcile them.

The practical lesson is about the evidence, not about what to do differently when posting: a platform’s code and its PR copy about that code are two different kinds of record on two different update schedules, and folklore fills the gap between them when nobody checks which one they’re citing. This piece stops at what is documented and what is or isn’t still said about it, deliberately, with nothing to add about posting strategy. The same method applies to how LinkedIn’s own engineering posts describe its feed ranking, to what Instagram has actually published about its ranking signals, and what it hasn’t, and to what a platform’s earnings call can tell you about ranking, and what it can’t, for a fuller kit of primary sources to check before repeating the next claim.

Before you cite this again

If a claim about X’s ranking is worth repeating in a deck or a client email, it’s worth the extra two minutes to open the file it supposedly comes from. The repository, the commit history, and the linked component READMEs are all public and all dated. Check the specific path before the specific claim goes out under your name.

FAQ

Is the code at github.com/twitter/the-algorithm the exact code ranking posts on X today?

The repository itself does not claim real-time parity with production: the heavy-ranker documentation notes there “may be small differences from the production model,” and no file asserts it is a live mirror. It is released under the AGPL-3.0 license and has continued to receive commits, most recently in September 2025, but what those commits mean for production is not something its documentation states either way. The 2026 repository, xai-org/x-algorithm, is Apache-2.0 and says more: its README states that cron scripts set the defaults in home-mixer/params/param.rs “to be the primary production values,” and that the aim is for experiments running at 10% of traffic or more to be visible in the repository (README.md, lines 430–432, commit b220448). That is a stated aim about defaults and experiments, not a claim that every production value is mirrored.

Has X explained any changes to how ranking works since the 2023 open-source release?

Yes, though in code rather than on the blog. Checked against the engineering blog’s own “Open source” topic listing, as archived on 2026-01-05, the most recent entry under that topic is still the original 31 March 2023 recommendation-algorithm post. The README of xai-org/x-algorithm, however, keeps dated “Notable Updates”: at commit b220448 they run from 13 August 2026, when scoring weights, visibility-filtering code and Phoenix training code were added, to 26 October 2026, when the Brazil election filter was removed (README.md, lines 32–72). docs/BIDIRECTIONAL_BOOST_CHANGE.md walks through one ranking change: a reply-weight boost for mutual follows, set to 20 on 13 July 2026 and lowered to 15 on 24 July 2026.

Does the open-source code show how the X algorithm works today?

Partly, and the newer repository is the one to read. The 2023 code at github.com/twitter/the-algorithm does not claim parity with production; its heavy-ranker documentation notes there “may be small differences from the production model.” The 2026 repository, xai-org/x-algorithm, describes itself as “the core code that determines which posts a viewer sees in the For You feed on X.” At commit b220448 it ranks with Phoenix, a transformer model, treats each published weight as a multiplier on the viewer’s predicted probability of an action, and says cron scripts set the defaults in param.rs “to be the primary production values.” It also says what is missing: some botmaker rules are not in the repository, and Grox prompts are left out to reduce gaming (README.md, lines 440–447). Read it as the documented structure and default values of the For You feed, not as a complete copy of the live system.

Sources

Dinesh Agarwal Avatar