Self-attentive sentence embedding for the recommendation system

Bào Bùi22 May 2024

Problem

A large-scale recommender usually uses a two-tower model that turns each user into one vector. Users have diverse interests, and a single embedding is poor at capturing all of them. The fix is to encode the user's interests into several embeddings.

Example from the article: a user's history is a list of video IDs watched on YouTube, or item IDs clicked and ordered on an e-commerce platform. A single embedding of that list cannot capture all the interests in it.

Solution in brief

Replace the single user vector with r vectors, one per interest. A small self-attention head reads the behavior sequence and produces r attention distributions over it. Each distribution pools the items of the history into one interest embedding. The method comes from NLP sentence embeddings and carries over to behavior sequences with little change.

Questions this case answers
  • How to represent an entity whose behavior mixes several unrelated tastes so that a single embedding does not average them into a point that matches none
  • How to represent a user who has several distinct interests in a recommender?
  • How to move from one user vector to several interest vectors in a two-tower retrieval model?
  • How to choose between self-attentive and dynamic-routing multi-interest encoders?

Tools and methods

  • Self-attentive multi-interest embedding — turns a behavior sequence into an r×d matrix of interest vectors
  • Two-tower model — the host architecture: user tower, candidate tower, dot-product relevance
  • Orthogonality penalty — keeps the r interests different and each one focused on few items
  • Dynamic routing (MIND) — the alternative multi-interest encoder, comparable in quality
Continue reading — it's free

Google or a one-time email code. No password.