The Algorithm Score a draft →

A field guide, read straight from the source code

How to actually
go viral on X.

No folklore. This is what X’s open-sourced ranking code literally optimizes for — and a tool to score your draft against it.

The whole game, in one line
score=Σ ( weight × P(action) ) Σ penalties

The transformer predicts the probability you’ll act on a post; a weighted sum sets its rank. Raise the positive actions, avoid the negatives, survive the filters. That’s it. ranking_scorer.rs

01 The Analyzer

Score a draft.

Paste a tweet. Every point added or subtracted is tied to a real mechanic in the code. It estimates the shape of a post the algorithm rewards — not the exact model weights (those aren’t in the repo).

Your draft 0 chars · 0 words
Context
Try one:

02 What the code actually rewards

Nine mechanics that decide your reach.

01

Replies & quotes outrank likes.

There are separate prediction heads for reply, quote, profile-click, and three kinds of share. A like is the cheapest action a person takes — the model rewards content that makes you want to weigh in or send it on.

19 discrete prediction heads · recsys_model.py
02

Dwell is the silent ranker.

There’s a dwell head, a continuous dwell-time head, and not-dwelled as a penalty. Making someone stop scrolling counts even if they never tap a thing — and scrolling straight past you actively hurts.

continuous + negative heads · ranking_scorer.rs
03

The two doors: followers vs. strangers.

Followers see you via Thunder (in-network). Virality means reaching strangers via Phoenix retrieval (out-of-network) — and OON content is multiplied by a penalty below 1, so it must outscore posts from accounts they already chose to follow.

effective_oon_weight · ranking_scorer.rs
04

The negative trap is real math.

block, mute, report, not-interested are predicted and subtracted. Rage-bait shown to strangers is self-defeating: it farms the exact buttons that lower your score. A spam/“banger” classifier labels low-quality bait before it’s even scored.

negative_sum · Grox classifiers
05

Velocity, then a short shelf-life.

Old posts get filtered out of candidate generation, and the in-network store only keeps recent posts. Early engagement is what pulls you into more feeds — a slow start rarely gets a second life.

AgeFilter · Thunder retention
06

You can’t spam your way in.

An author-diversity multiplier attenuates your 2nd, 3rd, Nth post in a single viewer’s feed — decaying by position. Posting twenty times doesn’t stack. One excellent post beats five mediocre ones.

diversity_multiplier · ranking_scorer.rs
07

Threads collapse to one post.

Conversation dedup surfaces only your highest-scored post per thread, per viewer. Your 8-tweet thread isn’t 8 shots on goal — put your most quotable, most dwell-inducing line in the opening tweet.

DedupConversationFilter
08

Your media is understood, not decoration.

Images and the transcribed audio of your video are embedded (multimodal V4/V5). Video that clears a watch threshold earns a dedicated “qualified view” weight. What you say on camera is indexed — give it a verbal hook.

Grox embedder · vqv weight
09

Replies are a borrowed audience.

Replies run through their own ranking pipeline. A genuinely sharp reply under a large, relevant account ranks in its context, drives profile-clicks (a positive head) and follows — riding distribution you don’t have yet. Low-effort replies get flagged as spam.

Grox reply-ranking pipeline

03 The Playbook

Nine moves, in priority order.

01

Engineer for replies

Take a stance or ask a real question. Reply & quote are weighted far above likes.

02

Win the first line

Stop the scroll before anything else. Dwell is rewarded; not-dwelled is punished.

03

Stay in a niche

Coherent topics let retrieval route you to a real audience and build a recognizable embedding.

04

High emotion, zero report-bait

Strong-and-clean beats inflammatory-and-reportable. The negatives subtract.

05

Front-load velocity

Post at peak audience time. The age filter gives you hours, not days.

06

One great post > many

Per-author decay means your best single post is your real currency.

07

Lead the thread

Conversation dedup surfaces one post — make the hook tweet the strongest.

08

Reply your way up

Borrow bigger audiences while you’re small. Reply-ranking + profile-click is the hack.

09

Treat media as content

It’s embedded and transcribed. Give video a verbal hook that clears the watch threshold.