Twitter reveals some of its source code, including its recommendation algorithm

As repeatedly promised by Twitter CEO Elon Musk, Twitter has opened a portion of its source code, including the algorithm it uses to recommend tweets in users’ timelines, for inspection.

On GitHub, Twitter published two repositories containing the source code for many parts of the social network, including the mechanism it uses to control the Tweets users see on the For You timeline. In a blog post, Twitter characterized the move as a “first step to be more transparent” while at the same time preventing risk to Twitter itself and people on the platform.

On that second point, the open source releases don’t include the code that powers Twitter’s ad recommendations or the data used to train Twitter’s recommendation algorithm. And they include few instructions on how to inspect or use the code.

“[We] excluding any code that would compromise user safety and privacy or the ability to protect our platform from bad actors, including undermining our efforts at combating child sexual exploitation and manipulation,” Twitter wrote. “We [took] steps to ensure that user safety and privacy would be protected.”

Twitter says that it’s working on tools to manage suggestions from the community and sync changes to its internal repository.

At first glance, algorithm is fairly complex — but not necessarily surprising in any way from a technical standpoint. It’s made up of multiple models, including a model for detecting “not safe for work” or abusive content, the likelihood of a Twitter user interacting with another user and calculating a Twitter user’s “reputation.” Several neural networks are responsible for ranking the tweets and recommending accounts to follow, while a filtering component hides tweets to “support legal compliance, improve product quality, increase user trust, protect revenue through the use of hard-filtering, visible product treatments and coarse-grained downranking.”

Twitter reveals some of its source code, including its recommendation algorithm by Kyle Wiggers originally published on TechCrunch

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.