A/B Test Plan for a Selfie Liveness Step in Signup
Statistics & ExperimentsModel answerLast updated
Plan an experiment for a new selfie-based liveness check in onboarding: pick metrics, choose a randomization unit that survives fraudster behavior, size the test, and handle uneven pass rates.
Scenario
A financial platform wants to add a selfie-based liveness check to its identity verification step during onboarding. The product team expects it to cut fraudulent sign-ups by about 40%, but worries that the extra step will push legitimate applicants to abandon the flow. You must design an online experiment to decide whether to ship it.
What to cover
- Metrics. Choose one primary metric and at least two guardrail metrics. Justify the denominators and say how you would handle the fact that fraud labels arrive late.
- Randomization. Pick the unit of assignment (user, IP address, device, or something else). Explain your reasoning, especially around interference between arms.
- Sample size. The baseline conversion rate is 20%, and the business needs to detect an absolute drop of 0.5 percentage points. List the factors that determine the required sample size and show the calculation.
- Bias and fairness. Liveness checks may pass at different rates across demographics and device types. Explain how you would account for this in design and analysis.
Things to keep in mind
- Fraudsters often create several accounts. Consider how that distorts results if you randomize by user.
- Verification is a gate that every new customer passes through. A bad treatment could block a whole cohort of legitimate applicants, so think about risk control during the rollout.
Hints
Hint 1
Ask who is in the denominator. If the treatment filters people out, a rate computed over approved accounts is distorted by selection, so think about measuring per applicant who reached the step.
Hint 2
Ask what happens to a fraudster rejected in treatment. If they can simply retry and land in the other arm, the arms are no longer independent. Consider assigning by a cluster of linked identifiers (device, phone, payment instrument) instead of by account.
Hint 3
For the sample size, use the two-proportion formula with p1 = 0.20 and p2 = 0.195, and then list what inflates it: clustering, multiple metrics, a separate calculation for the rare fraud outcome, and the label maturation window.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Framing
This is not a plain conversion test. Three things make it harder: the treatment changes who ends up in the measured population, adversaries violate independence between arms, and the main outcome (fraud) is rare and delayed. Treat it as a security-versus-growth trade-off and aim for a decision based on net value.
1. Metrics
Primary: confirmed fraudulent accounts per applicant.
- Use applicants (people who reached the verification step) as the denominator, not approved accounts. The treatment removes people, so a rate among survivors can improve or worsen purely through selection.
- Define "confirmed fraud" with a fixed window (say 60 days) covering chargebacks, account-takeover reports and AML flags. Commit to this before launch.
Co-primary or key guardrail: onboarding conversion (applicants who complete verification). Test it for non-inferiority with a pre-agreed margin, for example no worse than 0.5pp absolute.
Other guardrails:
- Downstream good-user quality: first-deposit rate and 30-day funded rate among approved users.
- Operational health: vendor latency and error rate, manual-review queue size, support tickets per applicant.
- Fairness: liveness failure rate by device tier, OS and country.
A single ship criterion helps: fraud loss avoided minus (lost good conversions × expected LTV).
2. Randomization unit
User-level assignment is flawed. A user ID does not exist before onboarding starts, and fraudsters make many accounts. A fraudster blocked in treatment retries with a new account that has a 50% chance of landing in control and getting through. Fraud is displaced into control, inflating control's fraud rate and overstating the effect. Fraudsters also learn which flow is weaker and migrate to it. This is a SUTVA violation.
IP address is poor too. It is too coarse (carrier NAT and corporate networks hold many legitimate users) and too easy to evade (proxy and VPN rotation).
Recommended: randomize by identity cluster.
- Build a linkage graph over device fingerprint, phone number, email pattern, payment instrument and document number. Clusters are connected components.
- Hash the cluster ID to an arm.
- Make assignment sticky: a new account linked to an existing cluster inherits its arm.
- For brand-new entities, assign on device fingerprint at the first onboarding screen.
Analysis consequences: use cluster-robust standard errors (or a delta-method ratio at the cluster level) and inflate sample size by the design effect, DE = 1 + (m̄ − 1)·ICC. Most legitimate users are singleton clusters, so DE is near 1 for conversion but larger for fraud.
Rollout risk control (the flow is a bottleneck):
- Ramp 1% → 5% → 25% → 50%.
- Automatic kill-switches on vendor error rate and conversion.
- A fallback path: a liveness timeout or error routes to the existing document flow, not a dead end.
- Check sample ratio mismatch at every stage; skewed cluster sizes make it likelier.
3. Power analysis
First clarify that "0.5%" means absolute: 20.0% → 19.5%. A relative 0.5% (δ = 0.001) would need about 25× more traffic.
With two-sided α = 0.05 and 80% power:
n per arm = (1.96 + 0.842)² · [0.20·0.80 + 0.195·0.805] / 0.005²
= 7.849 · 0.31698 / 0.000025
≈ 99,500 applicants per arm (~200k total)
Factors that change the number:
- Variance depends on the mean, so both arms' p(1−p) enter the formula.
- A one-sided non-inferiority test (z = 1.645) lowers n to roughly 78k per arm.
- Multiple primary metrics need a correction (Bonferroni) or a gatekeeping order, which raises n.
- The design effect from clustering.
- Fraud is powered separately. A 40% reduction is large but the base rate is low: at 1% (→ 0.6%) about 7.8k per arm; at 0.1% about 78k per arm. Take the larger requirement across metrics.
- Label delay: duration = enrollment time + 60-day maturation.
- Daily applicant volume and allocation set enrollment time. Run whole weeks and avoid market spikes that change applicant mix.
- Variance reduction: CUPED or stratification on pre-assignment covariates (country, device, channel).
- The cost of missing a real drop determines the power level and MDE you choose.
4. Bias across demographics and devices
Liveness models often fail unevenly: low-end cameras, poor lighting, old Android versions, darker skin tones, accessibility needs and some regions.
- Stratify randomization by device tier, OS, country and channel so arms are balanced within segments.
- Pre-register heterogeneity analysis: pass rate, conversion and fraud per segment, with multiple-testing correction, and a disparity threshold (for example a failure-rate ratio under 1.25 versus the best segment).
- Protected attributes: do not infer them ad hoc. Use document-derived age and country, and audit skin tone and similar attributes offline with consented, labeled data.
- Design mitigations: guided retries (lighting tips) and a fallback to document review instead of hard rejection.
- Watch for Simpson's paradox: an average improvement can hide harm in one segment, so ship decisions should require segment-level guardrails. Involve legal and compliance.
Common mistakes
- Measuring fraud per approved account, which bakes in selection.
- Randomizing by account and ignoring displacement of fraud into control.
- Reading fraud results before the label window matures.
- Sizing only for conversion and forgetting the fraud outcome.
- Confusing absolute and relative effect sizes.
- Shipping on the aggregate result without segment checks or a fallback path.