Twitter Reveals a Part of Its Code for Public Inspection

Twitter Reveals a Part of Its Code for Public Inspection

Twitter has now opened some of its source code to the public for inspection. This includes the algorithm used by the social media platform to recommend tweets to users. The revealed codes are now available to all on GitHub in the form of two repositories.

CEO Elon Musk had repeatedly promised to make the platform’s source code public to make it more transparent. In a blog post concerning the publication of the code, Twitter announced that this is its first step towards transparency. CEO Elon Musk had repeatedly promised to make the platform’s source code public to make it more transparent.

A brief overview of the revealed algorithm source code

The repositories published by Twitter on GitHub comprise code from several crucial parts of the social media network. These include the mechanism behind timeline recommendations – the algorithm Twitter uses to control which tweets appear on each user’s “For You” timeline.

The code consists of several models, including one meant to detect abusive or NSFW (Not Safe for Work) content.

The algorithm initially looks quite complex. However, considering the function it serves and all the technical processes involved, this isn’t surprising at all.

The models calculate the reputation of every Twitter user and determine the chances of their interaction with other users. However, the documentation didn’t clarify what exactly “reputation” means in this regard. The tweets on the timeline are ranked by several neural networks, which also recommend accounts to follow.

Twitter also assured that it hadn’t revealed any code that might potentially endanger the safety and privacy of its users. The same goes for any code which might compromise Twitter’s ability to combat child sexual abuse, manipulation, and bad actors on the platform in general.

As the town square of the internet, we’re ultimately doing this to foster transparency and build trust with our users, customers, and the general public.Twitter Blog Post

Besides transparency, Twitter also characterized its move to make the source code public as a step toward risk prevention. Musk later clarified on a Twitter Space session that the goal behind the move is to get the GitHub community to find and fix exploits in the platform’s code.

Musk expects users to find a lot of mistakes in Twitter’s source code

Musk admitted that people are going to find plenty of mistakes in the code, stating that he expects the initial release of the algorithm to be embarrassing. However, he also added that Twitter would be quick to fix the mistakes pointed out by users.

He went on to hint that the reveal of the recommendation algorithm code is aimed at addressing beliefs that Twitter might be manipulating users by deliberately promoting certain content.

Even if you don’t agree with something, at least you’ll know why it’s there and that you’re not being secretly manipulated.Elon Musk

Notably, Twitter released its source code at a time when the platform is surrounded by controversies regarding changes to the platform’s recommendation algorithm after Musk’s takeover. In November, for instance, users began to see more Tweets from users they do not follow. More recently, in February, Twitter engineers revealed that they had been asked by Musk to reconfigure the algorithm to grant his tweets increased visibility.

Krishi Chowdhary

Krishi Chowdhary

Krishi is an enthusiastic B2B and B2C content writer, always on the lookout to simplify software purchase decisions for businesses and help them improve their online presence and SEO.

Krishi's particular expertise includes writing educational material on customer relationship management (CRM) software and project management tools to help small business maximize their revenue.

Alongside his writing and blogging work, Krishi's other hobbies include studying the financial markets and cricket.