Role of ML in e-commerce

Applied ML #11

This note is inspired by the conversation I had with Joel Truher, who until recently led the recommendations team for Thanks to Joel for sharing his experience, insights and his vision on e-commerce.

This article looks at where machine learning is used in e-commerce today and what might change in the future. As an overview, machine learning is used to shorten the user journey, to help users find what they are looking for. ML is also used as a “task engine”, i.e. to identify the larger task the user is engaged in (like buying gifts for Christmas or home renovation) and to provide suggestions that might increase retention.

ML can help buyers in finding and exploring

Let’s look at finding and exploring but also how the ML system could know if it is doing a good job, a.k.a. the “objective function” / “north star metric”.

Finding by navigation

These are journeys where the user is presented a few categories usually as carousels. This works best for popular items and not the long tail. Personalization is key in making sure that the categories and carousels presented have good coverage over what users are looking for.

Typically navigation has been an area were product and analytics have driven more of the decision making. With approaches like personalization and online learning like multi-armed bandits, these carousels have become very effective in helping users find what they are looking for.

What makes navigation hard?

  • E-commerce platforms have a lot of items of disparate types. Coming up with a one-level categorization that resonates with users is difficult.

  • Natural language generation of category texts is challenging.

Finding by Search:

Typically users are provided a way to search for a specific item on every e-commerce platform.

The image above shows the experience of searching on an e-commerce platform along with key experiences like auto-correct spelling mistakes, identifying the intent of the query, providing query refinement options that may lead to the exact item the user is looking for.

What makes search difficult?


Driven by the popularity of platforms like Pinterest, exploration is gaining in the market share of purchases. Previously most shopping journeys would start with a search or with an explicit intent. However, with visual experiences, and explorations powered by Graph Neural Networks, Pinterest is able to hold the users’ interest much longer.

A key concept in exploration is the concept of “no dead ends”. At every point the user should find incrementally useful paths which either help in optimizing for quality or value in the current purchase or lead to an item that is closer to what the user is looking for.

What makes exploration difficult?

  • Seasonality / Identifying the occasion to trigger and recommending for that reason

    A lot of shopping is around occasions. For instance a lot of the purchases are around holidays. The distribution of items sold during these personal and global occasions are different. This paper is an example of how to factor these in the recommendations provided to the user.

  • The innovation brought by machine learning is to have a joint model that is able to both identify whether the user journey is driven by occasion or intrinsic preference and condition recommendations for it.

Objective function

ML systems are driven by the choice of what we are trying to optimize[1]. What should we try to optimize in e-commerce?

  • engagement?  

  • gross merchandise value?  

  • profit?  

  • return visits?  

  • user-reported happiness?  

  • the absence of negative outcomes?  

  • merchant success?  

  • some clever combination of all of these?

Based on the ML training machinery the research community has perfected over the years, the optimization is relatively easy. However the choice of objective is not easy at all.

Bias and fairness of the objective

In choosing a north star metric one should consider bias it might introduce in the system. An ML driven discovery system has both cause and effect. While it tries to understand the user and act on their behalf, it might also direct the users towards thinking like others. (For example, think of the cause and effect a carousel recommending top ten items sold)

Some questions/tradeoffs:

Upleveling the experience of the user

ML can be used to further enhance the experience by

  • suggesting items “frequently bought together” with what was purchased. This is about identifying the multi-purchase task the user might be engaged in.

  • showing items “related to your searches”. This is a high accuracy source of recommendation, particularly when a user logs in after having searched for something in the past. This serves to remind them that the task is still pending.

  • “people who were searching for this actually ended up buying x item”. Particularly if the value proposition (price / quality) is explained then this could be a major source of retention. The complexity is that the value proposition could be highly personalized and category specific.

These are probably familiar to you (the reader), however, let’s double click on this. This is actually the key idea. 

There's no such thing as context-free navigation and there's no such thing as context-free search. Every user is in the middle of a "journey" all the time actually potentially many parallel journeys! The challenge is to make it easy for users to take one of the many possible next steps, without overwhelming them with choices or information they don't want to think about.

ML can help sellers by adaptive distribution, personalization and suggesting what to create

E-commerce is a classic two-sided marketplace problem. There is buyer-side value and there is also seller(creator)-side value.

ML helps create a platform that gives newer creators a fair shot. Imagine a new manufacturer comes up with a great running shoe 👟 . If the platform were to just show shoes based on sales trends observed in the past, there is no way this will be shown to anyone. However, it is possible that this shoe could be the next big thing! Giving this shoe 👟 a shot is not only fair to the creator, it is also better for the users and it also increases the value derived from using the platform. However, it could hurt all three parties. by showing this shoe at the top in recommended lists to everyone.

Recommendations should thus optimize the value for all three parties but in an exploratory manner. It could end up showing this shoe to a few users who might be the best fit for this, based on their traits and their willingness to try new brands. If it works better than the alternatives, then the system would be emboldened to try more.

In the upcoming article, coming Saturday, Joel talks about his experience in the field of search (Hotbot, Lycos, Google), e-commerce and the challenges he is excited about next. Stay tuned!

Disclaimer: These are my personal opinions only. Any assumptions, opinions stated here are mine and not representative of my current or any prior employer(s).