How do you evaluate a new ranker using logs from an old policy?
Written by the mlprep team · Updated
You have logs from the current recommender. How can you estimate whether a new policy would perform better without fully launching it?
The problem#
Logs are generated by an old policy. You observe outcomes only for items that policy showed. A new ranker might show different items, but you do not know how users would have responded to those unshown items.
This is off-policy or counterfactual evaluation.
Naive replay#
A simple approach replays the new policy on logged contexts and evaluates outcomes when the new policy picks the same action the old policy picked. This is unbiased only when there is enough overlap, but it wastes most data and fails when the new policy differs much from the old one.
Inverse propensity scoring#
If the old policy logged the probability of showing each item, IPS can reweight observed outcomes:
estimate = outcome * new_policy_prob / old_policy_prob
Intuition: outcomes from rarely shown actions represent many similar cases that were not observed.
Variance and support#
IPS can have huge variance when old-policy propensities are small. If the old policy never showed an item in a context, you cannot estimate that outcome from logs. This is the support problem.
Common mitigations:
- clip large IPS weights
- use self-normalized IPS
- collect exploration traffic
- use doubly robust estimators that combine a reward model with propensity weighting
Senior/staff considerations#
Counterfactual evaluation is a risk-reduction tool, not a replacement for A/B testing. It is useful for filtering bad policies before launch and estimating directionality when experimentation is expensive.
A strong answer mentions logging requirements: action, context, outcome, old-policy propensity, candidate set, ranking position, and eligibility constraints. Without propensities or exploration, claims are weak.
Also monitor whether the new policy stays within logged support. If it recommends items the old policy almost never showed, offline estimates are unreliable.
The key takeaway unlocks after you reveal an expert answer.
Key Takeaway
Counterfactual evaluation estimates a new policy from old-policy logs. IPS uses logged propensities to debias outcomes, but variance and support mismatch are major limitations. Exploration traffic and doubly robust estimators improve reliability, but A/B testing remains necessary for launch decisions.
Follow-up Questions to Test Yourself
Interviewers often pivot here once you cover the core concept.
- Why do you need logged propensities for IPS?
- What is the support problem in off-policy evaluation?
- When would doubly robust estimation beat IPS?
How confident do you feel explaining this?
Track your understanding or flag it to revisit before your next loop.
Related Questions