Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

twitter/the-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

X's Recommendation Algorithm is a set of services and jobs that are responsible for serving feeds of posts and other content across all X product surfaces (e.g. For You Timeline, Search, Explore, Notifications). For an introduction to how the algorithm works, please refer to ourengineering blog.

Architecture

Product surfaces at X are built on a shared set of data, models, and software frameworks. The shared components included in this repository are listed below:

TypeComponentDescription
DatatweetypieCore service that handles the reading and writing of post data.
unified-user-actionsReal-time stream of user actions on X.
user-signal-serviceCentralized platform to retrieve explicit (e.g. likes, replies) and implicit (e.g. profile visits, tweet clicks) user signals.
ModelSimClustersCommunity detection and sparse embeddings into those communities.
TwHINDense knowledge graph embeddings for Users and Posts.
trust-and-safety-modelsModels for detecting NSFW or abusive content.
real-graphModel to predict the likelihood of an X User interacting with another User.
tweepcredPage-Rank algorithm for calculating X User reputation.
recos-injectorStreaming event processor for building input streams forGraphJet based services.
graph-feature-serviceServes graph features for a directed pair of users (e.g. how many of User A's following liked posts from User B).
topic-social-proofIdentifies topics related to individual posts.
representation-scorerCompute scores between pairs of entities (Users, Posts, etc.) using embedding similarity.
Software frameworknaviHigh performance, machine learning model serving written in Rust.
product-mixerSoftware framework for building feeds of content.
timelines-aggregation-frameworkFramework for generating aggregate features in batch or real time.
representation-managerService to retrieve embeddings (i.e. SimClusers and TwHIN).
twmlLegacy machine learning framework built on TensorFlow v1.

The product surfaces currently included in this repository are the For You Timeline and Recommended Notifications.

For You Timeline

The diagram below illustrates how major services and jobs interconnect to construct a For You Timeline.

The core components of the For You Timeline included in this repository are listed below:

TypeComponentDescription
Candidate Sourcesearch-indexFind and rank In-Network posts. ~50% of posts come from this candidate source.
tweet-mixerCoordination layer for fetching Out-of-Network tweet candidates from underlying compute services.
user-tweet-entity-graph (UTEG)Maintains an in memory User to Post interaction graph, and finds candidates based on traversals of this graph. This is built on theGraphJet framework. Several other GraphJet based features and candidate sources are locatedhere.
follow-recommendation-service (FRS)Provides Users with recommendations for accounts to follow, and posts from those accounts.
Rankinglight-rankerLight Ranker model used by search index (Earlybird) to rank posts.
heavy-rankerNeural network for ranking candidate posts. One of the main signals used to select timeline posts post candidate sourcing.
Post mixing & filteringhome-mixerMain service used to construct and serve the Home Timeline. Built onproduct-mixer.
visibility-filtersResponsible for filtering X content to support legal compliance, improve product quality, increase user trust, protect revenue through the use of hard-filtering, visible product treatments, and coarse-grained downranking.
timelinerankerLegacy service which provides relevance-scored posts from the Earlybird Search Index and UTEG service.

Recommended Notifications

The core components of Recommended Notifications included in this repository are listed below:

TypeComponentDescription
ServicepushserviceMain recommendation service at X used to surface recommendations to our users via notifications.
Rankingpushservice-light-rankerLight Ranker model used by pushservice to rank posts. Bridges candidate generation and heavy ranking by pre-selecting highly-relevant candidates from the initial huge candidate pool.
pushservice-heavy-rankerMulti-task learning model to predict the probabilities that the target users will open and engage with the sent notifications.

Build and test code

We include Bazel BUILD files for most components, but not a top-level BUILD or WORKSPACE file. We plan to add a more complete build and test system in the future.

Contributing

We invite the community to submit GitHub issues and pull requests for suggestions on improving the recommendation algorithm. We are working on tools to manage these suggestions and sync changes to our internal repository. Any security concerns or issues should be routed to our officialbug bounty program through HackerOne. We hope to benefit from the collective intelligence and expertise of the global community in helping us identify issues and suggest improvements, ultimately leading to a better X.

Read our blog on the open source initiativehere.


[8]ページ先頭

©2009-2025 Movatter.jp