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 users | Observed split | Approximate p-value | Interpretation |
|---|---|---|---|
| 2,000 | 50.5% / 49.5% | About 0.65 | Normal random variation |
| 20,000 | 50.5% / 49.5% | About 0.16 | No evidence of SRM |
| 200,000 | 50.5% / 49.5% | Below 0.0001 | Strong SRM signal |
| 1,000,000 | 50.2% / 49.8% | Below 0.0001 | Strong SRM signal |
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.
| Stage | Example defect | Effect on counts |
|---|---|---|
| Assignment | Faulty hashing or overlapping experiments | Units routed unevenly to variants |
| Exposure | Treatment page loads slower or crashes | Fewer treatment users trigger the exposure event |
| Redirects | Treatment uses an extra redirect hop | Users and bots lost in one variant only |
| Logging | Event dropped in one code path | Missing records for a variant |
| Bot filtering | Treatment changes trigger bot heuristics | Asymmetric removal of traffic |
| Analysis | Filtering on a post-treatment attribute | Groups no longer comparable |
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.
| Concept | What it describes | Relation to SRM |
|---|---|---|
| Randomization | Process that assigns units to groups | SRM shows it was compromised |
| Sample size | Number of units needed for power | SRM concerns proportions, not totals |
| Statistical significance | Evidence for a treatment effect | Meaningless when SRM is present |
| Novelty effect | Temporary behavior change after launch | Biases effects, not group counts |
| Holdout group | Units kept from a feature long-term | Its ratio should also be monitored |
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.
- Confirm the expected ratio in the configuration, including ramp-up changes during the test.
- Check the assignment logs before any filtering to see whether imbalance exists at the source.
- Compare exposure events with assignment records to find where users are lost.
- Review recent deployments, redirects and bot rules that touch only one variant.
- 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.
| Finding | Recommended action | Reason |
|---|---|---|
| SRM at the assignment level | Stop the test and fix allocation | Randomization itself is broken |
| SRM only after a filter | Remove the filter or redefine the population | Analysis introduced the bias |
| SRM in one segment | Exclude only with strong justification | Exclusion can hide new bias |
| Ramp change mid-test | Analyze periods separately | Expected ratio differed by period |
| No SRM detected | Proceed with standard analysis | Ratio is consistent with chance |
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.