Inside Twitter’s Open‑Source Recommendation Algorithm: How Likes, Retweets, and Follows Are Weighted
Elon Musk opened Twitter's recommendation algorithm on GitHub, sparking massive interest as the community dissected its weighting rules, revealing that likes, retweets, and follows receive dramatically higher influence than other signals.
Elon Musk fulfilled his promise by open‑sourcing Twitter’s recommendation algorithm on GitHub, quickly gathering nearly 30,000 stars.
Before the release, the tech community was buzzing, and Sourcegraph even hosted a live stream.
Below is a quick walkthrough of the core ranking weight rules extracted from the source file
https://github.com/twitter/the-algorithm/blob/main/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/similarity_engine/EarlybirdTensorflowBasedSimilarityEngine.scala#L142:
retweetCountParams – retweets count 20× weight.
replyCountParams – replies count 1× weight (20 replies ≈ 1 retweet).
reputationParams – reputation 0.2× weight.
luceneScoreParams – Lucene scoring 2× weight (content relevance).
textScoreParams – pure text 0.18× weight.
urlParams – URLs 2× weight.
isReplyParams – replies to others 1× weight.
favCountParams – likes 30× weight.
langEnglishUIBoost – English UI 0.5× weight.
langEnglishTweetBoost – English tweets 0.2× weight.
langDefaultBoost – default language 0.02× weight.
unknownLanguageBoost – unknown language 0.05× weight.
offensiveBoost – offensive content 0.1× weight (penalized).
inTrustedCircleBoost – trusted‑circle content 2× weight.
multipleHashtagsOrTrendsBoost – multiple tags 0.6× weight.
inDirectFollowBoost – indirect follow (author follows after seeing tweet) 4× weight.
tweetHasTrendBoost – trending topics 1.1× weight.
selfTweetBoost – self‑retweet 2× weight.
tweetHasImageUrlBoost – image URL 2× weight.
tweetHasVideoUrlBoost – video URL 2× weight.
In short, Twitter’s “one‑click three‑likes” are likes (30×), retweets (20×), and follows (4×).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
