Sample ratio mismatch

Also known as: SRM

On this page 7

Sample ratio mismatch (SRM) is a statistically significant difference between the planned allocation of units to experiment variants and the allocation actually observed in the data. In experimentation within the Data field, an SRM is treated as a data quality alarm: if a test designed as a 50/50 split records 50,000 users in control and 48,600 in treatment, something other than chance has probably interfered with assignment, exposure or logging.

SRM matters because randomized experiments derive their validity from the assumption that groups differ only by the treatment. When the ratio is wrong, that assumption is likely broken, and the measured effect may reflect who was counted rather than what the change did. Most mature A/B testing programs therefore block or flag results automatically when an SRM is detected.

How sample ratio mismatch is detected

SRM is detected with a chi-square goodness-of-fit test that compares observed counts per variant with the counts expected from the configured split. For two groups, the statistic sums the squared differences between observed and expected counts, divided by the expected counts, and is compared with a chi-square distribution with one degree of freedom.

Because SRM checks run on every experiment and large samples make tiny deviations significant, practitioners use a strict threshold, commonly p < 0.001 or even lower, rather than the conventional 0.05. A strict threshold keeps false alarms rare across hundreds of tests while still catching real defects, which usually produce extremely small p-values.

The table below illustrates how the same relative imbalance becomes more alarming as the sample grows, assuming a planned 50/50 split.

Total usersObserved splitApproximate p-valueInterpretation
2,00050.5% / 49.5%About 0.65Normal random variation
20,00050.5% / 49.5%About 0.16No evidence of SRM
200,00050.5% / 49.5%Below 0.0001Strong SRM signal
1,000,00050.2% / 49.8%Below 0.0001Strong SRM signal
Observed split versus statistical evidence of SRM

The lesson is that percentage gaps alone are misleading. A 1 percentage point gap is harmless in a small test and decisive in a large one, so the formal test, not visual inspection, should drive the decision.

Common causes of sample ratio mismatch

SRM almost always originates in the experiment infrastructure rather than user behavior, although the treatment itself can trigger it. The causes cluster around four stages: assignment, exposure, logging and analysis.

StageExample defectEffect on counts
AssignmentFaulty hashing or overlapping experimentsUnits routed unevenly to variants
ExposureTreatment page loads slower or crashesFewer treatment users trigger the exposure event
RedirectsTreatment uses an extra redirect hopUsers and bots lost in one variant only
LoggingEvent dropped in one code pathMissing records for a variant
Bot filteringTreatment changes trigger bot heuristicsAsymmetric removal of traffic
AnalysisFiltering on a post-treatment attributeGroups no longer comparable
Typical root causes by pipeline stage

A particularly subtle cause is conditioning on a post-treatment variable. If analysts keep only users who reached a page that the treatment made easier to reach, the treatment group grows artificially, and the comparison no longer reflects the original randomization.

Why SRM invalidates experiment results

SRM invalidates results because it indicates selection bias: the users missing from one group are rarely a random subset. If slow devices fail to load the treatment, the remaining treatment users are disproportionately on fast devices, who tend to convert at higher rates regardless of the change being tested.

Such bias can create apparent wins or losses that are entirely artificial, and its direction is often unknowable. Adjusting the counts or reweighting the groups cannot repair the problem, because the missing units differ in unobserved ways from those that remain.

The following comparison distinguishes SRM from related concepts in the experimentation toolkit.

ConceptWhat it describesRelation to SRM
RandomizationProcess that assigns units to groupsSRM shows it was compromised
Sample sizeNumber of units needed for powerSRM concerns proportions, not totals
Statistical significanceEvidence for a treatment effectMeaningless when SRM is present
Novelty effectTemporary behavior change after launchBiases effects, not group counts
Holdout groupUnits kept from a feature long-termIts ratio should also be monitored
SRM compared with related experimentation concepts

Investigating and resolving an SRM alert

Resolving an SRM begins with localizing the imbalance: analysts slice the ratio by date, platform, browser, country, app version and traffic source to find the segment where the deviation concentrates. A mismatch confined to one browser or one release usually points directly to a specific technical defect.

  1. Confirm the expected ratio in the configuration, including ramp-up changes during the test.
  2. Check the assignment logs before any filtering to see whether imbalance exists at the source.
  3. Compare exposure events with assignment records to find where users are lost.
  4. Review recent deployments, redirects and bot rules that touch only one variant.
  5. Fix the defect and restart the experiment with fresh randomization rather than reusing biased data.

A decision table helps teams respond consistently when the automated check fires.

FindingRecommended actionReason
SRM at the assignment levelStop the test and fix allocationRandomization itself is broken
SRM only after a filterRemove the filter or redefine the populationAnalysis introduced the bias
SRM in one segmentExclude only with strong justificationExclusion can hide new bias
Ramp change mid-testAnalyze periods separatelyExpected ratio differed by period
No SRM detectedProceed with standard analysisRatio is consistent with chance
Responding to SRM findings

Limitations and misconceptions about SRM checks

Passing an SRM check does not prove an experiment is valid. A defect can remove equal numbers of users from both groups while still removing different kinds of users, which leaves the ratio intact but biases the comparison.

  • A tiny gap can be serious: in very large tests, even 0.2 percentage points may indicate a real defect.
  • Ignoring SRM in winning tests is a common error, because favorable results are scrutinized less.
  • Repeated checking during a test inflates false alarms unless thresholds account for it.
  • Unequal designed splits, such as 90/10, require the test to use the configured ratio, not 50/50.

Industry experience from large experimentation platforms suggests that SRM affects a meaningful minority of experiments, often cited in the range of several percent, which is why automated checks are considered a baseline safeguard rather than an optional diagnostic.

In everyday language

Imagine flipping a fair coin to send each visitor to version A or version B of a website. After many visitors, both groups should be almost exactly the same size. Sample ratio mismatch means they are not, and the difference is too large to be bad luck.

When that happens, something is quietly removing or adding people in one group, such as a page that fails to load. The results of the test can then no longer be trusted. The right response is to find the fault and run the test again, not to celebrate or reject the change.

Seen in the real world

An online travel retailer runs a 50/50 test of a redesigned search results page. After ten days, the dashboard reports 412,000 users in control and 401,500 in treatment, with the treatment showing a 4 percent lift in bookings. The automated chi-square check returns a p-value far below 0.001 and flags the test.

Slicing by browser shows that nearly the entire gap comes from one older mobile browser, where a script in the new page throws an error before the exposure event fires. Those users, who typically book less often, were silently dropped from treatment, which explains the apparent lift. The team fixes the script, restarts the experiment with fresh assignment and, two weeks later, measures a lift of under 1 percent that is not statistically significant.