
Twitter on March 31, 2023, published a source code that reveals how its recommendation algorithm works. We are going to break down the complex explanations in the source code into simple words and steps.
How Twitter recommendation Algorithm works
According to the Twitter source code that was published on Github on March 31, 2023, there are three main steps that recommended tweets go through before they appear in your timeline.

Step 1: Choosing the best Tweets to recommend
Twitter indexes every tweet and adds it to its recommendation index. The algorithm then picks the best tweets to recommend to you through a process Twitter calls candidate sourcing.
The best tweets to recommend “for you” are based on 50% of your network (people you follow). The remaining 50% of the recommendations are based on people you do not follow. The mechanism that Twitter uses to recommend Tweets from people you don’t follow involves considering factors like tweets that are similar to your interests, which topics you follow, the tweets you recently engaged with, what is popular in your network, and what you liked.
Step 2: Ranking recommended tweets
After Twitter has gathered Tweets to recommend to you based on the users you follow and those you don’t follow, its algorithm now has the task of ranking the Tweets. For example, if the algorithm has selected 1000 Tweets to recommend to you based on all the factors mentioned above, it begins scoring the tweets. Scoring helps in predicting which Tweets will appear first or on top of your recommendations. Twitter uses its neural network to learn and rank recommended tweets based on likes, retweets, replies, etc.
Step 3: Filtering recommended tweets
The last step involves filtering tweets that you do not what to appear on your timeline based on factors like people you have blocked or muted, repetition, content type, tweets you reported, freshness, etc.
The Twitter recommendation algorithm source code is available for download from GitHub.
Before you leave, Subscribe to our Newsletter to be updated via email when Blogging Tools you use to run your blog release new features or make critical changes. For any question about this post, or anything else related to website technologies, we are responding on Reddit or comment below.
Leave a Reply