YandexGPT in the Browser: how we taught the model to summarize articles

Sergey Yudin6 Jul 2023

Problem

Yandex wanted a one-click summary of any web page in Yandex Browser: about a thousand characters, shown as a list of key points, for texts up to 30K characters. The base YandexGPT model could already summarize, but prompting it gave unpredictable formats. A summary also must not be too long, must stay concise, must not distort the main idea and must not add facts absent from the article. Page text comes from third parties, so it can carry instructions aimed at the model.

Example from the article: a prompt asking for key points on new lines starting with "—" worked once, then the format changed on repeats and harder articles.

Solution in brief

The team ran two stages: research, which picks the model and tuning method against a quality acceptance basket, then production, which collects a dataset and fine-tunes. Fine-tuning on 35–50K examples fixed the format, improved other quality aspects and made the model more resistant to prompt injection. Removing about 1K bad examples out of 50K and fixing separators lifted quality by almost 40%.

Questions this case answers
  • How to make a generative model produce a fixed output format and predictable quality when prompt instructions alone give unstable results
  • How to raise the quality of a fine-tuned LLM when its human-written training set contains instruction violations
  • How to make an LLM return the same summary format on every page in a one-click browser feature?
  • How to decide between prompt tweaks, P-tuning and fine-tuning for a summarization feature?

Tools and methods

  • YandexGPT — base generative model family, tuned for summarization
  • Abstractive summarization — the summary is generated from the whole article, not copied
  • Prompt engineering — baseline instructions, tested for format stability
  • P-tuning — considered for tens to hundreds of examples
  • Fine-tuning — used for 35–50K examples; gave the best result
Continue reading — it's free

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