Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Snap Way to Design Ads Ranking Service Using Deep Learning

Snap Way to Design Ads Ranking Service Using Deep Learning

Snap engineering has recently published a blog post on how they designed their Ads ranking and targeting service using deep learning.

Showing ads to the users is the mainstream of social network platform monetization. Snap ad ranking system is designed to target the right user at the right time. Snap follows a couple of principles in designing such a complicated system. They focus on providing an excellent user experience while preserving user privacy and security. The following picture is showing the high-level architecture of Snap ad ranking and targeting service.

Overall ad ranking service architecture at Snap

This system is composed of some microservices. It has a module called ad eligibility filter. This module is applying some filters like checking the ad budget, privacy, and ad policy compliance. It determines if the ad is suitable to show to the user or not. Ads from this module are passed to the candidate generation module. The candidate generation module selects related ads for the users. Usually, a light machine-learning model with high recall is used in this module. Once hundreds or a few thousand ads are selected the heavy deep learning model is used to score the probability of ads conversion. In the end, the auction runs to select and score ads based on the business rules, budget, etc. A feedback loop is used to collect more user interaction data to retrain the models.

Ad ranking systems have some unique challenges in comparison to the general recommendation and search ranking systems. First of all the scale, cost and latency. As it is mentioned in the blog post :

Our ML models operate at a very large scale; every day we make trillions of predictions using models trained on billions of examples. Such a large scale implies significant training and inference costs. These models also operate under strict latency constraints. A combination of highly optimized training platform, inference platform, and model architectures is needed to keep the cost and latency within acceptable limits.

A low error rate in prediction is an important factor in ad selection. Error in score prediction will propagate in the auction phase resulting in low-quality data in model training. Fast change in the ad inventory is also one of the main challenges. That makes it hard to have a good embedding representation for the ads. 

For the heavy Ml models, deep learning models are used in the service as explained in the blog post :

We make use of current state of the art multi-task models such as MMoE and PLE to predict multiple conversion events jointly (e.g., app installs, purchases and sign-ups). Our models also use the latest high order feature interaction layers such as DCN and DCN v2 as a building block. We further optimize these models for inference cost and latency by splitting them into multiple towers, e.g., one for processing user features and the other for ad features. We demonstrate these components and the connections among them in the figure below.

High-level model architecture used in Snap ad ranking

Ad ranking systems are considered one of the use cases of retrieval systems. Some cloud providers like Amazon, Google, and Microsoft are also providing these retrieval systems as a service for their customers. There are some open-source systems like ads-searching-systems on GitHub for more review.

About the Author

Rate this Article