Cluster-randomized experiment design for a social feature with network effects
Statistics & ExperimentsModel answerLast updated
Design a cluster-based A/B test for a friend-invitation feature when user-to-user influence breaks SUTVA, covering partitioning, estimation, and spillover validation.
Scenario
You work as a data scientist at a large social platform. The team wants to evaluate a new notification that prompts users to bring friends into their communities (groups). The catch: when one member of a group gets the notification, their increased activity may rub off on friends who were never assigned to treatment. Because of this interference, randomizing at the individual level would contaminate the control group and bias the measured effect downward (or in unpredictable directions).
Your job is to design the end-to-end experiment.
Deliverables
- Randomization plan. How do you construct randomization clusters so that cross-arm interference is minimized without destroying statistical power? Be precise about what constitutes a cluster and why.
- Estimation. Give an estimator for the average treatment effect on group engagement, and explain how you compute valid standard errors given that outcomes within a cluster are correlated.
- Post-hoc checks. Describe concretely how you would demonstrate, after the fact, that spillovers were actually reduced by your design.
Setting and constraints
- 10 million monthly active users spread over 500,000 groups.
- You have historical engagement logs and the full friendship graph.
- Discuss the fundamental tension: bigger clusters reduce contamination but inflate variance.
Write your answer as a design document a reviewer could critique: state assumptions, justify choices with numbers, and flag weaknesses. There is no single correct answer; you are judged on rigor and trade-off reasoning.
Hints
Hint 1
Connected components of a 10M-node social graph collapse into one giant blob — you need balanced graph partitioning (METIS, Leiden with size caps), not components.
Hint 2
Work at the group level: nodes are the 500k groups, edge weights reflect shared members and interaction frequency; the fraction of edge weight cut by the partition is your proxy for residual bias.
Hint 3
Cluster-robust standard errors at the randomization unit, plus a design-effect calculation DE = 1 + ((1+CV²)m̄ − 1)ρ, tell you how much power clustering costs.
Hint 4
A two-level randomization (cluster-randomized arm vs. individually randomized arm run simultaneously) gives a direct statistical test for interference.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Solution Outline
1. Why individual randomization fails, and what a cluster must accomplish
SUTVA requires that one unit's outcome is unaffected by other units' assignments. On a social graph this is violated: a treated user's invitations and posts reach untreated friends, so "control" users aren't really controls. If spillover is positive, the naive individual-level experiment understates the true effect because the control arm is partially treated.
The purpose of clustering is to make the cluster the effective experimental unit: everyone a user meaningfully interacts with sits in the same arm. The cost is variance — we go from 10M independent draws to however many clusters we create. Everything below is a negotiation between those two forces.
2. Constructing clusters
Wrong first instinct: take connected components of the friendship graph. At 10M users, the giant component typically holds >90% of users; you get one enormous cluster and essentially one coin flip. Also wrong: totally random grouping, which cuts ~all edges and leaves maximal spillover.
Right approach — balanced partitioning of a group-level graph:
- Build a graph whose nodes are the 500k groups, since the outcome and the intervention both operate at the group level. Edge weight between two groups = number of shared members plus friendships between their members, weighted by recent interaction intensity (dormant ties rarely transmit behavioral spillover).
- Run a size-constrained partitioning algorithm (METIS, or Leiden/Louvain with capacity caps, or constrained label propagation) to produce roughly 20k–50k clusters, each containing ~10–25 groups (~200–500 users). Users in multiple groups get assigned to the cluster containing most of their interaction volume.
- Within each stratum defined by cluster size and baseline engagement, randomize clusters 50/50. If covariate imbalance persists, rerandomize or pair-match clusters.
How to know the partition is good: report the interaction-weighted edge-cut fraction — the share of tie strength that crosses cluster boundaries. This is your direct proxy for residual interference. A decent partition keeps 60–80% of interaction weight internal; naive grouping might keep only ~30%. Since bias from graph-cluster randomization is bounded by properties of the cut (edge-cut fraction times degree distribution), this number is your quantified bias budget.
Choosing cluster size: sweep the partition resolution, and for each candidate size compute (a) edge-cut fraction and (b) the projected minimum detectable effect using historical engagement data and an ICC estimated from past activity. Plot MDE vs. cut fraction and take the knee of the curve — the point where making clusters bigger stops buying much bias reduction but keeps inflating variance.
The trade-off, explicitly: larger clusters → fewer cut edges → less contamination, but fewer independent units and larger design effect. Smaller clusters → the reverse. The design effect is:
DE = 1 + ((1 + CV²)·m̄ − 1)·ρ
where m̄ is mean cluster size, CV the coefficient of variation of cluster sizes (heavy tails are punishing — cap cluster sizes), and ρ the intracluster correlation of the outcome, estimated from historical data.
3. Estimation and inference
The estimand is the difference in mean group engagement between "everyone treated" and "no one treated" — the global ATE. Cluster randomization approximates it because within-cluster saturation is near total.
Run a regression at the group (or user) level:
Y_gc = α + τ·T_c + β·X_pre,gc + γ_s + ε_gc
- T_c: cluster-level treatment indicator.
- X_pre: pre-period engagement; a CUPED-style covariate typically cuts variance 30–50%.
- γ_s: stratum fixed effects.
- Alternatively, use a ratio-of-cluster-totals estimator with delta-method variance — equivalent in spirit, robust to unequal cluster sizes.
Standard errors must be clustered at the randomization unit (the cluster), using Liang–Zeger / CR2 sandwich variance:
V̂ = (X'X)⁻¹ (Σ_c X_c' û_c û_c' X_c) (X'X)⁻¹
With 20k–50k clusters, cluster-robust asymptotics are comfortable. If you ever drop below ~50 clusters, switch to CR2 with Satterthwaite degrees of freedom or exact randomization inference. Reporting naive i.i.d. errors understates them by √DE, a common fatal mistake.
4. Validating that spillover was handled
(a) Two-level randomization (strongest check). Split all clusters into two sub-experiments: in Arm A, assign treatment at the cluster level; in Arm B, assign at the individual/group level. Under no interference both arms estimate the same ATE; a significant difference (Hausman-style test combining both variances) is direct evidence of network effects. With positive spillover, Arm B should come out smaller, because its controls are contaminated. Expect to power this as a piggyback check on the main experiment, since it's expensive on its own.
(b) Exposure-response among controls. For every control unit, compute the interaction-weighted fraction of its ties that ended up treated (this is nonzero only through cut edges). Regress control outcomes on this exposure, controlling for degree, since high-exposure units differ in network position. A flat slope says residual leakage is small.
(c) Connectivity heterogeneity. Stratify clusters by internal density or cut fraction. If spillover exists and was largely contained, the estimated effect should be bigger in tightly closed clusters (near-100% saturation) than in leaky ones. A clean monotone trend localized in leaky clusters warns that your design still leaks.
(d) Hygiene checks. Sample-ratio mismatch tests at cluster and user level; A/A tests on pre-period outcomes; placebo outcomes (metrics the feature shouldn't touch); effect stability over time to rule out novelty effects.
Follow-ups worth preparing
- Spillovers beyond the group neighborhood (e.g., feed-level effects): partition the full friendship graph instead, or use an explicit exposure mapping ("treated iff ≥k% of friends treated") with Horvitz–Thompson estimators over exposure probabilities (Aronow–Samii). For truly global effects, fall back to geo/market randomization or switchback designs — all sharply reduce power.
- Separating direct from spillover effects: run a saturation design — randomize clusters to treatment saturation tiers (0/25/50/75%) and randomize individuals within clusters to hit each tier. Then: direct effect = treated vs. untreated within a tier; spillover = untreated in high-tier clusters vs. untreated in the 0% tier; total ≈ direct + spillover scaled appropriately.
Common mistakes
- Using connected components or modularity clustering without size constraints → one mega-cluster, no power.
- Clustering standard errors at the group instead of the randomization unit → invalid inference.
- Ignoring the size distribution of clusters (high CV blows up the design effect).
- Claiming spillover was mitigated without any empirical test — the two-level or exposure-response checks are what turn a design into a defensible design.