KatInterview

Experiment Plan for Rolling Out a Comment-Spam Filter

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsexperiment-designinterferencecluster-randomization

Last updated

Design and analyze a cluster-randomized, stepped-wedge experiment for a bot-comment suppression system, including power, adaptation risks, a quasi-experimental fallback and stop/go rules.

A social platform has built a system that detects suspected bot accounts and then either hides their comments or rate-limits them. You are asked to measure whether it actually helps, and to produce an experiment design and analysis plan that ends in explicit stop/go criteria.

Cover the following:

  1. Randomization and interference. Compare randomizing individual accounts with randomizing clusters of users from the interaction graph, in terms of spillover. Propose a stepped-wedge ramp.
  2. Metrics. Choose primary success metrics (think: human-visible comments per human daily active user, retention of human creators, report rates) and guardrails (new-user activation, moderation backlog, latency).
  3. Eligibility and variance reduction. Decide how to treat accounts that were already flagged and regions with unusually heavy bot activity. Describe the pre-exposure window and how CUPED fits in.
  4. Power. Baseline human-visible comments per human DAU is 5.5. You expect total comments to fall about 2% (bots removed) while human-visible comments rise about 1%. Outline the sample-size and duration calculation for a 14-day test, accounting for correlation between days and between users in a cluster.
  5. Novelty and adaptation. Explain how you would handle novelty decay, bots migrating to untreated areas, and adversaries learning to evade the filter.
  6. Fallback. If a randomized test is not possible, describe a difference-in-differences or synthetic-control approach, including high-frequency pre-trend checks.
  7. Diagnostics. If false positives start rising, what holdouts and stratified cuts would you use to find out why?

Finish with a concise analysis plan and the stop/go rules you would commit to before looking at any data.

Hints

Hint 1

Start by pinning down what is randomized: the viewer, the creator or surface, or the bot account. Each isolates a different effect, and bots can move from treated areas to untreated ones, so think about which unit keeps that movement inside one arm.

Hint 2

For power, work at the user level (average each user's 14 days into one number) so you do not pretend that correlated days are independent. Then apply, in order: the base two-sample formula, the CUPED variance factor 1 - rho^2, and a cluster design effect 1 + (m - 1) * ICC.

Hint 3

Total comments is expected to fall and human-visible comments to rise, so they are different metrics with different roles. Decide which is the decision metric and which is a mechanism check, and write numeric guardrail margins and a ship rule before the experiment starts.