X Algorithm Code: Copy-Link Shares Weigh 30x a Like
AI tools
TL;DR Line-by-line read of xai-org/x-algorithm commit 17c96bf: like 0.66, reply 5.0, copy-link share 20.0. The 2023 author-reply weight of 75 is no longer scored separately.
On 2026-10-15, indie developer Evan Long (@evanlong_me) checked the open-source X algorithm repo xai-org/x-algorithm line by line at commit 17c96bf (committed 2026-10-14 03:41 UTC). Three findings: (1) the default weights are 0.66 for a like, 5.0 for a reply and 20.0 for sharing via copy link (param.rs L320–L321, L363–L368); (2) the 2023 Twitter algorithm weighted a reply at 13.5 (L33) and a reply engaged by the author at 75.0 (L36), and today author replies have no separate weight, though the model still reads focal_author_reply as an input feature (reply.rs L62–L69); (3) the weights multiply predicted probabilities, not engagement counts (param.rs L291–L311).
How did X move from hand-written rules to Grok ranking?
This timeline only includes posts from the personal accounts of Elon Musk and X head of product Nikita Bier. Quoted text is verbatim from the original posts; everything else is paraphrased. These are plans and statements: the code is the arbiter of what shipped. Dates are UTC+8.
| Date (UTC+8) | Who | What they said | Post |
|---|---|---|---|
| 2025-06-10 | Musk | Paraphrase: the recommendation algorithm will use Grok more, so strong posts from small accounts can reach the feed | link |
| 2025-08-16 | Musk | Paraphrase: testing a new algorithm powered by Grok 4 Mini | link |
| 2025-09-10 | Musk | Paraphrase: heuristic code will be replaced by a Grok AI recommendation system | link |
| 2025-09-20 | Musk | Paraphrase: aiming for pure AI recommendations by November | link |
| 2025-10-18 | Musk | “The 𝕏 recommendation system is evolving very rapidly. We are aiming for deletion of all heuristics within 4 to 6 weeks.” | link |
| 2025-11-13 | Musk | Paraphrase: next month Grok will understand roughly 100 million posts a day and recommend on content quality regardless of account size | link |
| 2026-01-11 | Musk | Paraphrase: the new algorithm will be open-sourced within 7 days, then updated every 4 weeks | link |
| 2026-01-20 | Musk | Paraphrase: the algorithm is built by the xAI engineering team | link |
| 2026-03-20 | Musk | Paraphrase: a major AI recommendation update is coming next week, open-sourced at the same time | link |
| 2026-03-29 | Nikita Bier | “It's perhaps the strongest proof that our algorithm has eliminated all rules” … “Post ranking decisions are not even constrained by language anymore.” | link |
| 2026-05-15 | Musk | Paraphrase: the latest algorithm is on GitHub, with monthly updates and release notes from now on | link |
The current README states that For You “ranks posts using a transformer model” (README L3).
How does the X algorithm score posts today?
Per the README, the model predicts how likely the viewer is to take each action on a post, multiplies each prediction by a weight, and sums the results (README L352–L356). The default weights live in home-mixer/params/param.rs. The table compares them to the 2023 Twitter algorithm weights in twitter/the-algorithm-ml; “—” means that version has no equivalent entry.
| Action | 2026 default | Code | 2023 Twitter weight | 2023 source |
|---|---|---|---|---|
| Like | 0.66 | L320 | 0.5 | L31 |
| Reply | 5.0 | L321 | 13.5 | L33 |
| Reply boost between mutual follows | 15.0 | L322–L327 | — | — |
| Repost | 1.0 | L334 | 1.0 | L32 |
| Profile click | 0.0 | L349–L354 | 12.0 (good_profile_click) | L34 |
| Click | 0.3 | L347 | 11.0 (good_click) / 10.0 (good_click_v2) | L37 / L38 |
| Share | 2.0 | L356 | — | — |
| Share via DM | 5.0 | L357–L362 | — | — |
| Share via copy link | 20.0 | L363–L368 | — | — |
| Quote | 5.0 | L370 | — | — |
| Reply engaged by author | No separate weight (still a model input feature) | reply.rs L62–L69 | 75.0 | L36 |
| Not interested | −52.272 | L414–L419 | −74.0 (negative_feedback_v2, combined) | L39 |
| Block author | −31.2 | L420–L425 | covered by negative_feedback_v2 | L39 |
| Mute author | −58.8 | L426–L431 | covered by negative_feedback_v2 | L39 |
| Report | −234.0 | L432 | −369.0 | L40 |
xai-org/x-algorithm · pinned commit 17c96bf Opening home-mixer / params / param.rs Lines 295–297 comment: weights multiply “predicted probability”, not raw engagement counts Line 320: like FavoriteWeight = 0.66 Line 356: share ShareWeight = 2.0 Lines 357–362: share via DM ShareViaDmWeight = 5.0 Lines 363–368: share via copy link ShareViaCopyLinkWeight = 20.0 Line 432: report ReportWeight = -234.0 Compared with the 2023 twitter/the-algorithm-ml weights 2023 line 33: reply = 13.5 Line 36: reply engaged by the author reply_engaged_by_author = 75.0
The three biggest shifts: replies dropped from 13.5 to 5.0; author-engaged replies went from 75.0 to no separate weight; and share signals were added, with copy-link sharing (20.0) now the highest positive weight in the file.
What two caveats do you need before reading these weights?
Caveat 1: weights multiply predicted probabilities, not counts. The comment at param.rs L291–L311 says each weight multiplies the “predicted probability” of an action (or a continuous value such as watch time) and that “the weights do not multiply raw engagement counts.” It explicitly rejects the reading that “one report cancels 468 likes,” noting that a report's baseline probability is more than 1000x lower than a like's, so it needs a larger weight to affect ranking at all (param.rs L291–L311; also README L354). So “copy link weighs 30x a like” (20.0 / 0.66 ≈ 30.3) describes how strongly each prediction is scaled, not “one copy-link share equals 30 likes.”
Caveat 2: param.rs holds defaults that experiments can override. The README's “Experiments and Configuration” section says X runs experiments on a small share of traffic, reads many tunable values from a configuration system, and uses cron scripts to set the repo defaults to the “primary production values” (README L414–L418). Treat the table as a snapshot of the main production config; a given user may be in an experiment bucket with different values.
Did X really delete all the heuristics?
| Official statement | Rule-based mechanisms still in the code | Source |
|---|---|---|
| “deletion of all heuristics within 4 to 6 weeks” (Musk, 2025-10-18) | AgeFilter removes posts older than 48 hours | README L374 |
| Same | Deduplication: DropDuplicatesFilter, RetweetDeduplicationFilter, DedupConversationFilter, previously-seen filters | README L372–L382, L402 |
| “our algorithm has eliminated all rules” (Nikita, 2026-03-29) | Out-of-network discount: posts from accounts you don't follow, and replies/reposts from accounts you do, are multiplied by a factor below 1 (value not given in the README) | README L360 |
| Same | Cold-start parameters: impression threshold 200, follower cap 50,000, max post age 7,200 seconds | param.rs L489–L518 |
| Same | Author diversity decay is described in the README, but home-mixer's value_model.rs hard-codes enable_author_diversity: false | README L359, value_model.rs L45–L47 |
| Same | Brazil2026ElectionFilter, added to comply with Brazilian electoral law | README L40 |
A fair reading: the scoring step really is model-driven, but filtering, dedup, discounts and cold start around it are still hand-written rules. vm-ranker's value_model.rs reads the author-diversity switch from params instead (vm-ranker/scoring/value_model.rs L104–L106), so which path production uses, and whether diversity is on, cannot be determined from the repo. Unverified.
What does this mean for creators?
Each point cites its code. Items marked “inference” are my reading; the code does not prove them directly.
- 48 hours is a hard cutoff. AgeFilter drops posts older than 48 hours (README L374).
- The first two hours matter for small accounts. Cold-start parameters: max post age 7,200 s, follower cap 50,000, impression threshold 200 (param.rs L489–L518). Inference: new posts from smaller accounts may get extra placement in that window; the mechanism was not traced line by line.
- Content people pass along is weighted most. Copy-link share 20.0, DM share 5.0 (L357–L368). Inference: reference material people save or send to colleagues beats chasing likes.
- Replies still matter, but there is no 75x bonus anymore.
focal_author_replyremains a model feature (reply.rs L62–L69). Inference: author replies still influence ranking, by an amount the code does not reveal. - Out-of-network reach is discounted. See README L360 and L376 (OONRetweetReplyFilter).
- Negative feedback is still heavily weighted. Report −234, mute −58.8 (L426–L432). Per caveat 1, this acts on the predicted chance that a viewer reports you, not a tally of reports.
Self-check: the README describes Under the Hood, a pilot tool that shows visibility-affecting labels on your account and posts (README L452–L456; entry point https://x.com/i/jf/under_the_hood ).
I ran into a similar gap between official guidance and actual mechanics when building my own site; see bilingual site SEO.
How was this verified, and what are the sources?
- Checked on 2026-10-15 (UTC+8).
- Code: xai-org/x-algorithm commit
17c96bf346df3d62b90f1bb01830d432dba74485(2026-10-14 03:41 UTC); every line number verified locally with rg/sed. - 2023 baseline: twitter/the-algorithm-ml commit
b85210863f7a94efded0ef5c5ccf4ff42767876c, recap README L31–L40, each weight linked to its own line. - Statements: original posts by Elon Musk and Nikita Bier, linked in the timeline.
- Left out as unverified: any Premium ranking boost, the live out-of-network discount and author-diversity values, the repo's star count.
Screenshot-worthy comparisons
- Copy-link share 20.0 vs like 0.66 (L320 / L363–L368).
- Author-engaged reply: 75.0 in 2023 (L36) → no separate weight in 2026, still a model feature (reply.rs L62–L69).
- “deletion of all heuristics within 4 to 6 weeks” (Musk, 2025-10-18) vs the 48-hour AgeFilter (README L374) and
enable_author_diversity: false(value_model.rs L45).
Author: Evan Long, indie developer and founder of a team building products for global markets. About · Resume · X @evanlong_me