Applied AI Vol. 1

Off-Policy Evaluation: Judging a New Policy From Old Logs

Inverse propensity scoring estimates how a new decision policy would have performed using data collected by a different one.

Applied AI Vol. 1 · 5 min read

Before deploying a new recommendation or routing policy, you would like to know how it would do. Off-policy evaluation estimates that from logs, without running the policy.

The setup

You have logs of contexts, actions taken by a logging policy, and rewards. A new policy would sometimes choose different actions. You only observe the reward for the action actually taken, so you cannot read off what the new policy would have earned.

Inverse propensity scoring

For each logged example, multiply the reward by the ratio of the new policy’s probability of the logged action to the logging policy’s probability of it. Average these. If the logging probabilities are known and positive wherever the new policy puts mass, this average is an unbiased estimate of the new policy’s value.

Intuitively, an action the logger rarely took but the new policy likes is up-weighted, because it stands in for many similar cases that never got logged.

What goes wrong

  • The logging policy must have explored. If it never took an action, there is nothing to learn about it.
  • Probabilities must be recorded at decision time, not reconstructed later.
  • When the new policy differs a lot from the old one, weights get large and the estimate becomes very noisy.
  • Logs with selection or feedback loops may violate the assumptions.

Report uncertainty

Give an interval, for example by bootstrapping over independent units. Check the effective sample size, and treat a large estimated gain with a tiny effective sample as untrustworthy. Use the estimate to screen candidates, then confirm the finalist with a controlled online test.

More guides from this book