Design Video Recommendations
A video recommendation system is a service that picks the next videos a viewer is likely to enjoy. Clicks alone mislead, so the order rests on viewing time and signs of satisfaction.
The ask
The design fills the home screen and the up-next slot of a video app.
A home request leans on the viewer. An up-next request leans on the video playing now.
The first questions fix the goal. A valued viewing matters more than a click that ends fast.
Live streams and a deep back catalogue both belong in scope. Fresh uploads compete with older proven videos.
Estimate the scale
The platform serves 5,000,000,000 video views a day.
5,000,000,000 views ÷ 86,400 seconds = 57,870 views per second.
Most views trigger a fresh set of recommendations.
One training example from a view takes 200 bytes.
5,000,000,000 views × 200 bytes = 1,000,000,000,000 bytes of new training data a day. That is 1 TB a day.
Data and features
Each view logs the viewer, the video, the time and what happened next.
Watch time is the total time a viewer spends watching a video.
A click is a weak label on its own. A click, a full viewing and a save together are far stronger.
Features describe the viewer, the video and the pair. Recent topics watched, video length and language are examples.
Titles and captions give each video text features. A skip in the first moments is a strong negative signal.
High-level design
A request arrives with the viewer and, for up-next, the video playing now.
Candidate sources run side by side. Followed channels, similar videos and fresh uploads each contribute.
Similar videos come from embeddings and nearest neighbour search. Similar viewers contribute a second source.
Filters remove blocked channels, unavailable videos and repeats the viewer has just skipped.
The ranking model scores the survivors, and the screen shows the highest scores first.
Training the model
Training examples come from completed viewings. Point-in-time correctness keeps each example's features as they stood at showing time.
A label is final only when the viewing ends. Records stay open until the viewing closes.
Popular videos dominate the raw log. Training caps how often one video can appear, so small channels keep a hearing.
1 TB a day × 90 days = 90 TB. The design keeps 90 days of examples for training.
The model retrains on a regular schedule. Trend features refresh far faster than the model itself.
Serving predictions
Candidate lists per viewer are precomputed and refreshed after each viewing.
Ranking runs per request, inside a tight time budget. The current video shapes up-next scores most of all.
Each stage gets a deadline. A slow source is dropped rather than holding the screen.
A served list stays stable through one session. Fresh picks arrive at the next refresh, not under the viewer's eyes.
A trending and safe fallback list covers failures. An empty home screen is the worst outcome.
Deep dive: watch time
Raw watch time favours long videos over satisfying ones.
A viewer who leaves a 60 minute video halfway gives it many minutes of watch time.
60 minutes ÷ 2 = 30 minutes of watch time from that halfway exit.
A viewer may finish a 3 minute video in full and value it highly. The finished video still earned far less watch time.
The share watched repairs part of the bias. Ranking uses minutes watched and share watched together.
Survey answers, saves and shares add the satisfaction side. Hides and fast skips pull the other way.
Deep dive: fresh videos and new viewers
A fresh video has no viewing history, the same cold start as a new item.
Its title, captions and sound give content features. Those features place its first embedding near similar known videos.
A small test audience sees the video first. Strong completion and satisfaction earn a wider showing.
A new viewer starts from language, place and broad popular picks. The first viewings become personal features quickly.
Reserved slots keep fresh uploads visible. Without them, proven videos would crowd out every newcomer.
Evaluation and trade-offs
Offline tests replay past home requests and grade the order against known outcomes.
The replay cannot judge videos that were never shown. A live experiment on a small share of requests follows.
The live measures are watch time, share watched, survey scores and hides. Return visits on later days count as well.
The feedback loop is the standing risk. Shown videos gather the evidence that trains the next model.
A small share of picks stays deliberately varied. That variety keeps evidence flowing about videos the model undervalues.
What the signals say
| Signal | What it shows |
|---|---|
| Click | Interest at first glance |
| Time spent viewing | How long a video holds a viewer |
| Share watched | Part of the video finished |
| Save or share | Value beyond the viewing |
| Hide | A clear rejection |
Exercise
Why does ranking use the share watched alongside minutes watched?