INFINITE UPSIDE

Business and technology

Can Yesterday’s Log Evaluate a New Recommender?

A recorded click is useful only when the logging design supports the policy being evaluated.

A recommendation log records what happened after the system displayed something. It usually does not record what that same person would have done after every alternative display. Asking a new recommender to choose from yesterday's contexts does not fill in those missing outcomes.

Offline replay can nevertheless support a useful comparison when the log was collected for it. The crucial asset is a known random assignment process with the right coverage, not a particularly large spreadsheet.

The historical method and its limits

Li, Chu, Langford and Wang's Yahoo news-recommendation paper, version 2 dated March 2012, analyzes replay under independent, identically distributed events and uniform random logging over a fixed set of actions. Matching events are retained; mismatches do not update the evaluated algorithm. Its fixed-retained-horizon guarantee and fixed-policy concentration result have different conditions. Its online comparison also discusses repeated visits and unlogged business rules.

The distinction worth keeping is between an observed reward and an available reward for the proposed policy. A click on the logged recommendation is real. It still may be the wrong recommendation's outcome for your question.

An original seven-event log

Consider a fictional stream with two available articles, A and B. Assume each event's context and potential rewards are drawn independently from one stable distribution; only the displayed article's reward is observed. The logging system independently chooses either article with probability one-half, without using context or past rewards. A binary reward records whether the displayed article was clicked after complete follow-up.

Our candidate is fixed: recommend A in a business context and B in a casual context. It does not learn or change during replay. Prespecify that the evaluation stops when it has retained four matching events. The following seven raw events happen to reach that target:

1. Business context; the logger displayed B; observed reward 0. The candidate would choose A. Skip the event. Its zero belongs to B, and A's reward is unobserved.

2. Casual context; logged B; reward 1. The candidate also chooses B. Retain this as candidate event 1, with reward 1.

3. Business context; logged A; reward 1. Retain candidate event 2, with reward 1.

4. Business context; logged B; reward 0. Skip. It is another mismatch, not another candidate failure.

5. Casual context; logged A; reward 1. Skip this reward too. Discarding attractive mismatches is just as necessary as discarding unattractive ones.

6. Business context; logged A; reward 0. Retain candidate event 3, with reward 0.

7. Casual context; logged B; reward 1. Retain candidate event 4, with reward 1, then stop.

The retained average is (1 + 1 + 0 + 1)/4 = 75%. This tiny invented realization is an arithmetic demonstration, not evidence that the recommender would achieve a 75% click rate in any real product.

Why the denominator matters

Dividing the three retained clicks by all seven raw events gives about 42.86%. That treats three missing candidate outcomes as known zeros. Counting every observed click gives 4/7, about 57.14%, but includes a click on A when the candidate would have shown B. Neither operation evaluates the stated candidate.

Because either logged action has probability one-half in every context, an event has the same one-half chance of matching the candidate in a business context as in a casual one. Selection by matching therefore does not systematically prefer one context type. That equality is doing real work; an arbitrary production system need not provide it.

At this matching probability, the expected number of raw events needed to retain four is 4/(1/2) = 8. Realizing four matches in seven draws is entirely possible. Eight is an expectation, not a guaranteed log budget. Under these assumptions, averaging a fixed number of retained rewards is unbiased for this fixed candidate's expected reward per event; four observations still supply very little precision.

A learning candidate would add another requirement: update its state only after retained events, in their retained order. Updating it on skipped observations would let it learn from experiences it would not have received in the corresponding replay history. Our fixed candidate avoids that complication rather than pretending it has been tested.

A fixed log is a different problem

Stopping after four retained events is different from stopping at the end of a seven-event file. With a fixed raw file length, the retained count is random. A reward-divided-by-retained-count estimate is not generally unbiased for every adaptive algorithm; it is also undefined when nothing matches. Do not carry a fixed-horizon theorem across that change of denominator without checking it.

Similarly, a logger that almost always shows A may omit the actions needed to evaluate a policy that often chooses B. Nonuniform random logging calls for a method that accounts for its actual probabilities. A deterministic log cannot reveal an action's absent rewards simply through more careful replay bookkeeping.

Ask what else determined the display: candidate eligibility, safety rules, overrides, availability, delayed feedback and previous recommendations. If yesterday's policy changed today's contexts, the independent-event model needs scrutiny too. A simulation can explore assumptions about missing rewards, but those assumptions should remain visible rather than appear as observed clicks.

The decision before the comparison

Before calculating a score, produce one auditable event trace like the one above. State the logging probabilities, candidate actions, retained and discarded events, update rule, outcome window and stopping horizon. If the required information is missing, the immediate task is to improve the evaluation design or logging, not declare a winner.

A supported offline estimate can help decide what deserves an online experiment. It does not establish the effect of a new interface, a different traffic population or feedback that changes future behavior. Use the A/B result guide when a controlled online comparison is available, keeping its estimand separate from what the historical log can answer.

Explore Infinite Upside

For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.

Find your edition · Chapter companion

How do I interpret an A/B conversion-test result?

How do I interpret an A/B conversion-test result?

ABOUT THE CONTRIBUTOR

Luna Lim

DIRECTOR OF FINANCIAL RESEARCH & EDITORIAL STRATEGY

SHETH CAPITAL, INC.

Luna Lim writes about business, investing, and the judgment behind financial decisions. She joined PCH Exotics Inc. as Director of Operations in 2022, working across La Jolla and Miami. Today, she reports directly to Vijay Sheth at Sheth Capital, Inc., bringing an operator’s perspective to the ideas she covers.

Based in Pacific Beach, California, Luna is curious about the people behind the numbers: what they’re building, how they weigh uncertainty, and what makes a risk worth taking. Her articles for Infinite Upside follow those questions through the details, with clear explanations and a feel for how decisions play out in everyday business.

More from Luna Lim

The Infinite Upside store