Bell Statistics

What is Bayesian A/B testing?

Bayesian A/B testing analyses an experiment by producing a probability distribution over the effect rather than a reject-or-not verdict. It reports statements like a 92% chance the variant is better, and it changes how results are expressed more than it changes what they can support.

Also called
bayesian experimentation, bayesian testing, bayesian analysis of experiments
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

In plain English

Bayesian A/B testing replaces the reject-or-not verdict with a distribution. Instead of "p = 0.03, significant", the output is a posterior over the effect, from which you read the probability the variant is better, the probability it clears a business threshold, and the expected loss from choosing wrongly. Those outputs map more directly onto a decision than a p-value does, and that is the honest case for it.

The genuine advantages are worth stating plainly. The outputs are interpretable — "92% chance the variant is better" means what a reader thinks it means, whereas a p-value almost never does. Decision-theoretic framing follows naturally, so a threshold can be set on expected cost rather than on an arbitrary 5%. And where a real prior exists, it is used rather than discarded, which is a genuine efficiency gain that frequentist analysis leaves on the table.

The reason most teams actually adopt it is a misconception, and it is worth being direct about. Bayesian methods are widely believed to remove the peeking problem — check whenever you like, stop when the probability of being better crosses 95%. That is false. A posterior is a valid statement of belief at every moment, and a stopping rule that waits for it to cross a threshold selects favourable moments exactly as the frequentist version does. Simulations of that rule produce error rates well above the nominal level. Anytime-valid Bayesian procedures exist; the default implementation in most tools is not one.

The second common disappointment is that the prior rarely does much work. Most platforms default to something flat or near-flat, because a per-experiment informative prior requires history nobody has assembled — and with a flat prior on a decent sample the Bayesian answer is a re-expression of the frequentist one. Teams switch expecting a more powerful method and receive the same evidence in friendlier language, which is a real gain in communication and not the gain they were sold.

Where it genuinely earns its place is where the prior carries information: marketing mix modelling, where domain knowledge about channel behaviour and adstock is substantial and hard-won, or small-sample settings where past effect sizes are a better guide than a thin experiment. For a high-traffic conversion test with no informative prior, the choice of framework is mostly a choice about how to phrase the answer.

The formula

The machinery is the posterior and the summaries read off it. The comparison against the frequentist quantity is what shows how little changes when the prior is flat.

The model for rates
Beta(α, β) prior → Beta(α + s, β + n − s) posterior

Conjugate, so updating is arithmetic. This is what almost every Bayesian A/B tool implements.

Probability of being better
P( θ_B > θ_A ) = ∫∫ 1[θ_B > θ_A] p(θ_A) p(θ_B) dθ_A dθ_B

Computed by sampling in practice. The headline number most tools report.

The relationship under a flat prior
P( θ_B > θ_A ) ≈ 1 − p_one-sided

A 97% probability of being better corresponds closely to a one-sided p of 0.03 — see the A/B test sample size calculator.

What it does not give you
safety under an optional stopping rule

Stopping when P(better) first crosses 95% inflates the error rate well above 5%.

Worked example

A simulation runs 10,000 A/A experiments — no real effect — under a Bayesian analysis with a flat prior, comparing two stopping rules: run to a fixed 40,000 users per arm, or check daily and stop when P(variant better) first exceeds 95%.

Simulated experiments
10,000, true effect zero
Fixed horizon, P(better) > 95% at the end
5.1% of runs
Daily checks, stop at first P(better) > 95%
24.7% of runs
Median stop day when it stopped early
day 5
Frequentist equivalent, same stopping rule
26.3%
Correlation between the two frameworks' verdicts
0.98

Bayesian analysis with an opportunistic stopping rule produces false positives 24.7% of the time — essentially the same as frequentist peeking.

The two failure rates being 24.7% and 26.3% is the point. Switching framework did almost nothing to the error rate, because the problem was never the framework — it was the stopping rule, which selects favourable moments regardless of what statistic is being watched. The 0.98 correlation in the last row says the same thing from another angle: with a flat prior these two analyses are near-identical instruments wearing different labels. The first row is the reassuring one: run to a fixed horizon and the Bayesian analysis is correctly calibrated at 5.1%. So the practical guidance is the same in both frameworks — fix the duration in advance, or adopt a procedure explicitly built for continuous monitoring. What Bayesian analysis genuinely offers is better-phrased output, and it is worth having for that reason alone rather than for a peeking immunity it does not possess.

Common misconceptions

Bayesian A/B testing lets you stop whenever the probability looks good.
It does not. A stopping rule that waits for P(better) to cross a threshold selects favourable moments and inflates the error rate to roughly the same level frequentist peeking produces. This is the most widespread misconception about the framework and usually the reason it is adopted.
Bayesian methods need less data than frequentist ones.
Only when the prior carries genuine information, which requires history most teams have not assembled. With the flat prior that platforms default to, the two frameworks extract essentially the same evidence from the same data and reach the same conclusions. The gain is in expression, not efficiency.
A 95% probability of being better is stronger evidence than p = 0.05.
Under a flat prior they are near-equivalent restatements — a 95% posterior probability corresponds closely to a one-sided p of 0.05. The Bayesian phrasing is clearer and the underlying evidence is the same. Treating it as a higher standard because it sounds more definitive is reading the notation rather than the data.

Frequently asked questions

Is it worth switching to Bayesian A/B testing?
For communication, often yes — stakeholders read "92% chance the variant is better" correctly and misread p-values almost universally, and expected-loss framing maps onto decisions better than a significance threshold. For statistical power, only if you have a genuinely informative prior. Switching in the belief that it permits continuous monitoring is switching for a reason that is not true.
Does Bayesian analysis solve the peeking problem?
Not as usually implemented. The posterior is a valid belief at every moment, and stopping the first time it crosses a threshold still selects favourable moments — simulations put the resulting error rate near 25%, essentially matching frequentist peeking. Procedures designed for continuous monitoring exist in both frameworks and have to be chosen deliberately.
Where does the Bayesian approach genuinely win?
Where the prior carries real information. Marketing mix modelling is the clearest case: domain knowledge about channel behaviour, adstock and diminishing returns is substantial and would otherwise be discarded. Small-sample settings where past effect sizes are more informative than a thin experiment are another. For a high-traffic conversion test with no prior worth having, the framework choice is mostly about phrasing.
What prior should a Bayesian A/B test use?
An empirical one built from your own past experiments where possible — the distribution of effect sizes you have historically observed. That is defensible because it was not invented for this analysis, and it correctly discounts implausibly large results. Where no history exists, a weakly informative prior plus a sensitivity check across alternatives is more honest than a flat prior presented as neutral.

Related terms

  • Always-valid inference

    Statistics that stay honest under continuous monitoring — you may stop whenever you like, and it costs about a third more traffic.

  • Expected loss

    How much a wrong decision would cost, in the units of the metric — the closest any of these numbers gets to a business answer.

  • Posterior distribution

    The whole distribution of what the effect might be — which is why Bayesian reports can answer questions a p-value cannot.

  • Probability to be best

    The chance an arm is the winner — silent on the margin, and it splits awkwardly across near-identical variants.

  • Prior distribution

    What you believed before the data — an asset when it carries real information, and a hidden assumption when it does not.

Calculate it

  • A/B test sample size

    Size a two-proportion experiment before you launch, then read the lift and its interval once it lands.

  • One-proportion z-test

    Test one observed rate against a fixed target — an SLA, a benchmark, a contractual floor.

Knowing the term is the easy part

Applying it to a live measurement problem is the part that goes wrong. If you are designing an experiment, reading a result you do not trust, or trying to work out what your marketing actually caused, that is the work we do.

References