X's Feed Ranking Algorithm: How Grok Ranks 500M Posts in 200ms

TL;DR Summary

xAI open-sourced the full production code behind X's For You feed on GitHub — 22.5k stars, Apache 2.0, commercial use allowed

The system pulls from 500 million daily posts, narrows to candidates, and ranks them in under 200 milliseconds using a Grok-based transformer

Zero hand-engineered features — the Grok transformer predicts 14 engagement types (like, reply, repost, click, dwell, block, report) and combines them into a weighted score