Platform Tips

X Algorithm Is Open Source: What The Weights Actually Reveal (2026)

1766 views
Serge Bulaev
Serge Bulaev
X Algorithm Is Open Source: What The Weights Actually Reveal (2026)

TL;DR

X (formerly Twitter) is the only major social platform that has open-sourced its recommendation algorithm. The repo went public in March 2023 and remains the most detailed public document of how a fee

X Algorithm Is Open Source: What The Weights Actually Reveal (2026)

X (formerly Twitter) is the only major social platform that has open-sourced its recommendation algorithm. The repo went public in March 2023 and remains the most detailed public document of how a feed ranking system actually works. In January 2026, xAI released a Grok-powered version that adds a transformer-based content-understanding layer on top — but the underlying engagement weights are still the public reference for how the platform values different signals.

This article walks through the actual weights, the filters that kill posts before they're even scored, and what those numbers mean for what you publish. Skip the speculation; the source code answers most of the questions creators have been guessing at for years.

TL;DR — In Five Bullets

  1. The repo lives at github.com/twitter/the-algorithm (Scala) and twitter/the-algorithm-ml (Python). Public since March 2023.
  2. The full weight ladder: like 1x, bookmark 10x, link click 11x, profile click 12x, reply 13.5x, retweet 20x, reply-with-author-response 150x.
  3. Four filters kill posts before scoring: author diversity (3-per-window cap), negative feedback recency (30 days), sole-link posts, out-of-network limits.
  4. January 2026 Grok update adds transformer-based content understanding — the fundamental weights remain public, but a new layer applies LLM context.
  5. What to optimize for: replies that earn a reply from you (the 150x signal). Then retweets (20x). Likes are the cheapest and least informative.

What "Open Source" Actually Means Here

The term gets thrown around carelessly. Here's what's actually public and what isn't.

Public:

  • Heavy Ranker scoring logic — the model that scores candidate tweets for a user's For You feed.
  • Candidate generation — how the platform pulls the initial pool of ~1,500 tweets per request before ranking.
  • SimClusters embeddings — community-based clustering used to predict topical interest.
  • Engagement weight constants — the multipliers we'll cover in detail below.
  • Negative feedback handling — how blocks, mutes, and "show less of this" affect future scoring.

Not public (or only partially):

  • Real-time spam and abuse classifiers (security-sensitive, kept private).
  • Ad targeting and pricing models.
  • Some safety classifiers around hate speech and graphic content.
  • The exact January 2026 Grok integration logic — the transformer-based content understanding layer is not in the public repo as of the article's publication.

The release in March 2023 was unusual because no other major platform has come close. Meta has published high-level papers about Instagram and Facebook ranking, but not the actual production code. TikTok has shared nothing of substance. LinkedIn published a research paper about its 360Brew foundation model, but again — the deployed code is private.

The Weights, From Lowest to Highest

The Heavy Ranker scores each candidate tweet on the predicted probability of different engagement actions, multiplied by these weights. The result is a single score, and the top-ranked tweets fill the For You feed.

X (Twitter) algorithm engagement weights from the open-source Heavy Ranker — like 1x baseline, bookmark 10x, link click 11x, profile click 12x, reply 13.5x, retweet 20x, reply with author response 150x
  • Like — 1x (baseline). The cheapest interaction. Public, low-friction, often performed without reading. The algorithm reads it as the weakest signal of interest.
  • Bookmark — 10x. Private save signal. Strong evidence the user wants to return to the post. Bookmarks are weighted highly because they're an action people only take when they actually find the content useful.
  • Link click — 11x. The user followed your link. They didn't just scroll past — they clicked through to read more. Strong signal of genuine interest.
  • Profile click — 12x. The post was good enough that the user wanted to see who wrote it. This is the start of a follow funnel.
  • Reply — 13.5x. The user invested in writing back. Replies require thought and exposure (the user's name appears next to the reply). High-quality engagement.
  • Retweet — 20x. The user co-signed your post to their network. The algorithm rewards posts that travel — retweets are the primary distribution mechanism.
  • Reply, then author replies back — 150x. The big one. The user wrote a reply, the post author wrote back, and a real conversation started. This is the strongest signal in the ranker — and it's a 7.5x multiplier on top of the already-high reply weight.

There are also negative weights. Blocks, mutes, and "show less of this" actions on a post drag the score down by significant multipliers (the exact values vary by signal). Negative feedback within the last 30 days also affects future scoring on everything that account publishes, not just the original post.

The Filters That Kill Posts Before Scoring

Here's the part most creators miss. Before any of these weights apply, your post has to survive a series of pre-ranking filters. Posts that fail the filters never get scored, no matter how good they are.

Four filters that kill X posts before they're scored — posting too often (author diversity), negative feedback recency, sole-link posts with no context, out-of-network reach limits

1. Author Diversity (~3 Posts per Feed Window)

The candidate-generation step caps how often posts from the same author can appear in a feed. The cap is roughly 3 posts per feed window for most users. If you post 10 times in an hour, most of those posts will never be scored — they were filtered out at candidate generation.

Implication: high-volume posting hurts more than it helps. 3-5 well-considered posts a day outperform 15 rushed ones, because most of the rushed ones never reach the ranker.

2. Negative Feedback Recency (30-Day Decay)

If users have blocked, muted, or selected "show less of this" on your posts in the last 30 days, the algorithm down-weights everything you publish — not just the post that received the negative feedback. This decays over time but stays relevant for about a month.

Implication: one or two posts that earn mass negative feedback can sink your reach for weeks. Polarizing for engagement is a high-variance strategy with downside that lingers.

3. Sole-Link Posts

Posts that consist primarily of an outbound URL with little or no original text are throttled. The algorithm reads them as low-effort distribution rather than original content. The threshold isn't "any link," it's "the post is dominated by the link with no real substance around it."

Implication: if you're sharing a link, write 100-200 words of original commentary around it. Otherwise the algorithm treats it as link spam, regardless of where the link points.

4. Out-of-Network Limits

Each feed has a cap on how many posts from accounts the user doesn't follow can appear. Free accounts have a tighter cap than X Premium accounts, but the cap exists for everyone. Once the cap is hit, additional candidates from outside the user's network don't get included regardless of score.

Implication: growth into new networks is throttled by design. The fastest path to reach is engagement from your existing network — replies, quote tweets, and retweets that pull the post into followers' For You feeds first, where it gets the in-network signal boost.

How to Write for the Weights

The weights tell you exactly what to optimize for. Here's the operational version of "write better posts."

Aim for the 150x Signal: Reply With Author Response

The single highest-weight signal is a reply that prompts a reply from you. Two practical implications:

  • End posts with a specific question. Not "thoughts?" but "what's the strongest counter-argument to this?" or "have you seen this work in B2C as well as B2B?" The more answerable the question, the more replies you'll get.
  • Reply to your own thread. When replies start coming in, write substantive responses to the early ones — not "thanks!" but a real follow-up that opens the conversation further. Each meaningful exchange compounds the score.

Aim for Bookmarks: 10x With No Public Risk

Bookmarks are unusual because they're private — the user doesn't have to commit reputationally. Posts that get heavily bookmarked tend to be:

  • Reference content. Lists, frameworks, useful templates, "save this for later" data.
  • Threads with takeaways. The hook makes a strong claim, the body delivers specifics, the close is summarizable.
  • Posts that capture a recurring decision. "How to think about X" content gets bookmarked more than one-off observations.

Make the Topic Obvious in Line One

Candidate generation uses content embeddings to match posts to user interests. If line one of your post is vague, the embedding won't strongly cluster with any interest topic — and the post will fail to enter relevant candidate pools. Specifically: lead with the topic, not with a teaser. "B2B SaaS pricing is broken" beats "I learned something interesting today."

What This Means for Cross-Platform Posting

If you publish on multiple platforms — X, Threads, Bluesky, LinkedIn, Instagram — the weights tell you that the same post will perform differently on each. The mistake most creators make is writing one post and copying it across, expecting the algorithms to value the same things.

The X weights (replies high, retweets high, bookmarks valuable) push toward conversational, opinion-led, save-worthy content.

LinkedIn's 360Brew pushes harder toward saves, deep comments, and reposts — and away from likes. The relative weights differ from X, even when the metric names look similar. (See the LinkedIn metrics deep dive for the comparable framework on that platform.)

Threads and Bluesky are still figuring out their ranking signals — both lean closer to chronological than algorithmic, which means the X-style "optimize for replies" approach matters less.

Instagram and TikTok weight watch-time and re-watches over discrete engagement signals like likes — the same hook structure won't carry over.

The practical takeaway: if you cross-post, adapt the post for each platform's weights. A scheduler like Publora makes this manageable — you can write the platform-specific variant for each network from one workflow rather than maintaining five separate calendars.

What the Open-Source Repo Doesn't Tell You

The weights are real and useful, but the repo isn't the whole story. Three things to keep in mind:

  • The code has drifted since release. The March 2023 release was a snapshot. The production system has changed in the years since — most notably the January 2026 Grok integration. Some files in the public repo no longer match production exactly.
  • The Grok layer is opaque. The transformer-based content understanding layer added in January 2026 is not in the public repo. It applies its own scoring on top of (or in front of) the Heavy Ranker, and what it actually weights is unclear.
  • Spam and safety classifiers are private. Posts that trigger safety or spam classifiers get filtered before any engagement scoring matters. The classifiers themselves aren't public, so you have to infer their behavior from observed outcomes.

The fundamentals — the engagement weight ladder, the four pre-ranking filters, the candidate generation logic — are still the best public reference for how to write for the platform. The Grok layer adjusts but doesn't replace them.

Frequently Asked Questions

Is the X (Twitter) algorithm really open source?

Partly. X released the core ranking and recommendation code in March 2023 in github.com/twitter/the-algorithm. The repo includes the Heavy Ranker, candidate generation, SimClusters embeddings, and engagement weights. What's not included: real-time spam classifier, ad targeting, safety classifiers. No other major platform has open-sourced this much.

What is the highest-weighted engagement signal?

A reply that gets a reply from the original author — roughly 150x a like. Next: retweet at 20x, reply at 13.5x, profile click at 12x, link click at 11x, bookmark at 10x. These are public in the repo's scored-tweets.thrift file.

Did the X algorithm change in January 2026?

Yes. xAI released a Grok-powered version — a transformer model that reads post content and watches videos. The legacy Heavy Ranker still influences scoring, but candidate-generation and content understanding are now LLM-driven. Engagement weights appear unchanged in publicly visible code.

Why are bookmarks weighted higher than likes?

Because bookmarks are private. Likes cost nothing reputationally — people scatter likes across content they barely read. Bookmarks signal intent to return. The algorithm reads bookmarks as much stronger evidence that a post is genuinely useful — roughly 10x the value of a like.

Does X Premium boost reach?

Yes — concentrated in out-of-network reach. Premium accounts have higher caps for showing posts to non-followers. For your existing followers, weight differences are minor. Premium replies are surfaced higher in reply threads, which compounds the 150x reply-with-author-response multiplier.

What posts get killed before they're scored?

Four filters: author diversity (~3-per-window cap on posts from same author), negative feedback recency (blocks/mutes from last 30 days), sole-link posts with no context, out-of-network limits per feed window. These are pre-scoring filters — engagement quality doesn't matter until you pass them.

Where can I read the actual code?

github.com/twitter/the-algorithm (Scala, production scoring) and github.com/twitter/the-algorithm-ml (Python, ML training). For curated annotated reading, the awesome-twitter-algo repo is the best community reference — it explains each subdirectory and which files contain the weight constants.

Schedule X, Threads, LinkedIn, and Bluesky from One Place

The X weights tell you to optimize for replies and retweets. The LinkedIn weights tell you to optimize for saves. Threads and Bluesky push you toward chronological consistency. Publora lets you write platform-specific variants of the same idea and schedule them across all of them — without juggling five tools or copy-pasting one post into networks that reward different signals. Try Publora free.


Serge Bulaev writes about social media platforms, scheduling tools, and how creator-side algorithms actually work. Founder of Publora and Co.Actor.

Sources

Related Articles