Improving Search Suggestions: From Retrieval to Generation

27 May 2026

Problem

Ozon search suggestions must answer within 300 ms. For years they were built as retrieval plus ranking: candidates came from a prebuilt index and a gradient-boosted tree model ordered them. Quality hit a ceiling. The index cannot offer rare or new queries, prefix matching tolerates only 1–2 wrong letters, and personalization is limited to hand-made features.

Example from the article: nobody can suggest "purple sneakers with unicorns and sequins" if that phrase is not in the index, and a prefix like "adibas" may return nothing useful.

Solution in brief

Train a compact decoder-only transformer from scratch on sequences of user actions (queries, clicks, filters, corrections), then fine-tune it to continue a partial query with a short suggestion. One model replaces retrieval, spellcheck and feature-based personalization. Runtime filters and an offline path-length metric keep generated phrases usable. The team started with short "tap tag" continuations, not full queries.

Questions this case answers
  • How to replace an index-bound candidate-retrieval and ranking pipeline with a sequence model that completes a partial query using user behavior, under a tight latency budget
  • How to evaluate generated query completions offline by the number of user actions needed to reach a useful target query
  • How to go beyond the quality ceiling of retrieval-plus-ranking search suggestions?
  • How to suggest completions for rare, new or misspelled queries that are missing from the candidate index?

Tools and methods

  • Decoder-only transformer, a few hundred million parameters — predicts the next token over user-event sequences.
  • Pretrain, then fine-tune — event chains first, then context plus prefix to target suggestion.
  • Beam search — keeps several probable continuations to produce a set of suggestions.
  • TensorRT-LLM on a GPU cluster — serves tens of thousands of requests per second.
  • Expected actions count — offline metric for suggestion quality.
  • Runtime post-filters — ban lists, duplicates, empty-results check.
Continue reading — it's free

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