twitter/the-algorithm-ml
Pythonblog.twitter.com/engineering/en_us/topics/open-source/2023/twitter-recommendation-algorithmSource code for Twitter's Recommendation Algorithm
recommendationmachine-learningrankingtwitteralgorithm
Key Metrics
Star Growth
Stars
10.6k
Forks
2.2k
Weekly Growth
+4
Issues
20
5k10k
Mar 2023Oct 2023May 2024Dec 2024Aug 2025Mar 2026Oct 2026
ArtifactsPyPI
README
This project open sources some of the ML models used at Twitter.
Currently these are:
The "For You" Heavy Ranker (projects/home/recap).
TwHIN embeddings (projects/twhin) https://arxiv.org/abs/2202.05387
This project can be run inside a python virtualenv. We have only tried this on Linux machines and because we use torchrec it works best with an Nvidia GPU. To setup run
./images/init_venv.sh (Linux only).
The READMEs of each project contain instructions about how to run each project.