Problem
Avito's recommendations came from several candidate generators, a ranker and a feed-mixing step. One of the main generators, user2vec, built a user embedding as a time-decayed weighted sum of the embeddings of listings the user had touched, a linear combination of past items. It did not model action order explicitly (only a recency decay), ignored search queries, and recommended related goods poorly: a bicycle buyer saw more bicycles, not tires or lubricants.
Example from the article: a user interested in bicycles mostly received other bicycles and rarely related accessories.
Solution in brief
Avito replaced user2vec with a two-tower model. One tower embeds listings, and the vectors are cached. A transformer tower embeds the user's history of listing actions and searches in real time. The dot product of the two embeddings scores relevance. The same model serves as a candidate generator through an ANN index and as a feature in the ranker.
Questions this case answers
- How to model a user's short- and long-term interests from an ordered history of heterogeneous actions when a decayed average of item embeddings ignores order and context
- How to serve user embeddings in real time for candidate retrieval over a catalog of hundreds of millions of items
- How to replace a weighted-sum user embedding with a model that sees action order, search queries and intent changes?
- How to generate user embeddings in real time and retrieve candidates by nearest-neighbor search?
Tools and methods
- Two-tower model — listing tower and transformer user tower, relevance as a dot product.
- Deep Cross Network (DCN) — builds cross features inside each feature group and across groups.
- InfoNCE with in-batch and random negatives — the training loss.
- Aqueduct, Redis, Sphinx ANN index — preprocessing and inference, embedding cache, nearest-neighbor retrieval.
Google or a one-time email code. No password.