Site iconSite icon ForkLog

Twitter published the source code of its recommendation algorithm

Twitter published the source code of its recommendation algorithm

Twitter has posted on GitHub part of the source code for its recommendation algorithm that drives tweets into the ‘For you’ tab.

Owner of the social network Elon Musk warned that the source code may appear “offensive” and pledged to fix the bugs “as soon as possible.”

Elon Musk’s tweet promotion

In the first hours after the source code was published, enthusiasts spotted variables that likely boosted Musk’s tweets in the feed for all users.

It appears that the algorithm compared how the tweets of the social network’s owner, Republicans and Democrats spread. However, from the code it is not clear whether this refers only to politicians or to all supporters of both parties.

When Musk was asked about this aspect in the audio room, he said:

“I agree that this should not be there … this certainly should not divide people into Republicans and Democrats; it doesn’t make sense.”

Later, a Twitter engineer explained that the categories were intended “solely for tracking statistics and have nothing to do with the algorithm.” In his words, this was necessary to “ensure impartiality toward all groups.” However, none of them explained why an entire category was devoted to Musk.

“I think this is strange. … This was the first time I learned about this,” — the billionaire said.

The audio room ended less than a minute after the discussion.

Tweet rankings

The source code contains a weighting of actions with content that affects which tweets appear in the ‘For you’ feed. It emerged that the algorithm places the greatest weight on likes — 30 points. Next come retweets — 20 points. Twitter Blue subscribers can receive from two to four points.

Критерии, влияющие на ранжировку твитов в ленте «Для вас». Данные: Twitter.

The ‘For you’ feed also shows more posts from the Close Circle and posts with photos or videos.

Tweets that are empty or contain only a link are ranked lower.

Ukraine Crisis and elections

Users who studied the files found strings relating to the “Ukraine Crisis” (UkraineCrisisTopic). This category is in the “safety labeling” section and sits alongside topics such as misinformation, bullying and content for adults.

«Ukraine Crisis» in the list of safety markers. Data: Twitter.

Due to the lack of comments on the code, it is not possible to say in which cases these labels are applied. Judging by their content, they may affect the overall tweet ranking.

Similar labels were used during elections in Brazil, the United States, the Philippines and France, as well as in relation to the coronavirus vaccine. At present they are marked as “deprecated”.

«Устаревшие» метки, связанные с выборами и вакциной. Данные: Twitter.

Opening of the source code of the recommendation algorithm was one of Musk’s main promises before buying Twitter. In May 2022, the billionaire accused the tweet ranking system of manipulating users.

In October 2022, Musk closed the deal to buy Twitter for $44 billion.

In March 2023 he announced the publication of the source code of the recommendation algorithm.

Exit mobile version