Skip to content
技术/编程

X's Official Open-Source Recommendation Algorithm

X officially open-sourced the x-algorithm project, completely exposing the core code of its recommendation system. An in-depth analysis of positive/negative weight parameters and Grok transformer-driven recommendation mechanism.

1/20/2026 4 min read

X’s Official Open-Source Recommendation Algorithm

X has officially open-sourced the x-algorithm project, completely exposing the core code of its recommendation system.

X’s recommendation algorithm uses a two-layer architecture combining Grok transformer + weighted scoring. The final ranking score is determined by:

Final Score = Σ (weight_i × P(action_i))

If this formula is hard to follow, let’s examine its weight variables instead.

Positive Weights (Boost Ranking)

  1. Like
  2. Reply
  3. Repost
  4. Quote tweet
  5. Expand post
  6. Click on user profile
  7. Share
  8. Share via DM
  9. Share by copying link
  10. Watch time
  11. Click on quoted content
  12. Follow the author
  13. Click on images
  14. Video play weight (subject to minimum duration threshold)
  15. Continuous watch time

Negative Weights (Lower Ranking)

  1. Mark as not interested
  2. Block the author
  3. Mute the author
  4. Report content

Recommendation Mechanism

While the key algorithm weight parameters and processing logic have been disclosed, the actual numerical values for these weights remain undisclosed.

For the recommendation mechanism, Grok computes vectors based on user characteristics and historical interactions, then uses vector approximate search to surface posts the user might interest to their timeline.

Posts in your timeline come from two sources: Following and For You.

Implications for Creators

From the weight list, several key insights emerge:

  • Likes are the most basic positive signal, but reposts and quote tweets have a greater viral effect
  • Watch time and continuous watch time indicate the algorithm values depth of engagement, not just clickbait titles
  • Profile clicks and following the author mean the algorithm rewards creators who encourage users to explore further
  • Video play weight has a minimum duration threshold, meaning short videos need a certain quality level to gain traction

Overall, the new recommendation algorithm maintains user engagement as the core weighting factor, but the algorithm tier has removed much of the manually engineered features, shifting toward a Grok-based model that predicts engagement likelihood.