Problem
A retrieval-based assistant picks a reply from about a million prepared ones: an index returns 128 candidates, 32 remain after filtering, and a cross-encoder scores them. Binary good/bad training does not fit ranking: good replies differ in quality, and negatives far outnumber positives. The model knows only Russian, while large datasets are English. Scoring candidates runs the shared context through the encoder times, which caps the candidate count and context length.
Example from the article: the Sobesednik (Interlocutor) component of the Salute assistants uses this search for scripted replies.
Solution in brief
The team replaced binary classification with the InfoNCE loss over one good reply and many negatives, mined semi-hard negatives with its own search, and aligned a bilingual model on translations. It then encoded the dialogue context once and reused the cached key/value matrices for all candidates, which cut latency and memory with no quality drop.
Questions this case answers
- How to rank hundreds of retrieved candidates against one shared context under a latency budget when a cross-encoder rescoring step is too slow
- How to train a relevance model on data with few reliable negative labels and heavy class imbalance
- How to reuse large English datasets for a model that must serve a single non-English language
- How to train a cross-encoder reranker when labeled replies are scarce and negatives are plentiful?
Tools and methods
- Cross-encoder — scores context and candidate together; its score is a feature for the final ranker
- LightGBM ranker — final ranking on cross-encoder score, SCU (context-embedding) model score, dialogue features, reply metafeatures
- FAISS — nearest-neighbor index over replies
- InfoNCE loss — contrastive training with one positive and several negatives
- Key/value reuse — context computed once, cached for all candidates
- Translation alignment (as in LaBSE) — MSE loss pulling embeddings of translations together
Google or a one-time email code. No password.
