Almost a year after Elon Musk first conceived the idea of publishing Twitter’s recommendation algorithm, the company has posted the source code of its recommendation algorithm on GitHub. In his Twitter space discussing the move, Musk said he hopes to help users find potential “problems” in the code and improve it.
“The first release of a so-called algorithm is very embarrassing and people will find many mistakes, but we intend to fix them very quickly.
In particular, the code released on Friday only deals with how tweets are displayed in Twitter’s “For You” feed. The company hasn’t disclosed the code underlying its search algorithm or how content is displayed on other parts of Twitter, but Musk said it will “definitely” open source the search algorithm as well.
and blog post The company gave an overview of how Twitter recommendations work and explained the different steps of the algorithm, including ranking and filtering. But Twitter users have already found interesting details in the code itself. For example, Jane Manchun Wong states that “Twitter’s algorithm clearly identifies whether the author of a tweet is Elon Her Mask.” This could provide yet another explanation for why Musk’s tweets appear so often. Wong also noted that the algorithm has labels to indicate if a tweet’s creator is a “power user” and if it’s a Republican or Democrat.
When asked about that aspect of the algorithm on Twitter Space, Musk said: A Twitter engineer later followed up, clarifying that the categories were “for statistical tracking purposes only and have nothing to do with algorithms.” He said that it was “so that the masks could be used in the same way,” but did not mention why the masks had their own category.
“But isn’t it strange that there are four categories and one of them is Elon?” the questioner replied. “I think it’s weird,” Musk said. “This was the first time I learned this.” A Twitter engineer didn’t directly reply with an explanation. The Twitter space he finished in less than a minute.