Musk's X releases source code for platform's algorithm

"No other social media companies do this," Elon Musk said

Published: January 20, 2026 3:02pm

Elon Musk's X on Tuesday released its source code for the social media platform's feed algorithm.

X's source code release is one of the first ever made by a large social platform, Cryptonews.com reported.

 "We know the algorithm is dumb and needs massive improvements, but at least you can see us struggle to make it better in real-time and with transparency. No other social media companies do this," Musk posted in a repost fronm the platform's engineering team,

His post was in response to the eam account post on Monday which reads: "We have open-sourced our new 𝕏 algorithm, powered by the same transformer architecture as xAI's Grok model."

Investor Mario Nawfal posted on X on Tuesday, sharing Musk's post, saying: "Every major platform has hidden behind 'proprietary technology' excuses for years. X just opened the black box.

"The code reveals a sophisticated system powered by Grok, xAI's open-source transformer. No manual heuristics. No hidden thumb on the scale. The algorithm predicts 15 different user actions and uses 'attention masking' to ensure each post is scored independently, eliminating batch bias. Most interesting? A built-in Author Diversity Scorer prevents any single account from dominating your feed," he continued.

"Researchers, competitors, and critics can now verify exactly how content gets promoted or filtered. Facebook won't do this. TikTok won't do this. YouTube won't do this."

Earlier this month, Musk posted on X regarding the release of the source code, "This will be repeated every 4 weeks, with comprehensive developer notes, to help you understand what changed."

The source code is primarily written in Rust and Python, and the model retrieves posts from two sources, including accounts that a user follows and a wider pool of content identified through machine-learning-based discovery, according to technical documentation, Cryptonews.com reported.

The posts from these sources are then scored based on predicted engagement, with higher-ranked content appearing more frequently in feeds.

The Facts Inside Our Reporter's Notebook

Unlock unlimited access

  • No Ads Within Stories
  • No Autoplay Videos
  • VIP access to exclusive Just the News newsmaker events hosted by John Solomon and his team.
  • Support the investigative reporting and honest news presentation you've come to enjoy from Just the News.
  • Just the News Spotlight

    Support Just the News