In a new technical post on its Artificial Intelligence blog, Facebook details the technology that determines which images Instagram users see in the platform's Explore tab. According to the company, it had to develop 'novel engineering solutions' in order to select a relatively minuscule number of recommended images, videos, and Stories out of the billions of options each time the Explore tab is opened.

Instagram's Explore tab is found by tapping the magnifying glass icon within the service's mobile app. The content presented within this tab is a small selection chosen from the billions of images and videos uploaded by users. Instagram uses machine learning (ML) to determine which content is most relevant to the user, helping them discover the types of images and videos they're most likely to care about.

Facebook explains in its new post that Instagram's Explore tab is powered by a three-part 'ranking funnel' system that is capable of making 90 million model predictions in a single second. Engineers developed multiple systems to ensure that Instagram's Explore recommendations are 'both high quality and fresh,' among other things.

Facebook explains:

After creating the key building blocks necessary to experiment easily, identify people’s interests effectively, and produce efficient and relevant predictions, we had to combine these systems together in production.

The overall recommendation system first engages in what Facebook calls Candidate Generation, which determines the accounts ('seed accounts') an Instagram user may be interested in based on the accounts they already follow. Using these seed accounts, the AI then uses embedding techniques to find other accounts similar to the first batch it found.

Using this entire batch of accounts, Instagram's system then determines which images and videos those users engaged with (likes, shares, etc.), as well as the content they posted. Thousands of candidate posts are identified for each average person using the platform, according to Facebook.

Once the candidates are identified, the system takes 500 of them and ranks them using a three-part ranking infrastructure. The first pass in this ranking system uses a distillation model to select 150 of the highest-quality posts from the 500 candidates.

The second pass utilizes a lightweight neural network to pick 50 of the highest-quality posts from the batch of 150. Finally, the third and final pass uses a deep neural network to pick 25 candidates that are both most relevant to the user and of the highest quality. Those 25 candidates appear on the first page of the Instagram Explore tab.

The selection process isn't quite as simple as it sounds. Facebook explains that its system predicts which individual actions users will take on any given post, such as whether they'll 'like' or share it -- or, alternatively, whether they'll have a negative response, which is something like choosing to 'see fewer posts' like the one they were recommended. The system can be designed to give more weight to certain predicted actions than others.

Instagram's Explore tab factors in the intention of showing users posts related to new interests in addition to their existing interests, according to Facebook, which explains:

We add a simple heuristic rule into value model to boost the diversity of content. We downrank posts from the same author or same seed account by adding a penalty factor, so you don’t see multiple posts from the same person or the same seed account in Explore.

The ultimate goal of Instagram's Explore tab is helping users find new, relevant, and interesting content from other users. Facebook says that its engineers are 'continuously evolving' the discovery tab.