ML-Readability: How Yandex Browser Extracts Web Page Content for Summarization

Mikhail Katunkin24 May 2025

Problem

Yandex Browser summarizes web pages and answers questions about them with a small LLM (1B–7B parameters). Raw HTML is about 150 thousand tokens for an ordinary news page, and plain text still contains ads, menus and comments. Small models cope badly with such junk and pull it into the summary. The previous extractor, a heuristic reader-mode script, covers top domains but goes stale and works worse on the long tail. Each fix means a browser commit and a wait for a release.

Example from the article: one text-extraction library occasionally let a font name (Georgia) through, and each time the model saw it, it wove unrelated content into the summary.

Solution in brief

Treat extraction as binary classification of DOM-tree leaves with CatBoost on cheap features, so it runs on the client in the browser. Train it on stratified, crowd-labeled pages. Then fine-tune an LLM with LoRA on that labeled set, let it label 100 thousand pages, and retrain CatBoost on them.

Questions this case answers
  • How to extract the main text of a web page on the client under strict size and latency limits so that a small language model can summarize it
  • How to build a stratified labelled dataset from heavily skewed traffic and obtain labels from a language model teacher
  • How to extract the main text of a web page for an LLM without sending raw HTML to a server
  • How to measure the quality of main-content extraction from web pages

Tools and methods

  • CatBoost on leaf features — fast classifier that runs on the client and on CPU
  • Equivalence classes of leaves — leaves with the same path to the root are classified together
  • Stratified sample of top hosts — pages per host proportional to the logarithm of traffic
  • LLM teacher with LoRA — labels pages synthetically (YandexGPT)
  • Sliding-window DOM slicing — fits long pages into the LLM context
Continue reading — it's free

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