O algoritmo
Inside X's open-source algorithm
The real weights in X's published feed code, and what they mean for how you post.
- 2 min de leitura
- Em andamento
- Com fontes
Faça isto hoje
Write posts people would copy the link to and send.
Share via copy link carries the biggest positive weight in the 2026 code.X code, 2026
Aim for replies, not likes.
A reply is weighted about 7× a like in the 2026 code.X code, 2026
Avoid anything your audience would mute, block or report.
Negative actions carry large penalties.X code
Este guia ainda não foi traduzido, então mostramos em inglês. Você pode pedir para a IA explicar em português com o botão abaixo.
The short version: X is the only major platform that publishes the code behind its main feed. It predicts how likely you are to take each of dozens of actions on a post, multiplies each prediction by a published weight, and adds them up. In the current code, the predicted chance of a reply, quote or DM share is weighted about 7 times as heavily as the chance of a like, sharing via copied link about 28 times, and “not interested,” mute, block and report all carry heavy penalties. Those weights apply to predictions, not counts, which the calculator below makes concrete. From the code
Post for the weights
Section titled “Post for the weights”- Write for replies, quotes and sends, not likes. Those weights are several times higher than a like. Code, applied
- Make posts people want to share outside X. Sharing via copied link is the single highest positive weight in the 2026 code. Code, applied
- Don’t get muted. Predicted mutes and “not interested” carry large negative weights, and mutes also filter you out of that person’s feed entirely. Code, applied
- Post consistently, not in bursts. Author diversity discounts your second and third post in the same feed, and posts older than 48 hours drop out of For You. From the code
- New accounts get a lift. The new-author boost exists so low-impression accounts get seen. Your early posts matter. From the code
- Don’t treat weights as permanent. The reply weight went from 13.5 to 5 between releases. Build for the audience, and use the code to understand direction, not to game a number.
See the pipeline, step by step
Section titled “See the pipeline, step by step”What happens every time someone opens For You, in the order the 2026 README lays out. From the code
- 1. Read the viewerPull their recent engagements, who they follow, and who they’ve blocked or muted. The engagement history is the model’s main input.
- 2. Gather candidatesIn parallel: Thunder (recent posts from accounts you follow), Phoenix retrieval (posts from everyone else that match you), SimClusters (posts popular in communities like yours) and a shared list of popular posts.
- 3. Fill in detailsAttach the text, media, author, language and engagement counts to each candidate.
- 4. FilterDrop duplicates, posts older than 48 hours, your own posts, blocked or muted accounts, and anything you’ve already seen.
- 5. ScorePhoenix predicts the chance of each action. The ranker multiplies by the weights below, then discounts repeat authors and out-of-network posts and boosts new authors.
- 6. Pick the topSort by final score and keep the best.
- 7. Final checksVisibility rules remove posts that labels say can’t be shown, and extra replies from the same conversation are collapsed.
Try the weights
Section titled “Try the weights”These are the numbers the ranker multiplies each predicted action by. Toggle between the two releases to see how much changed.
What the code showsTwo releases, where posts come from, filters and labels
Two releases
Section titled “Two releases”2023: twitter/the-algorithm
- About 1,500 candidates per request, roughly half from accounts you follow
- A neural network of about 48M parameters predicts 10 kinds of engagement
- Weights published as of April 5, 2023
2026: xai-org/x-algorithm
- A Grok-based transformer called Phoenix ranks posts from the viewer’s recent engagement history
- Predicts many more actions, including dwell time, shares by DM and copy link, and follows
- Filtering and visibility code published, with dated updates
What the 2026 code shows
Section titled “What the 2026 code shows”Where posts come from. Posts from accounts you follow come from a service called Thunder. Posts from accounts you don’t follow come from Phoenix retrieval and SimClusters, plus a shared list of popular recent posts. Both kinds are ranked by the same model. From the code
Three adjustments after scoring:
- Author diversity. Each extra post from the same author in one feed is multiplied by a shrinking factor, down to a floor.
- Out-of-network discount. Posts from accounts the viewer doesn’t follow are multiplied by a factor below 1.
- New-author boost. Posts from authors with few impressions are lifted toward a target position.
What gets filtered before ranking, among others: duplicates, posts older than 48 hours, posts the viewer has already seen, posts from blocked or muted accounts, posts matching muted keywords, and, for new accounts, out-of-network posts below an engagement threshold. From the code
Ranking and visibility are separate. Ranking sets the order. A separate visibility system decides whether a post can be shown at all, based on blocks, mutes and labels other systems attach to posts and accounts. Some of those rules apply only when the post is recommended to people who don’t follow you. From the code
You can check your labels. X’s “Under the Hood” tool shows visibility-limiting labels on your account and posts. Use it before believing you’re “shadowbanned.” From the code
Visual breakdowns by othersExplainers worth your time, with caveats
People have drawn this system out in more detail. These are the ones worth your time, with caveats:
- cneuralnetwork/x-algorithm-explained: an interactive whiteboard and PDF walk-through that pins the exact commit it read. The most careful visual explainer we found.
- ByteByteGo: The Algorithm That Powers Your X Post (Feb 25, 2026): clean diagrams for a general audience. It oversimplifies in places, for example saying hand-written rules were almost entirely replaced, when the README still lists rule-based filters and visibility checks.
Skip summaries that claim there are “no hand-engineered features.” The published filters and visibility rules say otherwise.
Sources4 sources
- xAI, xai-org/x-algorithm, README and
home-mixer/params/param.rs, checked Nov 26, 2026. - Twitter, twitter/the-algorithm-ml, Heavy Ranker README, weights dated April 5, 2023.
- X Engineering, Twitter’s Recommendation Algorithm, 2023.
- TechCrunch, X open sources its algorithm while facing a transparency fine and Grok controversies, Jan 20, 2026.