RecSys · textbook
Trainer Widgets Revision All chapters

About the project

A textbook on recommender systems written for one particular job: to prepare for an interview well enough to explain any topic out loud — with the derivation, the numbers, and an understanding of where the technique stops working.

What this is

There is no shortage of material on recommender systems, and almost all of it answers the question «what is done». Far less often does it answer «why exactly this way, and where does it break». This textbook grew out of an attempt to take every topic down to that second level.

Hence three features of the format:

How the claims are verified

Three levels of checking
  • The maths inside the widgets is reproduced by an independent implementation in Python: the same inputs, separately written code, tolerance 1e-9. The folding and re-ranking-bandit simulations agree bit for bit.
  • Claims about someone else's code are verified automatically. A script extracts the parameters straight from the sources and compares them with what the text says — 122 checks. A claim cannot drift from the code it describes.
  • Structural integrity of the pages is a separate check: broken anchors, duplicate identifiers, unrendered formulas, a «widget …» link pointing into a section with no widget. Every one of those classes of error has happened here for real, which is why they are checked.

Where the material comes from

Two sources, and both are the author's own.

PartSource
Reading a real system Original analysis of the open-sourced «For You» feed at X. Short code excerpts are quoted under Apache 2.0 naming the file and the commit; the explanation, structure, figures, numbers and widgets are ours
Theory Primary sources: papers, open documentation, open code. Every claim carries a reference to the work it is taken from, and every numerical example carries the script in _tools/ that computed it
What is quoted here

The only third-party material in the textbook is short excerpts of the source code of x-algorithm, published under Apache 2.0. Every excerpt is attributed: file, commit, link to the original. The full list is in the repository's NOTICE file.

Every figure is drawn for this textbook: not one drawing in the text is an image — all the graphics in the chapters are inline SVG right in the page markup, so they scale, stay readable in the dark theme, and cannot drift from the text around them.

There are two kinds of raster file in the project and both sit outside the text: the brand mark and the chapter covers. The covers are drawn by a model from prompts kept in the repository (docs/_tools/cover_prompts.md) — they decorate the contents page and the link preview, they are not content. Not one explanation, figure or number is taken from them.

The author

TLIAMOV LAB

Anvar Tliamov — an ML engineer working on recommender systems. This textbook grew out of my own interview preparation: almost everything I could find explained what is done and almost nothing explained why it is done that way and where it breaks, so I wrote that second level down myself.

Get in touch on LinkedIn. Questions about the textbook, mistakes you spot and suggestions are all welcome.

Rights

The text of the textbook, the figures and the structure are the author's, all rights reserved. The build and verification tooling, and the source of the widgets, are published under the MIT licence: take them and use them freely.

Quoting excerpts for review, teaching or commentary is ordinary fair use and needs no permission from anyone.

Current state

The theory is written in full: nineteen chapters from stating the problem to designing a system. The walkthrough of the open-sourced feed — eleven chapters — is finished too.

The English edition is complete: all thirty pages, the metrics trainer, the widget catalogue, the revision mode and the search all exist in both languages, and every widget speaks the language of the page it stands on. The textbook also keeps growing: wordings are sharpened, widgets and numerical examples are added. Every change goes through the same checks described above, so a disagreement between the text and its numbers, or between the text and the code, is caught automatically — and a separate check compares every English page with its Russian original.

Statistics

The site counts page views and how far down the page people read. The counter is GoatCounter: no cookies, no profiles, nothing passed to third parties — which is why there is no consent banner here. It exists for exactly one purpose: to know which chapters are read to the end and which are abandoned halfway.

What is sent is four scroll-depth marks, the fact that a question was opened and the fact that a widget was touched — one of each per page. Neither the text, nor your answers, nor anything else about you goes anywhere; everything you mark in review mode and in the trainer stays in your browser.