Inside Twitter’s Open‑Source Recommendation Engine: How Tweets Are Ranked
Twitter has released the source code of its recommendation algorithm, revealing a three‑stage pipeline that collects, ranks with machine‑learning models, and filters tweets to balance content from followed and unfollowed accounts while optimizing for user engagement.
Twitter announced that it is open‑sourcing the code that selects which tweets appear in the “For You” timeline, publishing the repositories on GitHub.
The recommendation pipeline consists of three main stages: first, it gathers the “best tweets” from various sources; second, a machine‑learning model ranks these tweets; third, it filters out tweets from blocked users, already‑seen tweets, or content deemed unsafe, before placing them in the feed.
In the initial collection step the system examines roughly 1,500 tweets, aiming for about 50 % of the timeline to come from accounts the user follows (the “in‑network” portion) and the other 50 % from accounts the user does not follow (the “out‑of‑network” portion). The ranking is optimized for positive engagement such as likes, retweets, and replies, while the final filter prevents too many tweets from the same author from appearing.
Elon Musk, who described Twitter 2.0 as a “city‑state of the internet,” said the move aims to increase platform transparency while protecting user safety and privacy. He emphasized that the open‑source release is intended to let independent third parties verify the content shown to users.
The code is available at https://github.com/twitter/the-algorithm , where the community can submit pull requests and issues. Twitter notes that it is building tools to manage these contributions and integrate approved changes into its internal repository.
While Musk has previously pledged to open the algorithm and has conducted polls showing strong user support for openness, the actual impact of community contributions remains to be seen.
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.
