The X For You Feed Algorithm is the open-source codebase powering the For You feed on X. It assembles each request from in-network posts kept in memory by Thunder from accounts a viewer follows and out-of-network posts discovered through Phoenix retrieval and SimClusters, then hydrates candidates with post, media, author, account-label, language, and engagement data. A separate blending pipeline can add ads, Who to Follow recommendations, and prompts.
The post pipeline applies visibility filtering based on viewer actions such as blocks, mutes, and muted keywords, as well as labels produced by rule-based systems, account-scoring models, media models, and enforcement components. A transformer-based Phoenix model predicts the viewer’s probability of taking actions on each post and other continuous values; configured weights combine those predictions into a score, which ranks posts after filtering. The repository includes retrieval, labeling, filtering, scoring, ranking, Phoenix training and inference code, synthetic data generation for a proof-of-concept training run, and an Under the Hood tool that displays aggregate statistics about labels affecting account and post visibility.