Jump to Content
Developers & Practitioners

Recommendations AI modeling

September 25, 2021
Guangsha Shi

Software Engineer and Product Manager Rotator

Eric Larson

Technical Solutions Consultant

In this series of Recommendations AI deep dive blog posts, we started with an overview of Recommendations AI and then walked through the data ingestion process. In this post, we will walk you through the model creation process and how you can get the best of Google’s AI and ML techniques to solve your business problems without deep ML expertise. 

When you ingest the data into Recommendations AI, the product catalog and user events form the two key pillars to train the recommendation models. Product features such as Item id, title, categories, description, price, stock status, and Events such as homepage views, detail page views, add to cart, purchases depict the whole journey of each user. They enable Recommendations AI to capture the interconnection between a user’s history, current landing page, and next action, and build a deep neural network to provide personalized recommendations. Once the data successfully ingested, you are now ready to train your very first model. Woohoo!
https://storage.googleapis.com/gweb-cloudblog-publish/images/image2_FFom81q.max-500x500.png

Create recommendations in the graphical interface

Recommendations AI provides an easy-to-use graphical interface, with which you can choose your model type, define your optimization objective, customize your business rules, and begin training your model with just a few clicks.

https://storage.googleapis.com/gweb-cloudblog-publish/images/image7_a1BY2UN.max-1400x1400.png

The model will be trained for you from scratch using the data you sent to us within the bounds of the GCP project.​​ In 3-7 days the initial model training and tuning will conclude, and you’ll see a visual indicator in the dashboard that the model is ready to query. You can then begin serving recommendations to your customers, or visually preview the recommendations being generated by the model before you serve them to production traffic to ensure that your setup is satisfactory.

https://storage.googleapis.com/gweb-cloudblog-publish/images/image3_c3aagUr.max-700x700.png

Google has spent years delivering recommended content across flagship properties such as Google Ads, Google Search, and YouTube. Recommendations AI draws on that experience to deliver personalized recommendations that suit each customer’s tastes and preferences across all your touchpoints.

Recommendation model types

Recommendations AI offers five recommendation model types including “Others you may like”, “Frequently bought together”, “Recommended for you”, “Similar items”, and "Recently Viewed", with the first four model types powered by machine learning, and the new model type “Similar items” in preview.

The "Others you may like" recommendation predicts the next product that a user is most likely to engage or convert with. The prediction is based on the shopping and viewing history of the user and the candidate product's relevance to a current specified product. In the example below, on a product detail page of a blue dress, the “Others you may like” model recommends another three dresses that the customer is likely to click on or purchase.

https://storage.googleapis.com/gweb-cloudblog-publish/images/image1_arwxnEL.max-600x600.png

The "Frequently Bought Together" recommendation predicts items frequently bought together for a specific product within the same shopping session. If a list of products is being viewed, then it predicts items frequently bought with that product list. This recommendation is useful when the user has indicated an intent to purchase a particular product (or list of products) already, and you are looking to recommend complements (as opposed to substitutes). This recommendation is commonly displayed on the "add to cart" page, or on the "shopping cart" or "registry" pages (for shopping cart expansion). In the example below, the “Frequently Bought Together” model recommends heels and a watch, which go well with the blue dress just added to cart, and a green dress as the customer may need multiple dresses for different occasions.

https://storage.googleapis.com/gweb-cloudblog-publish/images/image6_AL1J8yA.max-600x600.png

The "Recommended for You" recommendation predicts the next product that a user is most likely to engage with or purchase, based on the shopping or viewing history of that user and contextual information of requests, such as timestamps. This recommendation is typically used on the home page. "Recommended for You" can also be useful on category pages. A category page is similar to a home page, except that you display only items from that category. You can achieve this using a standard Recommended for You model with filter tags. For example, you can add customized filter tags (corresponding to each category page) to the items in your catalog. When you send the prediction request, set the user event object as category-page-view and specify a specific category page's tag in the `filter` field. Only recommendation results matching the requested filter tag are returned.

https://storage.googleapis.com/gweb-cloudblog-publish/images/image8_FRe1GOr.max-600x600.png

"Others You May Like" and "Recommended For You" are highly personalized recommendations powered by Transformer-based sequence modeling. "Others You May Like" recommendation requires an anchor item and is usually used on product detail pages, while "Recommended For You" can be used on pages without anchor items, such as home pages and category pages. They take into account both the content and order of a user’s historical clicks and purchases, correctly identify their true intentions, and precisely predict the next items that they would love to check out or purchase. For example, if a user browses a variety of maxi dresses and switches to fashionable shoes, "Others You May Like" model may recommend a mix of scandals and heels that go well with maxi dresses for a casual look during the day or a dressier look at night.

"Similar Items" is a new model type we’ve recently developed and is currently in preview. The "Similar Items" model will use only the product catalog, and not require user events in an effort to accelerate time to test model and preview recommendations results in the console for customers. We’ve leveraged self-supervised learning to accurately capture item similarities based on the metadata such as titles and categories, even if there is no user event ingested.

Optimization objectives

Machine learning models are created to optimize for a particular objective, which determines how the model is built. "Others You May Like" and "Recommended for You" recommendation models have click-through rate (CTR) as the default optimization objective. Optimizing for CTR emphasizes engagement, and you should optimize for CTR when you want to maximize the likelihood that the user interacts with the recommendation. In contrast, revenue per order is the default optimization objective for the "Frequently Bought Together" recommendation model type, as "Frequently Bought Together" focuses on cross-selling and increasing order values.

For "Others You May Like" and "Recommended for You" recommendation models, we also support conversion rate (CVR) as the objective. Optimizing for conversion rate maximizes the likelihood that the user adds the recommended item to their cart. When CVR is specified as the objective for a customer with sparse add-to-cart events, the multi-task learning mechanism will be automatically activated, and transfer learn from detail-page-view events, which are typically much denser than add-to-cart events.

User event data requirements

Before you create a new model, you must have met the requirements for creating a new model. The type of user events you import, and the amount of data you need, depends on your recommendation (model) type and your optimization objective. For example, you need to meet the following data requirement to train an “Others You May Like” model optimizing for click-through rate:

When you reach the minimum data requirement, you can begin model training. You can import historical user event data to meet the minimum event data requirements faster, or wait until the user event data collection meets the minimum requirements.

Other features for better performance

Our models also support massive catalogs of tens of millions of items and ensure that your customers have the opportunity to discover the entire breadth of your catalog through personalized recommendations. Models are re-trained daily to draw insights from changing catalogs, user behavior, or shopping trends and incorporate them into the recommendations being served. We also correct for bias with extremely popular or on-sale items and better handle long-tail items with sparse data as well as seasonal items to ultimately drive better CTR, CVR and revenue lift for our customers.

Getting recommendations

The “Ready to Query” column on the Models page will change to “Yes” once the models are finished with the initial training and tuning.  Once your models are trained and ready to query, you can preview the results in the cloud console and make prediction requests with the API.  Requests aren’t made to a model directly, a predict request is made to a specific Serving Config (previously called a Placement).  A Serving Config contains some additional options to use - so you can have multiple placements that call the same model, each with different options like price reranking or diversification settings.

Creating a Serving Config:

https://storage.googleapis.com/gweb-cloudblog-publish/images/create_serving.max-800x800.png

Name your Serving Config

https://storage.googleapis.com/gweb-cloudblog-publish/images/include_model.max-900x900.png

Choose a model

https://storage.googleapis.com/gweb-cloudblog-publish/images/preferences.max-900x900.png

Select Options

Usually you’ll want to create a separate serving config for each different placement of a model.  This is useful for reporting, and also allows you to change the model type in one particular place on a site without affecting other placements.

Recommendations AI is migrating to a general Retail UI that can be used for both recommendations and search, and some options will change in the new Retail UI. For example, we will be supporting the configuration of business rules in serving configs instead of models, so that you can quickly try out serving configs with various business rules, such as different levels of price reranking or diversification, using the same underlying model.

The Evaluate (preview) tab allows you to quickly see what the actual results look like.  The required parameters like visitorId or item ids can be entered in the form and then submitted to get results from a particular Serving Config/Model combination:

https://storage.googleapis.com/gweb-cloudblog-publish/images/pdp.max-1500x1500.png

You can leverage Recommendations AI anywhere in the customer journey.  Home page, product detail pages and cart pages are the most common placements, but you can also include recommendations in email campaigns and mobile apps. Let’s take a look at the customer journey here as an example.

https://storage.googleapis.com/gweb-cloudblog-publish/images/image5_XppwlaO.max-1600x1600.png

A customer begins their journey on their laptop, browsing the sports apparel category when Recs AI recommends shoes. The customer leaves, but comes back to the site on their phone to view more shoes. Recs AI steps in again to recommend sunglasses. Our customer adds sunglasses and shoes to their cart, indicating an interest in both items. Here, Recs AI recommends shorts which the customer clicks on to look at, but ultimately abandons their cart.

Three days later, you can send a personalized follow-up email to the customer with recommended items based on the customers clicks and interests. Recs AI closes the loop, spurring the customer to buy sunglasses and shorts, both recommended based on the customer’s previous activity across devices.

As we can see, Rec AI works throughout the entire buying process - from initial product discovery on a laptop, to consideration on a mobile device, to purchasing follow-through via email channels.

And that’s just one example of delivering recommendations in the customer journey. Customers can use recommendations across different device types (mobile, computer), in email campaigns, in physical retail settings (kiosks), or even indirectly (call center representative, sales representative).

Video Thumbnail

If you’ve been following along the steps with these blog posts series, you would now have a ML model that is trained for your custom data and ready to query. In our next post, we go over how to include the Recommendations from these models to incorporate on your site. 

Posted in