Problem
Existing item recommenders at Target look at one product at a time. When a guest adds eggs after milk, the list is about eggs (egg whites, brown eggs, 12 count eggs) and ignores that the cart already holds milk. Precomputing lists for every possible basket is impossible: the source counts trillions of permutations for the whole catalog.
Example from the article: with milk, eggs and sugar in the cart, single-item models suggest more sugar variants (stevia sweetener, granulated sugar, organic sugar), while the basket-aware model suggests baking items (cake flour, frosting, baking powder).
Solution in brief
Turn each ordered add-to-cart session into two graphs. One goes through graph neural network (GNN) layers with a GRU for short-range links, the other through attention layers for long-range links. The model produces item embeddings. At serving time a microservice builds a session embedding on every cart change and returns the nearest items.
Questions this case answers
- How to recommend items from the whole ordered context of a growing session when item-to-item lookup tables ignore the other items and the order
- How to serve recommendations for a session whose possible item combinations are too many to precompute
- How to recommend items for a shopping cart that changes during the session, using every item already in the basket?
- How to make recommendations depend on the order in which items were added, without precomputing them for every basket?
Tools and methods
- Graph neural network with GRU — item embeddings from the session multigraph, short-range links
- Attention layer — item features propagated over the shortcut graph, long-range dependencies, more weight to recent items
- Nearest-item search by embedding closeness — top recommendations for the current session embedding
- Apache Hive and Apache Spark — ordered sequences of add-to-cart items
Google or a one-time email code. No password.