Design the mechanism that decides how a recommender system explores: the layer behind ‘try something new’ in feeds, notifications, and ads. Pure exploitation stagnates (no new items, filter bubbles), while naive exploration burns engagement on random content and corrupts your own training data.
You must pick which users see which exploratory content, at what rate, and under which guardrails. The logged data from exploration also feeds tomorrow’s model, and it biases that model if you are careless.
How would you design this mechanism? Cover the contextual-bandit formulation (context, arms, reward) and common policies (epsilon-greedy, Thompson sampling, LinUCB/UCB-style) and where each fits, propensity logging and why you must record the exploration policy’s own probabilities, off-policy evaluation (IPS, SNIPS, doubly robust) for judging a new policy before launch, exploration budgets and guardrail metrics, and how bandit serving relates to (but does not replace) A/B testing.
The Problem: never trying new items starves the feed, trying them at random wastes slots, and whichever you choose today becomes the training data that shapes tomorrow’s ranker.
Answer
Treat exploration as a contextual bandit that sits after the ranker. The context is the user, session, and surface, the arms are the ranker’s top-K shortlist for the slot, and the reward is a short-horizon signal such as a click with minimum dwell. Inside a fixed exploration budget of about 3% of impressions, default to Thompson sampling over the shortlist with a propensity floor, so exploration goes to plausible-but-uncertain items instead of random ones. Every impression logs the probability the serving policy assigned to the action it actually took. That propensity makes tomorrow’s training data correctable and lets IPS, SNIPS, and doubly robust estimators score a candidate policy before launch. Off-policy evaluation screens candidates cheaply, while an A/B test with guardrail metrics still makes the launch call.
(1) Shared Substrate: context (user, session, surface), arms from the top-K shortlist, and reward from short-horizon engagement; every policy below plugs into the same logging and evaluation path.
(2) Epsilon-Greedy: serve the ranker’s top item with probability , otherwise a uniformly random shortlisted arm, so propensities are known in closed form.
(3) Thompson Sampling: draw model parameters from a posterior and serve the arm that wins under the draw, so each arm is chosen in proportion to its probability of being best.
(4) LinUCB / UCB-Style: score each arm by predicted reward plus an uncertainty bonus and serve the argmax, which is optimism under uncertainty.
Figure 1: The exploration layer acts between ranker and user, attaches to every served slot, and routes the logged tuples into off-policy evaluation, the A/B gate, and propensity-weighted retraining.
Clarify Before Designing:
(1) Action Space: is exploration over a 20-item shortlist per slot, or over the full catalog (millions of ads)? This decides whether per-arm propensities stay usable.
(2) Reward and Delay: click, dwell, conversion, or 7-day return? A conversion that lands two days later changes how often the policy can update.
(3) Surface Sensitivity: feed slots, push notifications, or ads? A bad exploratory notification can cost an opt-out, so budgets differ by surface.
(4) Guardrail Tolerance: how much relative engagement loss may exploration cost, and which metrics are hard stops (hides, reports, unsubscribes)?
(5) Item Churn: how many new items arrive per day and how fast do they go stale? This sets the minimum exploration volume.
(6) Existing Logs: do current logs record serving probabilities, or is the history deterministic and unusable for off-policy evaluation?