Introduction
Facebook’s news feed algorithm has long been surrounded by myths and assumptions. Until recently, few people truly understood how it works. Now, the company has decided to reveal the inner workings of its content personalization system. Let’s dive into the complexities of how Facebook determines what appears in your feed.
Beyond Likes and Shares
Facebook’s algorithm is an extraordinarily complex and extensive ranking system powered by machine learning. This sophisticated system aims to display relevant and useful content whenever a user visits the Facebook website or app, requiring the analysis of massive amounts of content.
With over 2 billion Facebook users worldwide, the system must select from thousands of potential posts that could appear in each person’s news feed. We’re talking about trillions of posts and thousands of ranking signals that help determine exactly what a particular user might want to see. When someone logs into Facebook, this entire process happens in the background, and the news feed loads within seconds.
Beyond likes, shares, saved posts, and other obvious engagement metrics, Facebook must increasingly consider additional factors like clickbait and fake news, challenges for which the platform continues to develop solutions.
The News Feed isn’t a single algorithm but rather a multi-level system that employs several machine learning models to determine the most appropriate content. By identifying what’s most likely to interest a user, the system filters thousands of posts down to a few hundred that appear in the feed.
How the Algorithm Works in Practice
To understand how this process unfolds in real-world situations, let’s examine a specific example.
Let’s say a user named John logged into Facebook yesterday. During that time:
- His friend George posted a photo of his cocker spaniel
- His friend Geri shared a video of her morning run
- A page John follows published an article about the best ways to view the Milky Way at night
- In his fitness group, there were four new workout routines he could try
All this content would likely interest John because he follows these pages and users.
To determine which content should appear higher in John’s news feed, the system needs to identify what matters most to him. From a mathematical perspective, it must define selection criteria for John and optimize accordingly.

To assess whether John will like a particular post, the system analyzes post data: the date, tagged users, likes, and other metrics.
For example, if John frequently comments on or shares Geri’s posts, and she recently uploaded a jogging video, there’s a good chance John will enjoy her new post. If John has interacted more with video content in the past, he’s less likely to engage with George’s cocker spaniel photo. In this case, the ranking algorithm will place the running video higher than the dog picture.
Multiple Factors in Content Ranking
But likes aren’t the only way to express preferences. People share articles daily, watch videos on celebrity pages, or leave comments on friends’ posts. Mathematically, the task becomes more complex because it requires optimization across multiple criteria, each helping to form a list of relevant content for the feed.
Multiple machine learning models make predictions about John: the probability of him interacting with George’s photo, Geri’s video, the Milky Way article, or the workout routines. Each model offers its own content list for the user, and sometimes there are inconsistencies.
For instance, John might be more likely to like Geri’s jogging video than the Milky Way article. However, he might be more likely to comment on the article rather than the video.
Therefore, all predictions must be combined into a unified score, optimized for the ultimate goal: showing the user meaningful and relevant content.
When forming the news feed, Facebook considers audience opinions through regular surveys, asking users how valuable they find interactions with their friends’ content and whether posts are worth the time spent engaging with them.
Why a Ranking Algorithm is Necessary
This system effectively sorts countless daily posts in real-time for each of the billions of users. This task is executed in several strategically designed stages to make everything fast and reduce computational resource requirements.
First, the system collects all possible posts for John’s feed: the cocker spaniel photo, running video, etc. The list of potential content includes all posts that friends, groups, and pages have shared with John since the last time he opened the Facebook app or website.

What about posts published before John’s previous visit that he hasn’t seen? Such posts, if aligned with John’s interests, can appear in the current news feed. The feed formation logic also accounts for friends’ actions. In other words, posts John has already seen but which might spark active discussion in the future can also reappear in his feed.
The Four-Step Ranking Process
The system evaluates each post based on several criteria:
- Content type
- Similarity to other posts
- Match with what John typically interacts with
To calculate all this for two billion people in real-time, ML models run in parallel on multiple prediction machines.
Before combining all predictions into a single rating, additional rules are applied. The system waits for the initial predictions and then narrows the list of possible posts, doing this in several approaches to save computational resources:
- Initial Screening: Facebook applies certain integral processes to each post to determine whether and which consistency search methods are needed.
- Simplified Model: The next step narrows the list to about 500 of the most suitable posts for John. Ranking fewer posts allows more powerful neural network models to be used later.
- Main Rating Calculation: This is where most personalization occurs. An individual rating is calculated for each post, and each of the 500 posts receives its place in the list. Some posts may score higher due to likes rather than comments since many users prefer them. Actions that users rarely perform play a minimal role in the assessment.
- Contextual Refinement: This stage completes all calculations, with the system considering characteristics such as content type diversity. Consequently, videos don’t appear one after another in John’s feed.
All these complex calculations occur during the time you open the Facebook application. Within seconds, users receive a completed news feed that they can browse with interest.
Conclusion
Facebook’s Algorithm is a multi-level, branched ranking system based on machine learning that works through several stages:
- It collects all possible posts for the user’s feed (considering actions of their friends and subscriptions).
- Based on its predictions, it narrows the list to about 500 of the most suitable posts.
- It then personalizes this list as much as possible by placing the 500 posts in the feed according to rating, assigning “interest points” to each post based on the user’s previous experience (what they like, what posts they share, etc.).
- It adds an element of diversity so that posts of the same type aren’t shown consecutively.
All this happens within seconds as Facebook’s news feed loads. With the social network used by 2 billion people worldwide, we’re talking about ranking trillions of posts every day to create a personalized experience for each user.