Problem
hh.ru is a two-sided marketplace of vacancies and resumes, and its recommender systems rely on a DSSM (deep semantic similarity model) that turns each vacancy and resume into an embedding. For speed in production, the text encoder reads only the first 300 tokens of a description. Some long documents open with filler, so the useful parts never reach the model. Trying the last 300 tokens, a window from the middle, or forced blocks did not improve the metrics.
Example from the article: a Java developer vacancy opens with a paragraph about hh.ru advertising products. That paragraph takes a large part of the 300-token window, and the list of technologies does not fit at all.
Solution in brief
Train an extended copy of the matching model without the token limit and read its attention weights per sentence. Turn them into binary labels (sentence matters or not). Fit a logistic regression on these labels, then use it in production to keep the highest-scoring sentences up to 300 tokens before the encoder.
Questions this case answers
- How to compress long texts into a fixed token budget for a text encoder when the useful content is spread unevenly and manual relevance labels are too expensive
- How to match long documents when the model can only read the first few hundred tokens?
- How to pick the most informative sentences of a document without manual labeling?
- How to build training labels for a summarizer from the attention weights of a matching model?
Tools and methods
- DSSM — two-branch embedding model for vacancies and resumes, the consumer of the summaries
- Linear attention layer — gives per-token weights that act as the source of labels
- Logistic regression — fast, interpretable sentence classifier
is_summary - Extractive summarization — keeps original sentences in their original order
Google or a one-time email code. No password.