On March 31, Twitter published on the Github platform, widely used by developers, several parts of its source code, that is to say the instructions in computer language that govern the operation of its social network.

In particular, it unveiled its recommendation algorithm, which selects and organizes tweets in the "For you" tab.

Parts of the code had already leaked a few days earlier on Github but Twitter had requested their removal.

Few companies lift the secrecy on their computer code, which represents a competitive advantage. However, some organizations choose to develop "open-source" to allow third-party developers to improve their program.

Twitter had done this in 2021 with its algorithm for cropping photos, accused of racist bias.

Elon Musk says he was inspired by Bitcoin, a cryptocurrency whose code is freely available so that everyone can check the absence of flaws.

Inspired by the continuous stream of videos scrolling on TikTok, the "For you" tab presents a list of tweets half from the accounts to which the user is subscribed, half from the entire network.

To do this, Twitter finely analyzes user behavior, estimates their "reputation" and groups together those with similar interests.

Each user is placed in 145,000 "communities," social circles updated every three weeks that can group anywhere from a few thousand to hundreds of millions of accounts, Twitter explains in a blog post.

The "Pop" community has 332 million users, including Katy Perry, Rihanna and Justin Timberlake. The "Bollywood" community includes 80 million people.

"Claiming transparency"

"The more users in a community like a Tweet, the more that tweet will be associated with that community" and promoted by the algorithm, Twitter explains. Conversely, publishing on very different topics will be devalued.

This operation, reminiscent of the "filter bubbles" long denounced by social network experts, maximizes user engagement but tends to reduce the diversity of content and opinions shared within a community.

The code also reveals that "likes" influence the popularity of a tweet much more strongly than "retweets" or even replies.

Finally, subscribers to the new paid offer Twitter Blue are favored by the algorithm, as indicated by Elon Musk.

Twitter has chosen not to disclose at this stage the training data of its algorithm, nor the parameters of the artificial intelligence models associated with it.

Its justification: not to "compromise the safety and privacy of users" or "undermine (its) efforts to combat the sexual exploitation and manipulation of children."

But, for journalist Nicolas Kayser-Bril, a specialist in the study of algorithms, "it is not possible to understand a program by reading only the code. You have to be able to run it on a computer."

"Releasing large amounts of code without instructions can be worse than unnecessary. This makes it possible to claim transparency while making a real audit impossible," he wrote in a newsletter.

The role of certain published pieces of code also raises questions, especially those referring to election periods or whether the author of a tweet is a Democrat, Republican or Elon Musk himself.

According to the Digital Services Regulation that comes into force this year in the European Union, "very large platforms" with more than 45 million active users, such as Facebook, Instagram or Tiktok, will have to allow the authorities to study their algorithms.

Questioned recently by a Senate commission of inquiry, the director of technologies of the CNIL, Bertrand Pailhès, said he had not yet decided on this obligation, which applies for the moment in France only to public algorithms.

"You have to keep in mind that publication can also reveal security issues. This is something that must be done with precautions," he said.

© 2023 AFP