Retrieval
Ranking all of the billions of pieces of content uploaded to Instagram for every single user is obviously not feasible.
Therefore, the candidate generation stage uses a set of heuristics and ML models to narrow down the potential items to thousands of photos/videos.
In terms of heuristics, Instagram uses things like
...
See more