Counterfactual Evaluation for Recommendation Systems

Eugene Yan10 Apr 2022

Problem

Teams evaluate recommenders offline like classifiers: split logged interactions into train and validation sets, then compute recall, precision or NDCG. But users can only click or buy what the old system showed them. The validation set measures how well the new model fits logged behavior, not whether users would click or buy more if they saw its recommendations. A/B tests answer that but are slow and risk shipping a bad recommender.

Example from the article: a new model and the production model both recommend an iPhone on the Pixel detail page, with probabilities 0.6 and 0.4. A logged click on that recommendation should count 1.5 times in the new model's score.

Solution in brief

Treat recommendation as an intervention and reweight each logged reward by how much more or less often the new model would have made that recommendation than the production model did (inverse propensity scoring, IPS). The self-normalized variant (SNIPS) was the most accurate in the cited simulation and needs no tuning parameter.

Questions this case answers
  • How to estimate the outcome of a new decision policy offline when the logged data was generated by a different policy and an online test is slow or risky
  • How to correct exposure bias in offline evaluation when only shown items can receive feedback
  • How to evaluate a new recommender offline when users only interacted with items the old recommender showed?
  • How to estimate the outcome of an A/B test for a new recommender without running it?

Tools and methods

  • Inverse propensity scoring (IPS) — reweights logged rewards by the ratio of new to old recommendation probabilities.
  • Clipped IPS (CIPS) — caps the weight at λ.
  • Self-normalized IPS (SNIPS) — divides IPS by the mean importance weight.
  • Direct method (DM) — trains a model to impute missing rewards.
  • Open Bandit Pipeline — simulation framework with a public dataset that logs action probabilities.
Continue reading — it's free

Google or a one-time email code. No password.