From the archive
Twitter open sources a portion of its code on GitHub, including its algorithm for recommending tweets in For You but excluding its ad recommendation algorithm
As repeatedly promised by Twitter CEO Elon Musk, Twitter has opened a portion of its source code, including the algorithm it uses …
Context & ripple effects
Twitter’s release follows an earlier debate over whether source code alone can make a recommendation system intelligible when its behavior also depends on data and operational context. That limitation is central to the subsequent researchers’ finding that the For You release lacked enough context to fully account for recommendations.
The scope also stops at advertising recommendations, drawing a practical boundary between visibility into the consumer feed and the system tied to monetization. Earlier proposals went further, envisioning a marketplace for user-selectable algorithms rather than a one-time code disclosure.
Ripple effects
First-order effects
- Developers and researchers can inspect and test the released For You recommendation code, giving Twitter a concrete artifact against which to assess its public transparency claims.
- Twitter retains control over ad recommendation logic; advertisers and outside auditors do not receive equivalent visibility into the monetization-side ranking system.
Second-order effects
- Public scrutiny can shift from broad claims about algorithmic opacity to specific implementation choices in the released feed code, while missing data and deployment context limit what outside review can establish.
- The split release makes commercial ranking systems a more visible fault line: platforms can disclose parts of consumer-facing recommendation infrastructure without exposing advertising optimization.
Third-order effects
- If partial releases become the standard, algorithmic transparency may increasingly mean publishable code plus selective operational disclosure—not independently reproducible explanations of what users actually see.
- The more durable governance question is whether users and auditors gain meaningful choice or accountability; source availability alone does not create either, as the earlier expert critique of code-only transparency anticipated.
Related coverage
- Twitter Recommendation Algorithm
- Twitter Shares Some of the Secret Sauce Behind How It Works
- Elon delivers on Twitter promise to Open Source the algorithm, first embarrassing issue found
- Twitter takes its algorithm ‘open-source,’ as Elon Musk promised
- Twitter open-sources recommendation algorithm code
More related coverage
- Twitter towards algorithmic transparency by making its source code public
- Twitter Pulls Back The Curtain On Its Recommendation Algorithm
- Twitter Publishes its Tweet Ranking Algorithm Data on GitHub, Providing More Transparency in Process
- Twitter's recommendation algorithm is now on GitHub
- Twitter releases its algorithm to the world, making it the first platform to bring transparency to social media
- Twitter's recommendation algorithm is now open source. — Interesting to see the language diversity: — Scala (53.8%) — Java (29.7%) …
- I have been working on Twitter's recsys for years, my team together with the home team built the heavy ranker, but I would not have imagined …
- If you haven't checked out Twitter yet, Elon Musk has decided once again to open source Twitter's code base, starting with the recommendation system, https://github.com/... …
- one of the ways that Twitter tests it's NSFW text classifier? — the string “xxx 🍑” — https://github.com/...
- Elon Musk appears to offer $1 million bounty to ‘convict’ those responsible for Twitter ‘botnets’
- There are no files selected for viewing
- Elon Musk published Twitter's secret algorithm and got cheers, jeers, and lots of bafflement — 'Nobody's going to make heads or tails of this'
- Twitter posts the code it claims determines which tweets people see, and why
- Twitter Releases Ranking Source Code Ahead of Verified-Check Removals
- Twitter Admits It's Been Forcing Elon Musk on Your Timeline
- Twitter's Recommendation Algorithm Is Now Open Source
- Twitter makes some of its source code public
- Someone at Twitter is trying to delete data from from a git repository — Please pass the popcorn
- The commit where Musk force pushed to main to remove himself from “the algorithm” is now going to be my favorite commit to use while developing at work. Thanks. — https://github.com/...
Discussion
Twitter's Recommendation Algorithm
A new era of transparency for Twitter
You can tell that they were added very very recently because author_is_elon is above those lines, and additions are very clearly made by appending them to the file with no other ordering applied. …
More discussion
Hardworking Twitter engineers scrubbing the Elon parameters I have some bad news for you about how git works
WHERE THE HELL IS AUHTOR_IS_CHOCK
They didn't turn off Issues or Pull requests, and you can imagine what's going on inside each.
The new stuff in the Twitter algorithm is wild. — “author is elon”, “author_is_republican”, “author_is_democrat”, etc., are explicit terms that are special cased. — https://github.com/...
Twitter recommendation source code now available to all on GitHub https://github.com/...
Today marks a new era of transparency for Twitter. 🧵 We're sharing much of the source code that powers our platform with the world. Visit our blog to learn more about this initiative: https://blog.twitter.com/...
oh my god. i swear to you this is real. the algorithm source code literally has a carve out just for elon's posts https://twitter.com/...
Most of the recommendation algorithm will be made open source today. The rest will follow. Acid test is that independent third parties should be able to determine, with reasonable accuracy, what will probably be shown to users. No doubt, many embarrassing issues will be... https:…
The code that was released today doesn't show the parts that actually alter the scores of Elon and other users. The part of the code referenced below just tracks Elon stats (from what I know). Employees removed most PII before the code was released. https://twitter.com/...
Musk being asked about this live on Spaces right now. Says “it shouldn't be there.” “There's a ton of stupid and embarrassing things being shown by making the code open source.” https://twitter.com/...
The 4 types of Twitter posters, according to the just open-sourced algorithm 😯 https://github.com/... https://twitter.com/...
Still, apparently Elon is pretty displeased this part of the code was released 🙃
Twitter “the-algorithm” repo is now public https://github.com/... https://twitter.com/... https://twitter.com/...
lmaooo someone submitted a pull request called “better recommendations on timeline” and all it does is hide the tweets of anyone who pays for twitter https://twitter.com/...
incredible https://github.com/... https://twitter.com/...
Twitter's algo is LIVE on @sourcegraph with FULL compiler-accurate code nav! 👇 https://sourcegraph.com/... https://twitter.com/...
On a Twitter Space, Elon is disavowing the part of the code that classifies users as Democrat or Republican, says it should be removed. He didn't address the “author_is_elon” classifier. https://twitter.com/...
Twitter open-sourced its algorithm: https://github.com/...
Twitter's algorithm specifically labels whether the Tweet author is Elon Musk besides the democrat, republican and “VIT” / “Power User” (I think it means legacy verified) labels https://github.com/... https://twitter.com/...
Twitter just released source code for “the algorithm” Oh, what file is this? Predicates for tweets on the home timeline? Oh what is that 2nd image? https://twitter.com/...
Twitter will be updating its recommendation algorithm based on user suggestions every 24 to 48 hours
More than anything, this is incredibly US-centric. Most of the world isn't a Democrat *or* Republican. https://twitter.com/...
suddenly all the reduced engagement for some of us and exploding engagement for others makes sense https://twitter.com/...
He has no idea what is going on with his website https://twitter.com/...
hovering 7 inches off the ground https://twitter.com/...
More transparency to build trust - today we're open sourcing our code, and providing detail on how our recommendation algorithm works. https://twitter.com/...
Wait, it's not enough that we have to provide all the content for Twitter, now we have to write the code? https://twitter.com/...
I love open source https://twitter.com/...
.@elonmusk has taken a monumental step towards restoring transparency and trust in Twitter and tech companies worldwide by publishing its algorithmic code and spending time discussing it w the public in an open forum. https://twitter.com/...
Having an if-elon-then-plusgood in the code wouldn't surprise or bother me tbh. I mean it's *his* site and at least it's nakedly transparent But Elon didn't know this flag existed, nor did his team bother to tell him? And yet he wants to rebuild the codebase from scratch? LOL htt…
The Twitter algorithm is now on GitHub. Conservatives can now prove they are being shadow banned. 🙃 https://twitter.com/...
Pretty great that Twitter hosted this on GitHub, which it hit recently with a subpoena to compel it to unmask the person who leaked its whole source code.
@wongmjane And there is already an issue to remove it 🤣https://github.com/...
Ah, well, then, this explains it all. https://twitter.com/...
This is a huge deal. Could very well be the Rosetta Stone of modern digital censorship. Every major social media company should follow Twitter's lead. https://twitter.com/...
America's four political parties. https://twitter.com/...
Ok @tiktok_us @facebook @instagram @YouTube, you're up... tell us how you're programming us and our kids #transparency https://twitter.com/...
When you hard code the CEO into your ranking algorithm Can't believe this is real but it is https://github.com/... https://twitter.com/...
The guy who is speaking on a Twitter space with Elon Musk right now has a pinned tweet featuring a video of himself sucking on someone's toes. Twitter 2.0, baby.
read: can y'all please help us figure out how this algorithm works cuz everyone who knew is now gone https://twitter.com/...
This shit is truly hilarious. It's reported he threw a fit because of his lower engagement and so they boosted him. And then he can't explain on a call about the open sourcing of the algorithm why there'd be an explicit flag just for him. It's so great. https://twitter.com/...
I asked ChatGPT-3 to analyze the Twitter source code: https://twitter.com/...
This is great. Get all the gremlins out! @ElonMusk https://twitter.com/...
the discussion on this Elon Musk open algorithm space can best be summarized as https://twitter.com/...
That wasn't so hard... now let's see the @instagram algorithm and what it's doing to teenage girls @finkd https://twitter.com/...
I had ChatGPT analyze the twitter source code to find out how to go viral. This is what I found. https://twitter.com/... https://twitter.com/...
Twitter has made its recommendation algorithm open source, incl its models to detect toxic tweets, abusive content and NSFW material. It's a huge act of faith and it'll be interesting to see how it will deal with those who inevitably try to exploit it. https://github.com/...
Boom, #TheAlgorithm is live! https://github.com/... https://blog.twitter.com/... /tip @techmeme
PS: People saying, “Meh, the module is just for collecting data on whether various A/B feature changes end up being good or bad for Elon personally” do not seem to understand how very entertaining it is to see Elon inserting “Benefit to Me” as an evaluation metric.
Twitter's algorithm specifically labels whether the Tweet author is Elon Musk “author_is_elon” besides the Democrat, Republican and “Power User” labels https://github.com/... https://twitter.com/... https://twitter.com/...
I asked Elon Musk why his name is hard coded here in Twitter Algorithm repo; you can listen to the answer yourself... and the Space finished right after that 🤭 https://github.com/... https://twitter.com/...
Part of Twitter's algorithm specifically designates Jack Dorsey, Katy Perry, Stephen Curry and Barack Obama as “testing accounts” for getting random Tweets for testing, with an emphasis on Katy Perry in particular https://github.com/... https://twitter.com/...
I wish the engineer won't be fired today... https://twitter.com/...
6) FT: “Still, apparently Elon is pretty displeased this part of the code was released.” 🙃 https://twitter.com/...
Musk said he had no idea it was doing that! https://mashable.com/...
Unless the Democrat/Republican tags are assigned only to elected officials... wtf does this mean? Are the scrapping voter registration databases and cross referencing? Vibes? What? https://twitter.com/...
Given the purchase price, he deserves it. https://twitter.com/...
elon was asked about this on Twitter Spaces and he said “this is the first time i'm seeing this” and said they should change it he also decided that the person who asked him about it would be the last speaker and ended the Space right after https://twitter.com/...
Told you 🤦♂️ This is because legacy checkmarks get a low weight and the system needed a way to differentiate Elon Musk since he has the same legacy checkmark ✅ https://twitter.com/...
It's even funnier to think they tried to remove all the places where Elon had been hard coded into the Twitter algorithm before releasing the code but missed one. $44B to become the most popular user on Twitter🤦🏾♂ ️https://twitter.com/... https://t.co/XdR8GhGesD
Elon Musk is really such a weakling. https://twitter.com/...
Ahhhhhh the hallmark of our modern democracy, the four political party system of the US https://twitter.com/...
Twitter's algorithm is specifically tracking tweet metrics for four groups: - power users - republicans - democrats and... - elon musk https://twitter.com/...
1. Likes, then retweets, then replies Here's the ranking parameters: • Each like gets a 30x boost • Each retweet a 20x • Each reply only 1x It's much more impactful to earn likes and retweets than replies. https://twitter.com/...
Twitter revealed its algorithm to the world. But what does it mean for you? I spent the evening analyzing it. Here's what you need to know:
https://twitter.com/...
This has been a big priority for Musk — one he's specifically called out with individual scams that he's seen / others have pointed out to him. https://twitter.com/...
Like, he's just awful, but the thing is here, if he just said, “Yeah, I bought the fucking thing, it's mine, so I'll shove every one of my tweets into your timeline cos I fucking can”, I'd respect that. I'd block him (I have anyway) but I'd respect it. But this pretend nonsense🙄 …
Twitter didn't just open source their recommendation algorithm. They also revealed how you get a perfectly stable and fast CI: exit 0 https://github.com/...
Twitter has removed that code in this commit 🥸 https://github.com/...
Twitter's algorithm downranks crypto spams 😌 https://github.com/... https://twitter.com/...