Problem
Yandex Lavka search ran a three-stage pipeline (candidate generation, filtering, personalized ranking) that worked while the assortment was stable. In 2025 Lavka added supermarkets (iPhones, drills, Labubu toys) and delivery from pharmacies and pet shops on the courier's route. The catalog grew by tens of thousands of items. The two-tower DSSM model had never seen these items, and the query "labubu" looked like a typo. Heavy early-interaction models understood them but were too slow at runtime, and retraining all three stages for every new assortment was too long and costly. Example from the article: for "chocolate ice cream", chocolate ice cream is an exact match, while a chocolate bar misses the intent.
Solution in brief
Search demand is concentrated: 200 queries give half of all add-to-carts. The team scores every pair of a top query and a catalog item with a heavy BERT model offline and caches the relevant items with their scores. At runtime a cache hit goes straight to personalized ranking. A miss falls back to the old pipeline. Request-time latency no longer limits the model.
Questions this case answers
- How to serve the output of a model that is too slow for request time when a small head of queries carries most of the value and the item catalog is small enough to score exhaustively offline
- How to adapt a retrieval pipeline to a changed or expanded catalog without retraining every stage, when training data for the new items does not exist yet
- How to get the quality of a heavy cross-encoder relevance model in search when it is too slow to run at request time?
- How to make search understand a new assortment (electronics, pharmacy, pet goods) without retraining candidate generation, filtering and ranking?
Tools and methods
- BERT cross-encoder (early interaction) — scores a "query + item description" pair from 0 to 1, trained on graded labels
- Four-class relevance labeling — rel+, rel, rel−, non-rel, collected on Yandex Tasks
- DSSM (two-tower) and BM25 — the fast runtime fallback for queries outside the cache
Google or a one-time email code. No password.
