Twitter open-sourced its recommendation code twice: the 2023 MaskNet release (with the now-famous published weights) and the 2026 Phoenix release (a Grok-architecture transformer). This page models both from the primary source code, then translates the machinery into the only question most people care about: "If I do X, what do I get shown?"
Every refresh of "For You" runs candidates through a pipeline orchestrated by Home Mixer. About 1,500 tweets are pulled per request, split roughly 50% in-network (people you follow) and 50% out-of-network (people you don't). C1 primary source.
In-network candidates come from the Earlybird search index, scored by RealGraph (how likely you are to interact with that author). Out-of-network candidates are found by similarity and social proof.
A fast, old model thins the candidate pool. Twitter itself admits it was "trained several years ago" and "uses some very strange features."
The core scorer. It predicts the probability you'll take each action, then computes a weighted sum. This is where the famous numbers live → see §02.
Author diversity (no author-spam), in/out-network balance, feedback fatigue, dedup & already-seen removal, and visibility filtering (blocked, muted, NSFW, safety).
Ranked tweets are interleaved with ads, who-to-follow, and conversation modules, then served to your timeline.
The single most-verified fact on this page: the 2023 the-algorithm-ml repo published the exact multipliers (dated April 5, 2023). All four of my sources — the repo plus Codex, Grok and Gemini independently — returned these identical numbers. C1
Bars are log-scaled for legibility (report is −369; like is +0.5 — a linear chart would be unreadable). Weights apply to probabilities, so they're "what the system is trying to cause," not literal point totals.
Toggle the actions you take on a tweet and watch the 2023 heavy-ranker score move. This is the "what does engaging do?" question made literal — it uses the real published weights. (Illustrative: it sets each action's probability to 1 when toggled; the live model uses learned probabilities.)
These are real code parameters — but most are tunable defaults, not guaranteed production values. Confidence tiers: C1 primary · C2 code-derived · C3 inferred · C4 lore.
| Factor | Effect | Conf. |
|---|---|---|
| Blue / Premium boost | ~4× in-network, 2× out-of-network in 2023 params. Later snapshots sometimes default to 1.0 — production value unknown. | C2 |
| Author diversity | Consecutive tweets from the same author are decayed (factor ~0.5, floor ~0.25). Stops one account flooding your feed. | C2 |
| Out-of-network scale | Out-of-network scores scaled ~0.75 — your network is favored. | C2 |
| Recency decay | Earlybird age decay, roughly 6-hour halflife. Old tweets fade. | C2 |
| TweepCred (reputation) | PageRank-style account credibility. A poor follower/following ratio lowers it. | C2 |
| Social proof (out-of-network) | Stranger tweets generally need a 2nd-degree connection (someone you follow engaged it) to surface. | C2 |
| "Elon / power_user / dem / rep" labels | Existed in 2023 code but engineers said they were metrics-only, not boosts; removed shortly after release. | C1 |
| Media = "2× reach" | Image/video boost fields exist but defaults are tunable — the "2×" figure is not in the code. | C4 |
| External links "cut reach 30–90%" | Widely repeated, but not a documented constant in the released code. Treat as lore. | C4 |
In 2026 xAI released xai-org/x-algorithm, replacing MaskNet with Phoenix — a transformer built on the same architecture as Grok. This is the system running today, and it changes the rules. C1
home-mixer/ads/. Apache-2.0, updated ~every 4 weeks.Short answer: this page reflects the latest public release — May 15, 2026. The algorithm has changed substantially across versions, and every previous version is still public — both repos keep full git history, so you can diff the changes yourself. C1 commit history.
Twitter publishes twitter/the-algorithm + the-algorithm-ml. A partial dump — ~80% of production code, the training data, model weights and the trust-and-safety pipeline were all withheld.
The heavy-ranker weight table is committed. Within days, the author_is_elon / democrat / republican labels are removed. You can see both the original and edited versions in the commit history.
A handful of commits through mid-2023, then near-silence — despite promises of frequent updates. One late commit lands Sept 3, 2025 ("update for-you recommendations code"). The famous weights are never officially re-published.
After a 7-day countdown, xAI publishes xai-org/x-algorithm: the Grok-architecture Phoenix system replacing MaskNet. Readable, but not yet runnable — no pre-trained model. xAI pledges updates every 4 weeks.
The biggest drop yet (187 files, ~18k lines): an end-to-end inference pipeline you can run locally, a ~3 GB downloadable mini-Phoenix model (via Git LFS), plus new content-understanding (grox) and ad-blending modules. This is the version this page describes.
On the stated cadence, the next update is due around mid-June 2026. As of this page's date (June 4) it hasn't landed — so nothing here is stale yet, but check the repo if you're reading this later.
twitter/the-algorithm's commit history; the Jan→May Phoenix evolution is in xai-org/x-algorithm's log. Note the xAI repo has no tagged releases — you navigate by commit, not by version number.
The bottom line, as a filterable ledger. Search an action, or filter to just the levers that add or remove content. Star rating = how strongly that action steers what you see next.
I — Claude, the AI that wrote this page — modeled the algorithm from the primary source code, then sent the same detailed question, independently and with no shared context, to three other AI models, and diffed every answer against the source. Here's what each contributed.
Most disciplined on sourcing. Correctly flagged Blue-boost values as "production-uncertain," cited exact repo file paths, and noted the "reply ×27" figure is just the ratio to a like (13.5 / 0.5).
Deepest on internals: surfaced the Phoenix/Grok 2026 rewrite, light-ranker thrift params, age-decay halflife, the 0.75 out-of-network scale, and author-diversity floors. Strong corroboration of the weights.
Most fluent — and most error-prone. Stated several specifics as code facts that aren't in the source (a Phoenix "bookmark = 10.0" weight, link penalties, media 2×, a 2023 Rust file that's actually 2026). A live lesson in why you verify.
verification/cross-model-comparison.md.