How we built the Discovery AI neural search — a technology for the largest content base in Russia

Evgeny Astafurov1 Jul 2026

Problem

A content platform with billions of documents needs search that answers long, compound questions with generated text, not a list of links. Existing search logs cannot train this, because classic queries are short and rigid. Rephrasing complex queries with an LLM adds a model call to latency, and scoring every candidate chunk with a BERT-like ranker costs a lot of GPU time at this scale.

Example from the article: the query "changes in the advertising labeling law over the last quarter: new fines for self-employed authors and a step-by-step action plan" mixes factual, narrow and procedural parts that no single document covers.

Solution in brief

VK combines BM25 and vector retrieval across content verticals, merges candidates in a blender, and scores document chunks with a distilled, quantized BERT-like model. The top chunks go to an 8B LLM restricted to that context. Training data needs no assessors: an LLM writes questions per document and a judge LLM labels intent-chunk pairs. A Deep Research loop handles multi-step queries.

Questions this case answers
  • How to build a retrieval pipeline that handles long compound queries when existing search logs contain only short keyword queries and no manual labels exist
  • How to cut inference cost and latency of a transformer relevance ranker so that it can score tens of thousands of text chunks per second per GPU
  • How to answer long, multi-part user questions over a huge content base with an LLM within a sub-second time to first token?
  • How to train semantic search and a chunk-relevance ranker without manual labeling or assessors?

Tools and methods

  • BM25 and ANN vector search — two candidate generators per vertical.
  • Round-robin blender — merges candidates from all verticals.
  • BERT-like chunk ranker — distilled, INT8 QAT, served with TensorRT.
  • LLM-as-a-judge pipeline — synthetic training labels.
  • 8B LLaMA-based generator — answers from the given context only.
  • Deep Research agent loop — iterative search with sufficiency checks.
Continue reading — it's free

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