ML Systems Lab Open interactive version →
Intermediate 22 min read recommender systemRecSysretrievalranking

Recommender System Overview

Retrieval vs ranking vs diversity, the staged funnel, the data flywheel

A single ranking model cannot solve the scale problem and the quality problem at once. Score 10 million items with a good model in under 50ms? At even 1ms per item that's 10,000 seconds — you're off by five orders of magnitude.


So every large recommender is a funnel. Retrieval (candidate generation) narrows millions to thousands with fast approximate methods; ranking orders the survivors with an expensive precise model; re-ranking layers diversity, freshness, and business rules on top. Each stage is a different engineering tradeoff, and the ordering is forced: the cheap stage must run over everything, the expensive stage only over what the cheap stage kept.


Recall at retrieval is a ceiling you can't raise later. An item retrieval drops is gone — no downstream stage can rank an item it never received. That's why retrieval optimizes recall and ranking optimizes precision: they're different objectives because they sit at different points in the funnel.


Re-ranking exists because "most relevant" and "best final list" aren't the same thing. A ranker sorted purely by predicted engagement will happily fill the whole list with near-duplicates of one dominant interest — each individually well-scored, but repetitive as a set. Re-ranking corrects for that after ranking, not instead of it: it caps how many near-duplicate items can sit together, injects freshness the ranker alone would never favor, and applies business rules (e.g., no two ads back-to-back) on top of the ranker's precision-ordered list. Skip re-ranking and the ranker's raw output ships as-is — accurate item-by-item, but monotonous overall.


The data flywheel is why incumbents are so hard to displace. More users → more interaction data → better models → more engagement → more users. Much of that model quality comes from collaborative filtering — inferring what a user will like from patterns across *other* users' interactions (people who watched X also watched Y), not from anything intrinsic to the item itself. A new entrant with no interaction history can't run collaborative filtering at all and must limp along on content features until it accumulates a base.


Cold start is the flywheel's edge case, and it has a specific playbook. A user with zero watch history can't be served by collaborative filtering, so the system leans on what it does have: context (device, time of day, location), content features (the item's own attributes, not who else liked it), and a popularity fallback (globally or regionally trending items) to make the first few recommendations reasonable. From there, every watch-time signal in the session — a 2-second skip vs. a 30-second watch — updates a real-time embedding for that user, so personalization sharpens within the same session rather than waiting for a next login.

Key points

Takeaway

A recommender is a recall-then-precision funnel: retrieval cheaply maximizes recall over millions (and sets an unraiseable ceiling on final quality), ranking expensively maximizes precision over the survivors — one model can't occupy both ends.

Recap

Check your understanding

Q1. TikTok shows relevant videos in your very first session, before any watch history exists. What best explains how?

Q2. Your ranker scores 0.95 AUC offline, but users complain the recommendations miss obvious interests. Retrieval recall@500 is 0.6. Where's the bug?

Q3. Select the two correct consequences of a pure-exploitation recommender (always serving the highest predicted-engagement item).

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →