Estimate a New Recommendation Policy's Value From Logged Data With IPS

Last updated: November 29, 2026

Quick Overview

Before running an A/B test, you want to estimate how a new widget recommendation policy on the Amazon homepage would perform using logs from the current randomized-exploration policy. Explain inverse propensity scoring, its variance problems, and implement IPS and self-normalized IPS.

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


Before running an A/B test, you want to estimate how a new widget recommendation policy on the Amazon homepage would perform using logs from the current randomized-exploration policy. Explain inverse propensity scoring, its variance problems, and implement IPS and self-normalized IPS.

Personalization teams at Amazon run off-policy evaluation to screen candidate policies cheaply before spending experiment traffic. The interviewer checks that you understand why naive replay is biased, the role of logged propensities, and practical variance control.

What the Interviewer Expects
  • Explains why averaging rewards of matching actions is biased
  • Derives the IPS estimator and its unbiasedness condition
  • Requires logged propensities and support for the new policy's actions
  • Discusses variance, clipping and self-normalization
  • Mentions doubly robust estimation as an improvement
Key Topics to Cover
off-policy evaluation
inverse propensity scoring
self-normalized IPS
doubly robust
contextual bandits
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • What happens if the logging policy never showed an action the new policy wants?
  • How does weight clipping trade bias for variance?
  • How would you extend this to ranking several items in a carousel?
  • How would you check whether the off-policy estimate is trustworthy?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Ask whether the current policy logs the probability of the action it chose (it must), what the reward is (click or purchase within a session), and how different the new policy is from the logging poli...

Approach

The logs only show rewards for actions the old policy took. Reweighting by w=πnew(a∣x)/πlog(a∣x)w = \pi_{new}(a|x) / \pi_{log}(a|x) corrects for the mismatch. IPS estimates the new policy's value as $\hat V = \frac{1}{n...


Submit Your Answer
Markdown supported