Validating a New Ad Ranking Model Through an Online Test
Statistics & ExperimentsModel answerLast updated
Plan an online experiment for a new ad-ranking model, choose metrics, judge a CTR gain, investigate a surprising segment result, and decide whether a combined CTR and revenue gain justifies a global launch.
Scenario
An advertising platform has a new machine-learning model that ranks ads. The team that built it says it beats the model currently in production. You have been asked to decide whether that claim holds up and whether the model should ship.
Questions
Answer each part as you would in a live discussion, stating your assumptions.
- Experiment design. How would you set up an experiment to test the new ranking model? Cover any work before the live test, the unit of randomization, how you would size and time the test, and the checks that confirm the setup is sound. Consider that advertisers share budgets across both arms.
- Metrics. Which primary metric(s) and which guardrail metrics would you track, and why?
- Practical significance. The test reports a 5% relative increase in click-through rate (CTR) that is statistically significant. How do you decide whether that gain matters in practice?
- Surprising segment. In a breakdown, CTR for men aged 18-55 in India has doubled. What might explain this, and what would you do next?
- Launch decision. Suppose the overall result is +5% CTR and +5% revenue. Would you launch worldwide? Walk through how you would reach your decision.
Your answer should discuss randomization, sample size, heterogeneous effects, business trade-offs, and ethical or fairness checks.
Hints
Hint 1
Ad auctions rank roughly by bid times predicted CTR, and advertisers draw from shared budgets. Think about how that makes the two arms interfere with each other, and what you would randomize on besides users.
Hint 2
Separate proxy metrics from value metrics. Ask whether the extra clicks lead to conversions and advertiser return, and whether any user or advertiser guardrail got worse.
Hint 3
For an extreme result in one segment, rule out explanations in this order: logging or assignment bugs, invalid traffic, multiple-comparison noise. Only after that consider real heterogeneity or a fairness problem, and confirm with a fresh pre-registered test.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Framing
The goal is a launch decision, not a p-value. A strong answer treats CTR as a proxy, accounts for how an ad marketplace behaves, distrusts surprising segment results until validated, and ties the final call to long-term risk.
1. Experiment design
Before going live
- Offline evaluation. Compare the new model with production on held-out logs: AUC, log loss, and calibration (mean predicted CTR divided by observed CTR). Calibration is important because the auction ranks and prices by roughly bid x pCTR, so a miscalibrated model distorts prices even if its ordering is better.
- Shadow scoring. Score live traffic without serving results, to check latency, feature availability, and score distributions.
- A/A test. Run two identical arms to confirm bucketing and logging produce no spurious differences.
Randomization unit
- Default to users, assigned via a hash of the user ID. Randomizing by impression lets one person see both models and contaminates fatigue and learning effects.
- Marketplace interference. Both arms spend from the same advertiser budgets. If treatment burns budgets faster, control is starved and the measured gap is inflated or distorted. Mitigations: split each advertiser's budget between arms, run a complementary advertiser-level or geo/cluster test, and keep initial treatment allocation modest.
Sample size and duration
- Use a two-proportion power calculation. With baseline CTR of 2%, a 2% relative minimum detectable effect (absolute 0.0004), alpha 0.05 and 80% power, n per arm is about 16 * p(1-p) / delta^2, roughly 2 million impressions.
- Impressions cluster within users, so apply a design effect, or compute variance with the delta method or a user-level bootstrap.
- Reduce variance with CUPED, using each user's pre-period CTR.
- Run at least two full weeks to cover weekly seasonality and let novelty fade. Ramp gradually (1%, 5%, 20%, 50%). Pre-register metrics, stopping rules, and key segments.
Validity checks
- Sample ratio mismatch via a chi-square test on arm counts.
- Equal logging and equal invalid-traffic filtering in both arms.
- No peeking without a sequential-testing correction.
2. Metrics
| Role | Metric | Reason |
|---|---|---|
| Primary | Revenue per user (or per 1k impressions) and advertiser value (conversions or conversion value per dollar) | The model must help both the platform and advertisers; CTR alone can be gamed |
| Diagnostic | CTR, conversion rate, CPC, CPA | Explain why revenue moved |
| User guardrails | Sessions/DAU, time spent, ad hides and reports, organic engagement | Clickbait can raise CTR while hurting retention |
| Advertiser guardrails | ROI/CPA, budget utilization, spend retention | Higher prices without conversions cause churn |
| System guardrails | p99 latency, compute cost, calibration | A slow or miscalibrated model breaks the auction |
| Integrity and fairness | Invalid clicks, delivery skew across protected groups, policy-violating ad share | Legal and ethical exposure, especially for housing, jobs, credit |
3. Is +5% CTR practically significant?
- Use the confidence interval. +5% with interval [+4.5%, +5.5%] is solid; [+0.2%, +9.8%] might be nearly worthless. Compare the lower bound with a pre-agreed threshold that includes engineering and maintenance cost.
- Translate to absolute and dollar terms. For example 2.0% to 2.1% CTR; multiply extra clicks by CPC and global volume, then subtract added compute and latency costs.
- Check click quality. If conversion rate, dwell time, and bounce rate did not hold up, the lift is probably accidental or curiosity clicks.
- Check durability. Plot the lift by day; decay suggests a novelty effect.
- Check validity. Rule out SRM, multiple testing across metrics, and peeking.
Practically significant means the lower bound of the value metric exceeds the cost of launching and no guardrail is meaningfully harmed.
4. CTR doubles for men 18-55 in India
A 100% lift in one segment against a 5% global lift is a red flag before it is an opportunity. Candidate explanations, in the order to check:
- Bugs. Segment-level SRM, a logging change in one app version or locale, a missing feature in one arm.
- Invalid traffic. Bots and click farms cluster in some regions. Look for abnormal click-to-conversion ratios, very short dwell times, and clustered device or IP fingerprints.
- Statistical artifacts. Picking the most extreme cell from many is a multiple-comparisons problem; expect regression to the mean and apply FDR correction (Benjamini-Hochberg).
- Accidental clicks. A placement or format change on low-end devices can cause mis-taps.
- Genuine heterogeneity. The old model may have been poorly calibrated for a market underrepresented in training data, and the new one fixes that.
- Fairness. The model may be steering certain ad categories toward men and away from women, which is a legal and ethical issue regardless of CTR.
Next steps
- Rerun validity checks inside the segment.
- Inspect downstream metrics there: conversions, CPA, hides and reports.
- Decompose the global lift. If this segment drives most of the +5%, the overall result is fragile.
- Check other segments, including women in India, for negative effects.
- Audit delivery across gender and age for sensitive categories.
- Treat the finding as a hypothesis and confirm it in a fresh, pre-registered test, possibly with a targeted rollout.
5. +5% CTR and +5% revenue: ship globally?
Not automatically. My process:
- Confirm trustworthiness. Clean A/A and SRM results, intervals that clear the practical threshold, and no unexplained segment anomalies.
- Check where revenue came from. Revenue from higher prices or more ad load, without more conversions, is borrowed from advertisers and will erode.
- Review all guardrails. User retention, advertiser ROI and churn, latency, and fairness metrics.
- Consider interference. Marketplace effects may mean the real global effect differs from the test estimate; a budget-split or cluster test helps.
- Check consistency across regions and segments. A positive average can hide harm in some markets.
- Roll out in stages (for example 50% then 100%) with a long-running holdout (about 1-5%) to measure long-term effects, plus automatic rollback triggers on guardrails.
If all of this holds, launch. If the gain is concentrated in suspicious traffic, hurts advertisers, or creates fairness risk, fix first or launch only where it is clearly beneficial.
Common mistakes
- Treating CTR as the goal rather than a proxy.
- Randomizing by impression or ignoring shared budgets.
- Peeking and stopping early.
- Believing a single extreme segment without correcting for multiple comparisons.
- Skipping fairness checks on sensitive ad categories.
- Launching to everyone at once with no holdout or rollback plan.