Tag: RL

  • ML0170 Value vs Policy Iteration

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0232 GRPO CoT Length Inflation

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0231 Alignment Tax and the KL Penalty

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0228 RLVR Verifier False Negatives

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0220 Controlling LLM Output Length

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0219 Preference Modeling vs Reward Modeling

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • DL0204 Verifiable Rewards and RL-Only Reasoning

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • ML0130 Multi-Armed Bandits

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • MSD0153 Contextual-Bandit Safe Deployment

    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.

    Line-art scene: a user facing a feed of near-identical cooking clips plus one unfamiliar slot; one path leads to a stale feed, another to wasted random slots, and both feed a click log that trains tomorrow's ranker, marked with a question mark

    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 x (user, session, surface), arms from the top-K shortlist, and reward r 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 1-\epsilon, 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 \alpha \sqrt{x_a^{\top} A^{-1} x_a} and serve the argmax, which is optimism under uncertainty.

    Exploration layer architecture: the ranker scores a top-K shortlist, the explore policy picks an arm and emits its probability, the served slot carries that probability, rewards land in a propensity log, the log feeds off-policy evaluation and an A/B guardrail gate that ships the winning policy, and a routed loop retrains the ranker with IPS weights

    Figure 1: The exploration layer acts between ranker and user, attaches p(a \mid x) 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?


    Login to view more content
  • MSD0147 Thumbnail Artwork Personalization

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.