Twitter has released some of its source code, including its algorithm for recommending tweets in users’ timelines, as promised by CEO Elon Musk.
Twitter revealed two repositories on GitHub with code for numerous areas of the social network, including its For You timeline control mechanism. Twitter called the move a “first step to be[ing] more open” and “[preventing] danger” to itself and its users a blog post.
Musk stated, “Our initial release of the so-called algorithm will be extremely humiliating, and people will identify many faults, but we’ll correct them very rapidly. “Even if you don’t agree with something, at least you’ll know why it’s there and that you’re not being surreptitiously controlled… The parallel we’re striving for is the magnificent example of Linux as an open-source operating system… One may, in principle, uncover numerous vulnerabilities in Linux. Then, the community fixes those exploits.”
The open-source releases don’t include Twitter’s ad recommendation code or data. They also provide little instructions on inspecting or using the code, confirming that the releases are developer-focused.
“[We excluded] any programming that might threaten user safety and privacy or the capacity to safeguard our platform from criminal actors, including weakening our efforts at preventing child sexual exploitation and manipulation,” Twitter added. Twitter’s ethical AI and trust and safety crew, which moderated material and protected users, was sacked weeks earlier. However, the business claims it “[took] efforts to guarantee that user safety and privacy would be maintained” with today’s code release.
Twitter is developing tools to handle community code recommendations and sync changes to its internal repository. There’s no evidence of those, but they’ll likely be released later.
“We’ll look for recommendations, not simply on issues but also on how the algorithm should work,” Musk stated on Spaces. “It’ll evolve. I wouldn’t anticipate it to keep rising, but we’re open to improving the user experience.”
The algorithm is sophisticated but technically not surprising. The high-level documentation doesn’t define “reputation,” but several neural networks rank tweets and recommend accounts to follow, and a filtering component hides tweets too —
Twitter describes its recommendation process in an engineering blog post:
“We strive to extract the finest 1,500 tweets from a pool of hundreds of millions… Currently, the For You timeline consists of 50% [tweets from people you don’t follow] and 50% [from people you follow] on average, but this may vary from user to user,” Twitter noted. In addition, a ~48-million-parameter neural network is continually trained on Twitter interactions to optimize for positive engagement (likes, retweets, and replies) to rank tweets.
Of course, Twitter users only view 1,500 tweets. The algorithms filter tweets based on content limitations, “negative feedback,” and whether they’re mostly from the same Twitter account or barred or muted individuals.
Twitter’s VIP list isn’t public, according to Gizmodo. However, Platformer revealed this week that Twitter utilizes a rotating list of notable users, including YouTuber Mr. Beast and Daily Wire creator Ben Shapiro, to monitor changes to the recommendation algorithm by raising the prominence of these “power users” seemingly at will.
Further data suggest the algorithm treats tweets differently by source. According to researcher Jane Manchun Wong, Twitter’s algorithm designates tweet authors as Elon Musk, “power users,” Republicans, or Democrats.
At the Spaces session this afternoon, a Twitter programmer said labels were strictly for analytics. Musk, who hadn’t seen the labels until today, said they shouldn’t be there.
Musk added, “It shouldn’t be splitting people into Republicans and Democrats; that makes no sense.
The source code was released following multiple Twitter recommendation algorithm concerns. In February, Musk asked Twitter developers to change the algorithm to boost his posts, according to Platformer. After user outcry, Twitter reverted its November shift to show more messages from individuals they don’t follow.