This is how the Twitter algorithm works, after being leaked on GitHub

A few days ago, for some reason, Twitter's content recommendation algorithm was leaked on GitHub. A few days have been worth to be able to analyze all the variants that are recommended and thus have more visibility. We break down the most important points according to the analyst below Aakash Gupta has shown in a thread about it.
Table of Contents
The priority on Twitter is the likes
These are the classification parameters when promoting content to other users in the recommendation tabs.
- Each like gets a 30 boost.
- Retweets give a boost of 20.
- Each reply to a tweet only gives a boost of 1.

It is much more impressive to gain likes and retweets than responses. There you can see that they are looking for things that people like. Here lies that the Likes are totally public, to indicate to the people who visit a profile what the person who carries it likes. Although the Like is also widely used by people to indicate that they have read a response to something that has been sent to them. But it is seen that It is encouraged that things that people like are published, not so much that I share it because the sharing option is used to criticize the content, especially misinformation and hoaxes.
Pictures and videos help.
Have you seen that many people upload threads in which each message has a gif? As it turns out, those messages are more driven. It is seen that the plain text does not help much or interest. Doing so gives a boost of 2, regardless of whether it's a video, gif, or image.
The links could be frowned upon, unless you have a lot of interaction
Many people complain that if they put links, people do not visit them and do not see it. Although it is true and there is some human factor, because not everyone is interested in seeing a link; It is true that if you do not have many interactions, an account can be classified as spam.
The idea here makes sense from the point of view of the social network: you want people to be on your own social network. An account that is dedicated to constant promotion driving people out of it is traffic and impressions that it is taking away. But that does not happen if the account has a lot of interaction, such as those of the most followed people. And it is that nobody wants to take away people with millions of followers, because kicking someone out of a social network is to motivate people who use the social network to follow them, to leave.
Although this is not something that is fully confirmed. Since the source code of the Twitter recommendation algorithm on Github is relatively out of date.
Silences and unfollows hurt
It has been seen in the Twitter algorithm that it does not like someone to be silenced, blocked, unfollowed, reported for spam or to make reports of abuse by the account. Basically, they cause an account to be categorized as spam and not promote it.
Twitter Blue helps, that's what you pay for
In the last months, Elon Musk has been desperate to get people to pay for Twitter Blue. Although it has added functionality, it has been sold as helping you reach more people. And according to the Twitter algorithm, it is true that there is a factor that increases visibility. Specifically, depending on whether or not you're listed as someone to promote more.

Now, is Twitter Blue worth that extra $8 a month? It depends on whether your business is heavily Twitter based or not.
misinformation is frowned upon
Months before Elon Musk bought Twitter, a system was introduced where the public can report misinformation, intentional or otherwise. This is expected to combat misinformation, and alert accounts that are constantly spreading misinformation.
In this category of code, it is seen that it usually flags users who encourage harmful behaviors and activities, posting URLs from sites suspected of posting false, not satirical, information; False information about civil integrity, for medical reasons, to users who have been claimed for copyright, those who spread hate messages, those who glorify violence, and those who are considered toxic characters. Also those who report information on the war of Ukraine.
You are in a group, stay in it
In the code of the Twitter algorithm, it has been seen that after a while, it tends to group users, especially those who are celebrities and the media, into different groups. That means that if you are included in a group, you will be recommended to that group. The groups that have been seen in an example are the following:
News
- The Associated Press
- Reuters
- The Guardian
- CNN
- The Wall Street Journal
NBA
- Kyle Irving
- James Harden
- Carmelo Anthony
- Chris Paul
- Anthony Davis
Pop music
- Jennifer Lopez
- Selena Gomez
- Rihanna
- Lady Gaga
- Katy Perry
- Justin Timberlake
Bollywood
- arjun rampai
- Boman Irani
- Bipasha basu
- Sushim Sen
- Harah Khan
Soccer
- Manchester City
- Sergio Ramos
- Karim Benzema
- Gareth Bale
- Real Madrid
As you can see, groups are highly specific, and more that we have not shown. For example, it does not include athletes and sportsmen in a single group, but rather subdivides between the NBA and soccer, since it is possible that there are users who are fans of one of the sports without mixing. Or both.
How important are the groups? What has been seen in the algorithm itself, that if people from outside those circles are answered, they are promoted less. For example, celebrities responding to WWE content to congratulate them on something, makes them less visible. If you are classified as a soccer fan and you talk about movies, less is promoted.
Keep a clean spelling and you won't get penalized
Who hasn't happened to post a message thinking it could go viral and after sending it you see that it has a grammatical or writing error? Well, penalize that too. Twitter wants everyone to write correctly and not speak in made-up languages. It has not been specified if a dancing letter is enough or if the language is practically unintelligible, like someone who writes skipping many spelling rules as if they were writing an SMS and saving letters.
Following many people while few follow you does not help
This will especially affect new accounts. It is normal to start following various accounts of interest and not many people follow them, since they are mainly your already known friends, not people you have met through the social network.
To combat this, they recommend using the lists option. This groups multiple accounts into a private feed, and does not count as being followed by the user.
Governments can intervene
Either to silence content, or to boost electoral content, a government can ask Twitter to promote certain content.
How to optimize the Twitter algorithm
Analyst Askash Gupta has given the following advice on the algorithm, in summary form:
- A like is more important, then a retweet, and then a reply.
- Stay within your circle of interest.
- Putting links, being silenced or blocked or putting disinformation, penalizes.
- Putting images or videos helps.
- Twitter Blue increases visibility.
- Inventing words or misspelling them penalizes.
It's nothing that hasn't been said before. It is basically following a normal behavior, not very toxic and above all, appearing human. They don't want a person continually promoting offline links, or being flooded with misinformation, which we can bet they don't want advertisers to be scared off.
So now what?
Now, Twitter should rethink how it works, especially to prevent it from being abused. Tom Scott already commented years ago in a video about why it is not known exactly how the YouTube algorithm works, that if something was known that would boost recommendations, many people would abuse it.
Now that many people know about it, people might start looking for ways to abuse it to get visibility by knowing the tricks to get more visibility with the Twitter algorithm. It is also pro to see if it is easy to abuse it.



