X just open sourced its ranking algorithm, under the Apache v2 license.
This is the source code for the "For You" timeline, the default feed you see when you open the app.
• Your feed score is literally a weighted prediction of your behavior. It does not simply reward likes. Instead it predicts probabilities for favorites, replies, reposts, clicks, dwell time, follows, mutes, blocks, reports, and more, then X combines those probabilities using explicit positive and negative weights.
• Posts from people you already follow get an advantage over posts from strangers.
• Newer or less-seen accounts can receive an explicit boost, while repeated posts from the same author get pushed down.
• A post can perform well in ranking and still be removed later because safety and spam rules operate separately.
• The exact same post can be visible to followers but blocked from being recommended to non-followers.
• X deliberately reduces similar posts appearing together, even when that means sacrificing some predicted engagement.
Although today's open source release is not the entire stack. Some enforcement rules and Grok prompts are withheld, some deployment infrastructure is absent, and production configuration can change outside the static code.