Choosing Artwork per Viewer: Designing a Poster Ranking Service
Machine LearningModel answerLast updated
Design an ML system that picks which candidate artwork to display for each title and viewer on a video streaming service, covering reward design, exploration, cold start, serving, and evaluation.
Choosing Artwork per Viewer: Designing a Poster Ranking Service
A video streaming service shows a grid of titles (movies and shows) on its browse screen. Every title has several candidate images that could represent it: frames sampled automatically from the video, plus a handful of artwork variants made by editors. Your task is to design a machine learning system that decides, for each viewer and each title on screen, which image to display, with the goal of maximizing real engagement (the viewer opens the title and actually watches it).
Describe the full system: how you frame the problem, which data and labels you use, the model, offline and online evaluation, serving at scale, and production monitoring. Also argue whether the choice should be personalized per viewer or whether a single best image per title is enough.
Assumptions
- The catalog holds roughly 100,000 titles, each with about 5 to 30 candidate images.
- There are tens of millions of users, and each page renders many titles at once.
- The image decision must fit inside the page-render budget: single-digit to low tens of milliseconds for the selection step.
- New titles and newly generated images arrive continuously, so cold start is a constant issue.
- The main signal is the click plus the viewing that follows. Clicks alone may not reflect genuine interest.
What to cover
- Which engagement signal to optimize, and the risks of a coarse signal versus a more nuanced one.
- Personalized choice versus one global winner per title, and how you would decide.
- How candidate images are produced and what eligibility rules (editorial, brand, safety) apply.
- How a brand-new title or image starts to be shown well.
- Quality and safety guardrails, such as no misleading or inappropriate frames.
Hints
Hint 1
You only see feedback for the image you actually displayed. What does that imply about whether this is plain supervised learning, and what framework fits better?
Hint 2
A click followed by an immediate exit is not success. Think about defining a reward that needs some minimum viewing, and what you would log so that you can later evaluate policies you did not run.
Hint 3
Split the system into batch, near-line and online parts. Precompute image embeddings and priors, update per-image statistics in a stream, and keep the online step to a cheap scoring pass with a safe fallback.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Clarify and size the problem
Assumptions with numbers:
- Catalog: 10^5 titles x ~15 images = ~1.5M images. With 256-dim float32 embeddings that is ~1.5 GB, less if quantized, so everything fits in memory.
- Traffic: ~30M daily users x ~3 page loads x ~40 titles = ~3.6B decisions/day, roughly 40k/s average and ~150k/s at peak.
- Latency: a ~10 ms budget to score about 40 titles x 15 images = 600 candidates per request, so the model must be cheap.
- Guardrails: only editorially eligible images, no spoilers or explicit frames, maturity ratings respected, and a minimum image quality (no blur or black frames).
Title ranking is upstream and fixed. This system only picks the image for a title already on the page.
2. Framing and reward
This is a contextual bandit, not ordinary supervised learning. The context is user, title, device, row and position. The arms are the eligible images for that title. The reward is observed only for the image shown, which is the central difficulty: logged data reflects the old policy's choices.
Reward. Raw click-through rate rewards misleading frames (clickbait). Full completion is too sparse and delayed. A practical middle is a qualified play: a click followed by at least a threshold of viewing (for example 2 minutes or 10% of runtime). A shaped version gives small or zero credit to a click abandoned within about 30 seconds, and possibly a negative value for click-then-bounce. Long-term watch time and retention are checked in A/B tests rather than used as the training label.
Position bias. Train with row and position as features, then score at a fixed reference position at serve time so an image is not credited for a good slot.
3. Data and features
Log each impression as (user, title, image, position, device, timestamp, propensity, policy_version) and join it with clicks and watch time over a 24 to 48 hour attribution window. Logging the propensity is mandatory, since off-policy evaluation and debiased training depend on it.
Features:
- Image: embeddings from a pretrained vision encoder (CLIP-style), plus attributes such as face count, recognized cast, close-up versus wide shot, text overlay, brightness and contrast, an aesthetic score, and source (editorial or auto-sampled).
- User: an embedding from viewing history, genre and cast affinities, and recent reactions to image attributes.
- Context: device (TV and mobile read differently), row type, time of day.
4. Model, in stages
- Global per-title bandit. Thompson sampling with a Beta posterior on qualified-play rate per (title, image). Simple, robust, and converges fast for popular titles.
- Personalized model. Score = sigmoid(w . [user_emb * img_emb, img_attrs, title_feats, ctx] + b_{title,image}). The per-image bias captures global appeal; the interaction term captures taste (a romance fan sees the couple, an action fan sees the explosion). Train with logistic loss, weighting examples by clipped inverse propensity to correct selection bias.
- Exploration. Thompson sampling or LinUCB on the last layer, or epsilon-greedy with epsilon around 5% in the long tail. Every decision records its propensity.
Cold start. Train a content-only model that predicts an image's qualified-play rate from pixels and attributes. Use it to initialize the bias term and the Beta prior, so a new image starts with a sensible estimate and exploration refines it. New titles borrow from similar titles (genre, cast, embeddings).
5. Serving
- Batch: run new images through the encoder, attribute extractors and quality/safety filters. Push embeddings, priors and posterior parameters into a key-value store keyed by title.
- Near-line: a streaming job (Kafka/Flink) aggregates impressions and qualified plays per (title, image) every few minutes and updates posteriors. User embeddings refresh daily with a session-level update. The full model retrains daily.
- Online: the page service gets titles from the recommender, the thumbnail service fetches the user embedding once, batch-scores all eligible images with a dot product and small MLP (~600 scores in under 5 ms on CPU), samples or takes the argmax per the policy, and logs the propensity.
- Stickiness: keep a user's image for a title stable across a session or a few days. Flickering confuses users and muddies attribution.
- Fallback: on any timeout, serve the cached global-best image per title.
6. Evaluation
Offline. Log loss and AUC on time-split holdouts are sanity checks. Policy value matters more: IPS, self-normalized IPS and doubly robust estimators on logged exploration data, and replay on a uniformly random traffic slice. Slice by new versus popular titles, device and user cohort.
Online. A/B test randomized at user level. Primary metrics: qualified plays per member and streaming hours. Secondary: 7 and 28 day retention. Guardrails: click-to-abandon rate, completion rate, cannibalization (did total plays rise or just move between titles?), and latency.
7. Monitoring
- CTR versus qualified-play divergence per image; rising clicks with falling watch depth signals clickbait.
- Calibration of predicted versus observed reward.
- Exploration health: actual exploration rate and propensity distribution, alerting when propensities approach zero.
- Coverage: share of images receiving any traffic.
- Drift in features and embeddings, and freshness of posteriors.
- Safety: audits of top-served images and a per-image kill switch for editors.
8. Trade-offs
- Global versus personalized. Global needs far less data and is easy to reason about. Personalization can lift niche users and tail titles but adds features, latency and variance. Decide by experiment: ship the global bandit first, then measure the incremental lift of the personalized model, especially on tail titles.
- Exploration versus exploitation. More exploration learns faster but costs short-term engagement on every exploratory impression. Concentrate it on new images and low-traffic titles.
- Reward delay. A longer attribution window is more faithful but slows learning. Use an early proxy (click plus 2 minutes) for the online posteriors and the full window for daily retraining.
Common mistakes
- Training on logged data as if it were randomized, without propensities or correction.
- Optimizing CTR alone and rewarding misleading frames.
- Ignoring position and device effects.
- No cold-start path, so new images are never shown and never learn.
- Letting images change on every visit.
- Skipping safety filters and a fallback.