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 …
TechCrunch Kyle Wiggers
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.
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.
The trend: This is one data point in the shift from opaque platform ranking toward selectively inspectable recommendation systems, with real transparency depending on the data, runtime context, and choices disclosed alongside code.
Related: Twitter · GitHub · Portable weights, governed runtime · Researchers question context in Twitter’s For You code release · Experts on the limits of algorithm open sourcing · Proposal for a marketplace of social algorithms
Related Coverage
- Twitter Recommendation Algorithm Twitter on GitHub
- Twitter Shares Some of the Secret Sauce Behind How It Works Wall Street Journal
- Elon delivers on Twitter promise to Open Source the algorithm, first embarrassing issue found techAU · Jason Cartwright
- Twitter takes its algorithm ‘open-source,’ as Elon Musk promised The Verge · Mitchell Clark
- Twitter open-sources recommendation algorithm code BleepingComputer · Sergiu Gatlan
- Twitter towards algorithmic transparency by making its source code public Livemint
- Twitter Pulls Back The Curtain On Its Recommendation Algorithm SlashGear · Quentyn Kennemer
- Twitter Publishes its Tweet Ranking Algorithm Data on GitHub, Providing More Transparency in Process Social Media Today · Andrew Hutchinson
- Twitter's recommendation algorithm is now on GitHub Engadget · Karissa Bell
- Twitter releases its algorithm to the world, making it the first platform to bring transparency to social media Tech Startups · Nickie Louise
- Twitter's recommendation algorithm is now open source. — Interesting to see the language diversity: — Scala (53.8%) — Java (29.7%) … Parkash Heerani
- 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 … Wenzhe Shi
- 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/... … Saif Ul Islam
- one of the ways that Twitter tests it's NSFW text classifier? — the string “xxx 🍑” — https://github.com/... @jeremybmerrill@journa.host · Jeremy B. Merrill
- Elon Musk appears to offer $1 million bounty to ‘convict’ those responsible for Twitter ‘botnets’ Insider · Ryan Hogg
- There are no files selected for viewing GitHub
- 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' Fortune · Kylie Robison
- Twitter posts the code it claims determines which tweets people see, and why Ars Technica · Kevin Purdy
- Twitter Releases Ranking Source Code Ahead of Verified-Check Removals The Information
- Twitter Admits It's Been Forcing Elon Musk on Your Timeline New Republic · Prem Thakker
- Twitter's Recommendation Algorithm Is Now Open Source Gizmodo · Kevin Hurler
- Twitter makes some of its source code public Reuters
- Someone at Twitter is trying to delete data from from a git repository — Please pass the popcorn @thomasfuchs@hachyderm.io
- 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/... @nova@hachyderm.io
Discussion
-
Twitter
Twitter
on x
Twitter's Recommendation Algorithm
-
Twitter
Twitter
on x
A new era of transparency for Twitter
-
@rodhilton@mastodon.social
Rod Hilton
on mastodon
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. …
-
@kjhealy@mastodon.social
Kieran Healy
on mastodon
Hardworking Twitter engineers scrubbing the Elon parameters I have some bad news for you about how git works
-
@chockenberry@mastodon.social
Craig Hockenberry
on mastodon
WHERE THE HELL IS AUHTOR_IS_CHOCK
-
@kjhealy@mastodon.social
Kieran Healy
on mastodon
They didn't turn off Issues or Pull requests, and you can imagine what's going on inside each.
-
@danluu@mastodon.social
Dan Luu
on mastodon
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/...
-
@elonmusk
Elon Musk
on x
Twitter recommendation source code now available to all on GitHub https://github.com/...
-
@twittereng
@twittereng
on x
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/...
-
@mnateshyamalan
Soul Nate
on x
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/...
-
@elonmusk
Elon Musk
on x
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:…
-
@zoeschiffer
@zoeschiffer
on x
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/...
-
@broderick
Ryan Broderick
on x
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/...
-
@amasad
Amjad Masad
on x
The 4 types of Twitter posters, according to the just open-sourced algorithm 😯 https://github.com/... https://twitter.com/...
-
@zoeschiffer
Zoë Schiffer
on x
Still, apparently Elon is pretty displeased this part of the code was released 🙃
-
@wongmjane
Jane Manchun Wong
on x
Twitter “the-algorithm” repo is now public https://github.com/... https://twitter.com/... https://twitter.com/...
-
@mnateshyamalan
Soul Nate
on x
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/...
-
@colin_fraser
Colin Fraser
on x
incredible https://github.com/... https://twitter.com/...
-
@beyang
@beyang
on x
Twitter's algo is LIVE on @sourcegraph with FULL compiler-accurate code nav! 👇 https://sourcegraph.com/... https://twitter.com/...
-
@kateconger
Kate Conger
on x
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/...
-
@kateconger
Kate Conger
on x
Twitter open-sourced its algorithm: https://github.com/...
-
@wongmjane
Jane Manchun Wong
on x
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/...
-
@olafurw
Ólafur Waage
on x
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/...
-
@elonmusk
Elon Musk
on x
Twitter will be updating its recommendation algorithm based on user suggestions every 24 to 48 hours
-
@martinsfp
@martinsfp
on x
More than anything, this is incredibly US-centric. Most of the world isn't a Democrat *or* Republican. https://twitter.com/...
-
@goldengateblond
Shauna
on x
suddenly all the reduced engagement for some of us and exploding engagement for others makes sense https://twitter.com/...
-
@edzitron
Ed Zitron
on x
He has no idea what is going on with his website https://twitter.com/...
-
@bindlecore
@bindlecore
on x
hovering 7 inches off the ground https://twitter.com/...
-
@nickpickles
Nick Pickles
on x
More transparency to build trust - today we're open sourcing our code, and providing detail on how our recommendation algorithm works. https://twitter.com/...
-
@stuartpstevens
Stuart Stevens
on x
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/...
-
@sarah_edo
Sarah Drasner
on x
I love open source https://twitter.com/...
-
@francissuarez
Mayor Francis Suarez
on x
.@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/...
-
@dancow
Dan Nguyen
on x
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…
-
@carnage4life
Dare Obasanjo
on x
The Twitter algorithm is now on GitHub. Conservatives can now prove they are being shadow banned. 🙃 https://twitter.com/...
-
@rmac18
@rmac18
on x
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.
-
@leodarcy1
Leo D'Arcy
on x
@wongmjane And there is already an issue to remove it 🤣https://github.com/...
-
@jeffjarvis
Jeff Jarvis
on x
Ah, well, then, this explains it all. https://twitter.com/...
-
@jdvance1
J.D. Vance
on x
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/...
-
@pt
Parker
on x
America's four political parties. https://twitter.com/...
-
@jason
@jason
on x
Ok @tiktok_us @facebook @instagram @YouTube, you're up... tell us how you're programming us and our kids #transparency https://twitter.com/...
-
@fmanjoo
Farhad Manjoo
on x
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/...
-
@rmac18
@rmac18
on x
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.
-
@techgirl1908
Angie Jones
on x
read: can y'all please help us figure out how this algorithm works cuz everyone who knew is now gone https://twitter.com/...
-
@goldman
Jason Goldman
on x
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/...
-
@anthony
Anthony DeRosa
on x
I asked ChatGPT-3 to analyze the Twitter source code: https://twitter.com/...
-
@kylenabecker
Kyle Becker
on x
This is great. Get all the gremlins out! @ElonMusk https://twitter.com/...
-
@rmac18
@rmac18
on x
the discussion on this Elon Musk open algorithm space can best be summarized as https://twitter.com/...
-
@jason
@jason
on x
That wasn't so hard... now let's see the @instagram algorithm and what it's doing to teenage girls @finkd https://twitter.com/...
-
@spikereacts_
Spike
on x
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/...
-
@leokelion
Leo Kelion
on x
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/...
-
@chrismessina
Chris Messina
on x
Boom, #TheAlgorithm is live! https://github.com/... https://blog.twitter.com/... /tip @techmeme
-
@kjhealy@mastodon.social
Kieran Healy
on mastodon
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.
-
@wongmjane
Jane Manchun Wong
on x
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/...
-
@mahdi
@mahdi
on x
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/...
-
@wongmjane
Jane Manchun Wong
on x
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/...
-
@suzuki_takaya
Takaya Suzuki MD, PhD
on x
I wish the engineer won't be fired today... https://twitter.com/...
-
@fredwalton216
Fred Walton
on x
6) FT: “Still, apparently Elon is pretty displeased this part of the code was released.” 🙃 https://twitter.com/...
-
@mashable
@mashable
on x
Musk said he had no idea it was doing that! https://mashable.com/...
-
@clarajeffery
Clara Jeffery
on x
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/...
-
@davezatz
Dave Zatz
on x
Given the purchase price, he deserves it. https://twitter.com/...
-
@mattbinder
Matt Binder
on x
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/...
-
@barnacules
@barnacules
on x
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/...
-
@carnage4life
Dare Obasanjo
on x
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
-
@tante
@tante
on x
Elon Musk is really such a weakling. https://twitter.com/...
-
@jasoncwarner
Jason Warner
on x
Ahhhhhh the hallmark of our modern democracy, the four political party system of the US https://twitter.com/...
-
@mattbinder
Matt Binder
on x
Twitter's algorithm is specifically tracking tweet metrics for four groups: - power users - republicans - democrats and... - elon musk https://twitter.com/...
-
@aakashg0
@aakashg0
on x
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/...
-
@aakashg0
@aakashg0
on x
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:
-
@pashakamyshev
Pasha Kamyshev
on x
https://twitter.com/...
-
@zoeschiffer
Zoë Schiffer
on x
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/...
-
@pantibliss
Dr Panti Bliss-Cabrera
on x
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🙄 …
-
@sebsilbermann
Sebastian Silbermann
on x
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/...
-
@mahdi
@mahdi
on x
Twitter has removed that code in this commit 🥸 https://github.com/...
-
@wongmjane
Jane Manchun Wong
on x
Twitter's algorithm downranks crypto spams 😌 https://github.com/... https://twitter.com/...