Introduction
This blog is written for the “Algorithms" track of CoCode Blogs
Twitter is one of the most popular social media platforms in the world, with millions of users daily sharing their views and ideas. But have you ever wondered how the stuff on your feed is chosen? So, no more wondering!
In this blog post, we'll take a look at Twitter's Recommendation Algorithm, which is now open source, and see how the system picks the best tweets that are relevant to you. So, whether you're a long-time Twitter user or someone who's just starting, join me here as we delve deeper into the inner workings of this powerful algorithm.
Here's a figure that shows how important services and employment connect to form a 'For You Timeline'.
The core components of the 'For You Timeline' includes Candidate Sourcing, Ranking and Filtering. Let's cover each of these in detail.
Candidate Sourcing
Using a technique known as Candidate Sourcing, the algorithm finds a pool of 1500 tweets that a user could be interested in. Twitter accomplishes this by utilizing a directed and weighted graph that tracks user interactions.
Liking a tweet is an example of visible action, whereas implicit actions include clicking on someone's tweet or a link within the tweet, or visiting their profile page.
Out-of-network tweets are the second prospective source for Twitter's recommendation algorithm. Twitter considers what tweets the people you follow engage with and who likes similar tweets to you when making these recommendations.
It's worth noting that Twitter clusters together comparable profiles based on content, organization, or name strength. That is, if you are a celebrity, you will be grouped with other celebrities, and if you are an athlete, you will be grouped with other athletes.
As a result, more members of that community will see a tweet if it is popular within that community.
Your followers might not be interested in seeing you participate in topics outside of your normal sphere, thus Twitter will penalize you if you start sharing content in that area.
ML Ranking
Now that we've got these ~1500 best tweets in which the user might be interested, it's time to rank them. Several ranking criteria are included in the code, including a 20x boost for retweets, a 30x boost for likes, and a tiny boost for photos and videos.
A boost is also provided by becoming a Twitter Blue member, however, a debuff is provided if the account has a high number of mutes, blocks, or spam reports. Spelling mistakes and made-up terms are also debuffed, and there is a broad list of themes that will not be amplified, such as disinformation and abuse.
So if you want to enhance your tweets even more, incorporate photographs or videos, as these are also boosted. However, if you're publishing links, make sure to acquire engagement first, or your tweet may be flagged as spam.
Tweet mixing & Filtering
Once done with the ranking, now we're in the last stage of filtering out these tweets. The following elements work together to produce a well-balanced and diverse feed.
Visibility Filtering: Filter out/ Remove tweets from accounts you block or mute.
Author Diversity: Avoid multiple tweets from the same author.
Content Balance: Ensure a fair balance between In-Network and Out-of-Network Tweets.
Feedback-based Fatigue: Lower the score of certain Tweets if the viewer has provided negative feedback around it.
After filtering out the Tweets, Home Mixer comes into play. The algorithm then combines Tweets with non-Tweet material such as Ads, Follow Recommendations and Onboarding prompts.
And hence, we now have the full Timeline ready for the user.
Conclusion
In conclusion, Twitter's open-source publication of its recommendation algorithm provides a fascinating glimpse into how the platform operates.
It's interesting to see how Twitter puts similar users together, encourages certain behaviors over others, and prioritizes safety. So, the next time you're creating a tweet, keep these considerations in mind to maximize your platform reach.
I hope you found this post informative and engaging. While there may still be some information missing, I tried my best to share some valuable insights. If you have any doubts or suggestions feel free to write a comment below or ping me on Twitter.