KatInterview

From CTR Prediction to Sequential Feed Ranking with RL

Machine LearningModel answer
MediumModel answerMachine Learningreinforcement-learningoff-policy-evaluationdoubly-robust

Last updated

Design a sequential feed-ranking system for long-term retention: choose bandit vs MDP, evaluate offline with doubly robust estimators and overlap checks, and design rewards and A/B guardrails.

Context

You work on the data science team of a large social platform. The current feed ranker is a supervised model that scores each item by its predicted click probability. Leadership wants to replace it with a reinforcement-learning approach that ranks items throughout a session and is optimized for how likely users are to keep coming back, not for immediate clicks.

What you need to answer

  1. Choosing the formulation. Contrast a (contextual) multi-armed bandit with a Markov decision process for this problem. User tastes and mood can shift while a single session unfolds. Which formulation fits better, and why?

  2. Offline evaluation. The new policy will be trained on logged data from the existing system. Describe how you would use a doubly robust estimator to judge the new policy before it reaches users. What diagnostics would you run to confirm that the old (logging) policy covers the behavior of the new (target) policy well enough?

  3. Reward and safety. Return visits are a delayed and sparse signal at the session level. How would you build a reward that balances immediate engagement against long-term retention? Then name two concrete guardrail metrics you would monitor during the online experiment to make sure the new policy does not hurt user experience.

State your assumptions, discuss trade-offs, and point out where each approach is likely to break.

Hints

Hint 1

Ask whether an item shown now can change what the user does or feels later in the same session. If so, which framework models that dependence explicitly, and what does the other one ignore?

Hint 2

A doubly robust estimator combines a model-based prediction with an importance-weighted correction of that model's residual. Think about which quantities must be logged at serving time, and how you would measure whether the importance weights are well behaved (tails, effective sample size, horizon length).

Hint 3

For a sparse delayed outcome, consider training a model that predicts return probability from the session-end state and using changes in it as a dense shaping signal. For guardrails, think about what an optimizer could exploit (sensational content) and which user segments could be harmed while the average looks fine.