Safely Retiring an Incumbent Ad-Ranking Model
Machine LearningModel answerLast updated
Plan an end-to-end migration from a legacy ad-ranking model to a new one, covering offline validation, off-policy estimates, staged online rollout, conflicting-metric decisions and production risks.
Scenario
Your company runs a large advertising platform. The current ad-ranking model, M0, has been in production for years. A partner team has built a successor, M1, and leadership wants to decommission M0 once M1 has proven itself. You own the decision and the rollout plan.
Task
Write an end-to-end plan for replacing M0 with M1 that covers the five areas below. Be specific: name metrics, thresholds, estimators and decision rules rather than saying "we would monitor it".
-
Offline validation
- Which quality metrics will you use (for example calibrated CTR, AUC or PR-AUC, calibration error, expected revenue lift)?
- How will you test for label or feature leakage?
- How will you diagnose covariate shift and label shift?
- How will you backtest over the most recent 28 days?
-
Counterfactual (off-policy) evaluation
- How would you estimate M1's expected CTR and revenue using only logs generated by M0?
- Describe IPS and doubly robust estimators, propensity clipping, the assumptions required, and the bias/variance trade-off.
-
Online experiment
- Randomization unit, geo stratification, and guardrails (revenue, spend pacing, latency, integrity).
- Checks for sample ratio mismatch and interference.
- A ramp schedule of 1% → 10% → 25% → 50% → 100%, with explicit stop and rollback rules.
-
Acceptance criteria when metrics disagree
- Example: CTR is down 1.5%, but revenue per mille is up 3% and advertiser ROAS is up 2%.
- Define the objective you optimize, how you weight its components, and the minimum guardrail thresholds that must hold.
-
Productionization risks
- Serving latency and SLA, feature freshness, replay and backfill, and the monitoring you would run after launch.
State your assumptions and clarifying questions up front.
Hints
Hint 1
Start by clarifying scope: does M1 replace only the click-probability model or the whole score used in the auction, and which downstream systems (pacing, bid shading, reserve prices) consume M0's scores?
Hint 2
For off-policy evaluation, ask whether M0 logged propensities at all. A deterministic ranker has no overlap with M1, so you need a small randomized exploration slice. Pick the clipping threshold using effective sample size and report how the estimate moves across a sweep of thresholds.
Hint 3
Treat CTR as a diagnostic and define a single overall evaluation criterion (revenue, advertiser value, user experience) with hard guardrail floors. Then decide in advance which combinations of results ship, hold or roll back, and remember that advertisers sharing budgets across arms create interference.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Framing
This is a launch-discipline question. "Ship M1" is a hypothesis that must survive offline, counterfactual and online evidence, and the plan must account for ad-specific failure modes: auctions, budget sharing, calibration and feedback loops. I would first clarify scope: whether M1 replaces only pCTR or also pCVR, whether it uses new features, and which systems consume M0 scores (pacing, bid shading, reserve prices). Anything downstream that assumes M0's score distribution must be re-validated.
1. Offline validation
Metrics, reported overall and per slice (country, placement, device, advertiser vertical, new vs. established ads):
- Normalized entropy (log-loss divided by the entropy of the base rate). It rewards both ranking and calibration. At scale, gains of 0.1-0.2% are meaningful.
- AUC and PR-AUC. With CTR near 1%, PR-AUC is more informative.
- Calibration: ratio of summed predictions to summed clicks (target 0.98-1.02 globally, 0.95-1.05 per large slice) and expected calibration error over about 20 quantile bins. Auction value is bid × predicted probability, so a 5% overprediction is a 5% misallocation or overcharge.
- Auction replay: re-run logged auctions with M1 scores, apply the real pricing rule and estimate winners, prices and expected clicks.
Leakage tests
- Time-based splits only: train before day d, evaluate on d.
- Point-in-time feature joins: no feature timestamp later than the impression.
- Shuffled-label check: AUC should be about 0.5.
- Single-feature ablations: a feature that alone gives a huge gain is suspect (for example a counter that includes the current click).
- Compare offline metrics with shadow-serving metrics. A large gap points to leakage or training-serving skew.
Shift diagnostics
- PSI or KS per feature between training and evaluation windows (flag PSI > 0.2).
- Track base CTR over time for label shift.
- Train a domain classifier on train vs. recent serving features. AUC well above 0.5 means covariate shift.
28-day backtest: evaluate on each of the last 28 days. Require M1 to win on normalized entropy on at least about 25 of 28 days and no major slice to regress by more than about 0.5%. Report day-to-day variance, not only the mean.
2. Off-policy evaluation
Setup: context x is the request, action a is the ranked ad or slate, reward r is click or revenue, logging policy is M0 plus the auction, and the weight is w = π1(a|x) / π0(a|x).
- IPS: mean of w·r. Unbiased with correct propensities, high variance.
- Clipped IPS: cap w at c. Lower variance, downward bias because mass on actions M1 favors but M0 rarely showed is lost.
- Self-normalized IPS: divide by Σw. A stable default.
- Doubly robust: q̂(x, π1) + w·(r − q̂(x, a)), averaged. Consistent if either the propensities or the reward model q̂ is right, and lower variance than IPS. Do not use M1 as q̂, to avoid self-grading.
Assumptions: logged and correct propensities (a deterministic M0 needs an exploration bucket of roughly 1-2% of traffic with randomization over top-k and logged probabilities), overlap (π0 > 0 wherever π1 > 0), no unmeasured confounding given logged context, and no interference or non-stationarity.
Controls: choose c using effective sample size (Σw)² / Σw², requiring roughly 10% of n or more; bootstrap confidence intervals; sweep c and look for a plateau.
Ads caveats: slates cause position bias (use per-position propensities or slate estimators). Re-ranking changes prices and budget depletion, so OPE estimates clicks reasonably but revenue poorly. Use OPE to kill bad candidates, not as proof to launch.
3. Online experiment
Design
- Randomize by hashed user ID with a fresh salt, stratified by geo and platform; use CUPED with pre-period metrics.
- Advertiser budgets are shared across arms, so a faster-spending arm starves the other. Mitigate with budget-split testing (each arm gets a proportional slice of every campaign budget) or an advertiser-clustered design for spend metrics.
- Power for a 0.5% relative change in revenue per mille at 80% power; at large scale this is usually reachable with 10% exposure in about a week.
Guardrails (one-sided tests on confidence bounds)
| Area | Threshold |
|---|---|
| Revenue / RPM | lower CI bound not worse than -0.5% |
| Pacing | under-delivery up by at most 1 pp, no spend spikes |
| Latency | p99 within SLA (for example at most +5 ms) |
| Integrity | policy-violating impression rate not up |
| User experience | hides and reports up by at most 1%, time spent not down more than 0.2% |
| Advertiser | conversions and ROAS not down in any top vertical |
Validity: daily SRM chi-square (halt if p < 0.001), an A/A run on the bucketing, a budget-split vs. user-split comparison to estimate interference, and effect-over-time plots for novelty.
Ramp
| Stage | Duration | Rollback trigger |
|---|---|---|
| Shadow | 3-7 days | feature skew > 1%, p99 over SLA |
| 1% | 1-2 days | errors up, calibration outside [0.95, 1.05], SRM |
| 10% | 7 days | any guardrail breached at 95% confidence |
| 25% | 7 days | revenue below -0.5% or a vertical's ROAS below -3% |
| 50% | 1-2 weeks | same as 25%, plus long-term trend and interference |
| 100% | n/a | n/a |
Keep a 1-2% holdback on M0 for 4-8 weeks to measure advertiser adaptation. Rollback is a config flip, and M0 stays warm until the holdback ends.
4. Acceptance when metrics disagree
CTR is a diagnostic, not the goal. Define an overall evaluation criterion as a weighted sum of normalized, relative changes, for example:
OEC = 0.4·ΔRPM + 0.3·ΔAdvertiser value (ROAS or conversions) + 0.2·ΔUser experience + 0.1·ΔLong-term retention proxy
with weights agreed with product, finance and advertiser teams before the test. Ship only if the OEC lower confidence bound is above zero and every guardrail floor holds. For the example (CTR -1.5%, RPM +3%, ROAS +2%): this is acceptable if the CTR drop reflects fewer low-quality clicks, which I would verify via conversion rate, post-click quality, hides and reports, and session impact. If user-experience metrics are flat and advertiser value is up, ship. If the RPM gain comes with rising hides or falling retention, it is short-term extraction, so hold. Check that gains are not concentrated in one vertical or a few large advertisers.
5. Productionization risks
- Latency: budget the ranking stage (for example p99 under a few milliseconds more than M0), load-test at peak, and use distillation, quantization or caching if needed.
- Feature freshness and skew: use one feature definition for training and serving, log served features, and compare them with recomputed offline values.
- Replay and backfill: version models, features and logs so any day can be reproduced. Backfills must use point-in-time correctness.
- Calibration drift: run online recalibration (for example isotonic or Platt layers refreshed frequently), since a miscalibrated score breaks pricing and pacing.
- Post-launch monitoring: dashboards and alerts for calibration ratio by slice, score distribution drift, feature null rates, latency, pacing, revenue and advertiser outcomes, with on-call runbooks and a tested rollback.
Common mistakes
- Treating AUC or CTR as the launch metric.
- Using OPE without logged propensities or an overlap check.
- Ignoring shared-budget interference between arms.
- Decommissioning M0 immediately instead of keeping it warm and holding back traffic.
- No pre-registered decision rules, so conflicting results become a debate.