Hire Freelance Software Engineers

Table of Contents:

Building The Future of Freelance Software / slashdev.io

Twitter’s “The Algorithm” Recommendation Engine Finally Unveiled And It Is Incredible/



Patrich is a senior software engineer with 15+ years of software engineering and systems engineering experience.

0 Min Read

Twitter LogoLinkedIn LogoFacebook Logo
Twitter’s “The Algorithm” Recommendation Engine Finally Unveiled And It Is Incredible
Twitter's "The Algorithm" Image Displaying The Different Features

After much anticipation, Twitter has finally unveiled its Recommendation Algorithm, known as “The Algorithm.” The platform’s cutting-edge engine is responsible for suggesting tweets and users to follow, ensuring a tailored experience for every user. In this article, we will explore the primary components of this incredible algorithm, breaking down the various elements and their roles in providing personalized content.

The Main Components of Twitter’s Recommendation Algorithm is

  1. Feature: simclusters-ann

The simclusters-ann component is responsible for community detection and sparse embeddings into those communities. It helps identify groups of users with similar interests, allowing Twitter to recommend tweets and users that fit within a user’s preferences.

  1. TwHIN

TwHIN, or Dense Knowledge Graph Embeddings, creates dense representations of users and tweets, enabling the algorithm to understand relationships and connections better.

  1. Trust and Safety Models

These models are designed to detect and filter out NSFW or abusive content, ensuring a safer and more enjoyable experience for users.

  1. Real-graph

The real-graph component predicts the likelihood of a user interacting with another user, helping the algorithm to understand potential connections and recommend relevant content.

  1. Tweepcred

Tweepcred is a Page-Rank algorithm that calculates the reputation of Twitter users. The algorithm considers this reputation score when recommending users and content.

  1. Recos-injector

The recos-injector is a streaming event processor responsible for building input streams for GraphJet-based services, which play a significant role in Twitter’s recommendation engine.

  1. Graph Feature Service

This service provides graph features for a directed pair of users, such as how many of User A’s followers liked tweets from User B.

  1. Candidate Source: search-index

The search-index component is responsible for finding and ranking in-network tweets, making up approximately 50% of tweets in the recommendation engine.

  1. CR-mixer

The CR-mixer acts as a coordination layer for fetching out-of-network tweet candidates from underlying compute services.

  1. User-Tweet-Entity-Graph (UTEG)

UTEG maintains an in-memory user-to-tweet interaction graph, finding candidates based on graph traversals. This component is built on the GraphJet framework, which includes other features and candidate sources.

  1. Follow Recommendation Service (FRS)

FRS offers users recommendations for accounts to follow and tweets from those accounts, ensuring a personalized experience.

  1. Ranking

Twitter’s recommendation algorithm uses two ranking models, light-ranker and heavy-ranker. The light-ranker model is used by the search index to rank tweets, while the heavy-ranker is a neural network responsible for ranking candidate tweets after candidate sourcing.

  1. Tweet Mixing and Filtering

The home-mixer, built on product-mixer, is the main service used to construct and serve the Home Timeline. Visibility-filters ensure legal compliance, product quality, user trust, and revenue protection through hard-filtering, visible product treatments, and coarse-grained downranking.

  1. Software Framework

Twitter’s recommendation algorithm is built on various software frameworks, including Navi (a high-performance machine learning model serving written in Rust), product-mixer, and the legacy machine learning framework, TWML, built on TensorFlow v1.

Check out https://github.com/twitter/the-algorithm for more information and to clone or fork the source code.

If you are interested in building your own algorithm for your company please check out slashdev.io with an excellent selection of high quality, english speaking engineers for as low as $28/h.