1. Skip to content
  2. Skip to main menu
  3. Skip to more DW sites

Twitter reveals code showing why tweets pop-up

April 1, 2023

Twitter published the source code for its recommendation algorithm and owner Elon Musk has promised more.

https://p.dw.com/p/4PahP
The Twitter account of Elon Musk is displayed on a mobile phone screen with Twitter logo in the background
Musk said code transparency would lead to higher trust among users and rapid improvements to the productImage: Muhammed Selim Korkutata/AA/picture alliance

Twitter made parts of its source code, including the recommendations algorithm, public.

The social media company uploaded the code in two repositories on the code-sharing platform GitHub.

Twitter owner Elon Musk, confirmed the move on Saturday, promising to publish more of the code in the next few weeks.

"In the coming weeks, we will open source literally everything that contributes to showing a tweet," Musk wrote on Twitter.

Why it matters

The recommendations algorithm source code explains why tweets appear on a user's "For you" timeline.

Making it public addresses common concerns among users and lawmakers, who increasingly scrutinize social media platforms over how algorithms select the content users see.

"Providing code transparency will be incredibly embarrassing at first, but it should lead to rapid improvement in recommendation quality," Musk wrote on Twitter.

He said the company would regularly update the algorithm based on user feedback.

During a discussion about the source code on Spaces, Twitter's audio chat feature, some users questioned why Twitter's code appeared to classify users as Republicans or Democrats.

Musk said it shouldn't happen and the company would remove it.

Source code previously leaked

Twitter decission to publish the source code came after portions of it were already leaked on Github earlier this year.

Musk was seeking information on the person responsible for the leak.

The US District Court for the Northern District of California ordered Github earlier this week to reveal the identity of the user who posted it.

lo/jcg (dpa, Reuters)