Evaluating a New Ad Ranking Algorithm End to End
Statistics & ExperimentsModel answerLast updated
Design metrics, randomization and rollout for a new ad ranker, plus fallbacks when a clean 50/50 test is impossible.
A product data science partner sits with the ads ranking team, which has built a new model for choosing which ad to show a user. The team believes it will do better. You are asked to be the voice of measurement.
Part A — You can run an online experiment. Lay out a full plan: state the objective and whose interests matter (people seeing ads, advertisers, and the platform's own revenue); pick one primary metric and defend it; list diagnostic metrics that explain movement and guardrail metrics that cap downside; choose the randomization unit and explain where interference can wreck the comparison; then cover practical execution — staged ramp, run length, power/MDE, sample-ratio checks, and how you would read segment-level differences.
Part B — A clean 50/50 split is off the table. Reasons might be risk, serving capacity, feedback loops in model training, or advertiser delivery constraints. Give at least two legitimate alternatives (unequal allocation, phased ramp, cluster/geo assignment, switchback, long-term holdout). For each: when it fits, what can bias it, and how the analysis changes (variance, sequential monitoring, variance reduction).
Part C — No controlled test at all. Describe how you would still make a recommendation using offline or observational data, how you would fight confounding and selection bias, and how you would serve recommendations to brand-new users while still exploring.
Be explicit about assumptions and about how each plan could fail.
Hints
Hint 1
Start by pinning down what 'better' means: relevance for users, outcomes for advertisers, and durable revenue — not just short-term revenue, which can be moved by price rather than match quality.
Hint 2
Ads run in a shared auction with shared advertiser budgets. Ask whether one user's treatment changes another user's control experience, and design around that.
Hint 3
For every non-standard design, name the trade: fewer effective units, carryover between periods, or slower detection — then say how you adjust the analysis.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
What is really being tested
Three things: whether you can pick a metric that rewards genuine match quality rather than accounting tricks; whether you notice that ads are a shared auction where one user's treatment leaks into another user's control; and whether you can degrade gracefully when the textbook design is unavailable.
Part A — Running the experiment
Objective. Increase durable total value: better matches produce advertiser outcomes, which sustain spend, without harming the people seeing ads. State the key assumption up front: ad load (ads per session) is held fixed, so the model only changes which ads appear. If ad load can float, revenue can be inflated by simply showing more ads, and the test proves nothing.
Primary metric. Advertiser value delivered per user — attributed conversions weighted by advertiser-declared value, inside the attribution window. Why not revenue per user? With budget-capped campaigns, revenue is largely a reshuffle of a fixed pot, and it can rise from higher clearing prices rather than better matching. Conversions respond first, and conversions are what fund next quarter's spend. Revenue is a co-decision metric: ship only if it is flat or up.
Diagnostics (explain the "why"): CTR and post-click CVR, to separate a relevance gain from a conversion-quality gain; eCPM and clearing price; impressions per user and fill rate; calibration of predicted versus observed pCTR/pCVR; budget pacing and time-to-exhaustion; impression concentration across advertisers.
Guardrails: user side — DAU and sessions, time spent, ad hides/reports/"not interested", organic engagement; integrity — share of impressions to low-quality ads, clickbait rate, serving latency; advertiser side — CPA/ROAS split by advertiser size, small-advertiser delivery share, under-delivery rate; business — total revenue under a non-inferiority margin.
Randomization unit. User by default: consistent experience per person, frequency capping stays coherent, and there are enough units for power. Interference is the real risk. (1) Budget cannibalization: both arms draw on the same advertiser budgets; if treatment converts better, auto-bidders chase treatment users and starve control, inflating the measured lift beyond what 100% rollout would deliver. Fix with a budget-split design — carve each advertiser's budget proportionally to arm size so two near-isolated sub-markets exist. (2) Feedback loops: the new model learns from data mostly generated by the old policy, and bidders adapt; short tests miss the equilibrium. (3) Novelty: a fresh ad mix earns clicks that decay. (4) Minor cross-user spillover for social ads.
Execution. A/A test first to validate pipelines and false-positive rate. Ramp 1% → 5% → 20% → 50%, holding each step a few days to watch guardrails, latency and crashes. Run at least two full weeks to cover weekly seasonality plus the 7-day attribution lag, and extend if effect-by-day-since-exposure shows decay. Power: roughly 16σ²/δ² per arm for α = 0.05, 80% power. If conversion value per user has CV ≈ 5 and you want a 0.5% relative lift, that is about 16M users per arm — feasible at this scale, but heavy tails demand winsorization and CUPED on pre-period value, which often cuts variance 30–50%. Check sample ratio with a chi-square (flag at p < 0.001); investigate bot filtering, logging differences and arm-specific crashes before analyzing anything. For heterogeneity, pre-register segments (new vs. tenured, country, platform, advertiser size, campaign objective), correct with Benjamini–Hochberg, and treat unregistered findings as hypotheses. An overall win that hurts small advertisers or new users is a ship-with-mitigation conversation, not an automatic ship.
Part B — When 50/50 is not possible
Unequal allocation (e.g., 5/95, or a small long-term holdout). Fits high-risk changes or limited serving capacity. Variance goes as 1/n_T + 1/n_C: 4/N at 50/50 versus ~11.1/N at 10/90, so you need about 2.8× the traffic for the same MDE. A tiny arm barely perturbs the marketplace, so you measure a partial-equilibrium effect; budget interference becomes asymmetric. Analyze with Welch's t-test plus CUPED and report the honest MDE.
Phased ramp with sequential monitoring. Fits early harm detection and gradual exposure. Peeking inflates false positives, and pooling across stages confounds treatment with calendar time. Use always-valid inference (mSPRT) or alpha spending (O'Brien–Fleming), and compare only concurrent arms within each stage.
Switchback over time-by-geo cells. Fits strong pacing or marketplace interference, where a whole region should run one algorithm at a time. Carryover is the enemy: budgets and bidder state persist across windows, so add washout and drop the first slice of each period; intervals must be long enough to attribute conversions. The unit is the interval — use cluster-robust errors or randomization inference, and expect much less power.
Geo/cluster randomization. Fits advertiser- or market-level effects, and captures equilibrium. Few clusters mean geo shocks act as confounders and advertisers leak budget across regions. Use matched pairs, difference-in-differences or synthetic control, with cluster-level variance and pre-period covariates.
Part C — No experiment allowed
Use offline replay and observational data: log the auction, score counterfactual candidate slates with the new model, and compare against what was served. Replay is biased where the new model would have shown ads the old policy never showed (no outcomes exist) and where outcomes depend on position and context — say so rather than hiding it. Fight selection bias with propensity weighting on exposure, stratification, and pre-period matching on user and advertiser features; validate on a held-out time period rather than a random split. If a small holdout is at all negotiable, that is the highest-value ask.
For cold-start users, lean on content and context features plus hierarchical priors from similar users, and reserve an explicit exploration slice (say 5–10%) with Thompson sampling or epsilon-greedy, evaluated by long-run value per user rather than immediate CTR.
Failure modes to name: revenue gains that are just price effects, lifts that evaporate when budget splitting is enforced, novelty decay mistaken for a durable win, and segment fishing presented as insight.