Power, Guardrails and Ramp Plan for a New Feed Ranker Test
Statistics & ExperimentsModel answerLast updated
Plan an A/B test for a new feed ranking model: size it for a small CTR lift, add guardrails and sequential stopping, use CUPED, control interference, and define the ramp decision.
Scenario
Your team has trained a new ranking model for a content feed and wants to replace the production ranker. You need to plan the online experiment.
Facts:
- Baseline click-through rate (CTR) is 2.0%.
- You expect a 5% relative improvement in CTR.
- Target: 90% power at a two-sided α = 0.05.
- About 1,000,000 eligible users arrive per day.
- Assignment is by user, 50/50, and a user stays in the same arm for the whole test.
Tasks
A. Sample size and duration. Use a two-proportion power calculation to get the required users per arm and the minimum run time. Give the formula, show the arithmetic, and list your assumptions (variance model, independence, no interference). Then inflate the number for 5% invalid or bot traffic and a 1% sample ratio mismatch (SRM) allowance.
B. Guardrails and sequential monitoring. Choose guardrail metrics (bounce rate, crash rate, p95 latency, revenue per user) and pre-registered decision thresholds. Describe how you would allow early stopping with α-spending (Pocock or O'Brien–Fleming) without inflating the Type I error.
C. Novelty and weekday effects. Propose CUPED using pre-experiment user CTR. Specify the exact covariate and explain how you would check that the variance reduction is real and does not introduce bias.
D. Interference. Explain how you would keep arms from contaminating each other: user-level bucketing, preventing content spillover, and a geo-based design or holdout if network effects are plausible.
E. After the test. Describe how you would check the power you actually achieved, look for heterogeneous effects across cohorts, and decide whether to ramp to 100%.
A strong answer states assumptions explicitly, gets the numbers right, and explains what can invalidate them in practice.
Hints
Hint 1
Treat the metric as a per-user binary outcome with p1 = 0.020 and p2 = 0.021, so the absolute difference is 0.001. Use the pooled-variance term for the null and the unpooled term for the alternative in the standard two-proportion formula.
Hint 2
Apply the inflation factors in sequence: first make sure the smaller arm still reaches n under a slight imbalance, then divide by the fraction of valid traffic, then add a small factor for interim looks. Remember that SRM is also a data-quality alarm, not only padding.
Hint 3
For CUPED, use a covariate measured strictly before assignment (for example each user's CTR over the prior 28 days under the old ranker), estimate theta on pooled data, and validate with A/A replays. For the ramp decision, combine the primary metric, guardrails, SRM status, and an exposure-day view of the effect.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Overview
Three things matter here: getting the power math right, knowing what breaks it in practice (SRM, bots, peeking, novelty, interference), and turning results into a launch decision.
A. Sample size and duration
Assumptions
- Randomization unit is the user. The primary metric is binary per user ("clicked at least once in the analysis window"), so variance is Bernoulli, p(1−p), in each arm.
- Users are independent and there is no interference (SUTVA).
- Two-sided test, α = 0.05, power = 0.90.
- If CTR is defined as clicks/impressions, it is a ratio of user-level sums. Use the delta method or a user-level bootstrap for the variance, because impressions from one user are correlated and naive binomial variance would be too small.
Effect. p1 = 0.020, p2 = 0.021, Δ = 0.001.
Formula
n per arm = [ z(1−α/2) · √(2·p̄·q̄) + z(1−β) · √(p1·q1 + p2·q2) ]² / Δ²
Numbers
- z(0.975) = 1.960, z(0.90) = 1.2816, so the sum of z-values is 3.2416.
- p̄ = 0.0205, so 2p̄q̄ ≈ 0.04016 and its root is ≈ 0.2004.
- p1q1 + p2q2 = 0.0196 + 0.020559 ≈ 0.04016, root ≈ 0.2004.
- n ≈ (3.2416 × 0.2004)² / 10⁻⁶ ≈ 422,000 per arm, about 844,000 valid users in total.
Inflation
- SRM allowance. Size so the smaller arm still reaches 422,000 if the split drifts to 49.5/50.5: 422,000 / 0.495 ≈ 852,500 valid users.
- Invalid traffic. With 5% filtered out, divide by 0.95: ≈ 897,000 enrolled users.
- Interim looks. An O'Brien–Fleming design with about 5 looks costs roughly 2–3% extra, giving about 920,000 users. Pocock costs about 20% extra.
SRM is more than a buffer. Run a chi-square test on arm counts and alert at p < 0.001. A real SRM usually means broken assignment or logging, and results should not be trusted until it is explained.
Duration. At 1M eligible users a day, the user count is reached in about a day, so volume is not the constraint. Run a minimum of 14 days (two full weekly cycles) to cover the day-of-week mix and let novelty fade. Over 14 days, unique users grow sublinearly because people return, and per-user click probability rises with exposure. Recompute variance on the actual analysis window. Power will probably exceed 90%, and you can spend the surplus by using a smaller allocation (say 10% per arm) to limit risk.
B. Guardrails and sequential monitoring
Each guardrail gets a one-sided non-inferiority test with a margin fixed before launch.
| Guardrail | Method | Fail if |
|---|---|---|
| Crash rate | Delta method, user-clustered | Upper 95% bound above +2% relative, or any new crash signature |
| p95 latency | Bootstrap over users on the quantile difference | Worse by more than 10 ms or 5% |
| Bounce rate | Two-proportion test | Worse by more than 1% relative |
| Revenue per user | Delta method, winsorized at p99.9 | Lower bound below −1% relative |
Do not Bonferroni-shrink guardrail α. That would make harm harder to detect. Instead, check that each margin is detectable at the planned sample size.
Ship rule: CTR is significantly positive at the final boundary, no guardrail fails, and SRM passes.
α-spending (Lan–DeMets). With an O'Brien–Fleming-type function, α(t) = 2 − 2Φ(z(1−α/2)/√t), almost no α is spent early.
- Two looks at days 7 and 14 (t = 0.5, 1.0): boundaries about 2.77 and 1.98.
- Five equally spaced looks: about 4.56, 3.23, 2.63, 2.28, 2.04.
- Pocock uses a constant boundary of about 2.41. It stops early more easily but needs more sample and a stricter final threshold.
Policy. Allow efficacy stops only from day 7 onward, using OBF. Monitor harm daily with a looser boundary, and back crashes and latency with hard operational kill switches rather than waiting on statistics.
C. Novelty, weekday effects and CUPED
- Run whole weeks only. Show the effect by weekday as a diagnostic, not as a decision metric.
- For novelty, plot the effect by days since first exposure, not calendar date. A decaying curve signals novelty. If so, base the decision on week two or exposure-day ≥ 7 and keep a long-term holdout.
CUPED covariate. Each user's CTR over the 28 days before the experiment, computed under the old ranker with the identical metric definition. For users with no history, set X to the global mean and add a "has history" indicator (or run CUPED within those two strata).
Adjustment. Y_adj = Y − θ(X − X̄), with θ = Cov(Y, X) / Var(X), estimated on pooled data from both arms. For ratio metrics, adjust the linearized metric. Variance shrinks by (1 − ρ²); with ρ = 0.5 that is about 25% fewer users.
Validation
- The covariate is pre-assignment, so treatment cannot affect it. This is the unbiasedness argument.
- Check that X is balanced across arms (an A/A test on the pre-period).
- Replay history with many random splits. False positives should be near 5%, CI coverage near 95%, and realized variance reduction near 1 − ρ².
- Adjusted and unadjusted point estimates should agree within noise. Only the interval should narrow.
D. Interference and contamination
- Bucketing. Hash(user_id, experiment salt) mod 100, using the logged-in ID so assignment holds across devices. Cookie churn for logged-out users leaks users across arms. Log exposure at ranking time, analyze triggered users, and keep the intent-to-treat result as a check.
- Training feedback loop. If either model retrains on logs containing the other arm's traffic, the arms converge. Partition training data by arm or freeze both models during the test.
- Caches and feature stores. Key them by arm so candidate lists and popularity features are not shared.
- Content ecosystem. Treatment can shift creator exposure and popularity signals, which changes what control users see. If social or creator-side spillover is suspected, use cluster randomization (by geo or social cluster) or a switchback design, accept the lower power, and keep a small global holdout. Compare the user-level and cluster-level estimates; a large gap indicates interference.
E. After the test
- Achieved power. Recompute the minimum detectable effect from the observed variance (with CUPED) and the realized sample. If the CI excludes the practical-significance threshold, the result is informative even if not significant.
- Heterogeneity. Pre-specify a short list of cohorts (new vs. tenured users, platform, region, activity level). Estimate effects with interaction terms, correct for multiple comparisons or use false discovery control, and treat discoveries as hypotheses unless confirmed. A strong negative effect in a key cohort can block a full launch.
- Ramp. Proceed only if the primary metric and guardrails pass, SRM is clean, and the effect is stable by exposure-day. Ramp in stages (for example 10%, 25%, 50%, 100%) with automated guardrail checks at each step, and keep a 1–5% holdout for long-term effects.
Common mistakes
- Ignoring that CTR as clicks/impressions is a ratio metric with clustered observations.
- Treating SRM only as a padding factor and not as a validity check.
- Peeking with fixed-horizon p-values.
- Reading a first-week lift as steady state.
- Letting both models learn from shared logs.