← Latest papers
📊 statistics

Bayesian Inference Procedures for A/B Testing: An Overview

This paper provides a systematic three-tier hierarchy of Bayesian A/B testing configurations, demonstrating that while many commercial platforms use uncalibrated methods, proper selection of priors and stopping rules—specifically Bayes factor stopping and empirical Bayes—is essential to control distinct risks like false positive rates, estimation error, and regret.

Original authors: Mårten Schultzberg, Mattias Frånberg

Published 2026-08-14
📖 7 min read🧠 Deep dive

Original authors: Mårten Schultzberg, Mattias Frånberg

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to solve a mystery: "Did this new clue actually solve the case, or was it just a lucky guess?" In the world of science and business, this is called A/B testing. It's a way to compare two versions of something (like a red button vs. a blue button) to see which one works better. But here's the tricky part: if you keep checking the results while the experiment is running, you might get fooled by random noise. It's like flipping a coin and stopping the moment you see three heads in a row; you might think the coin is magic, but it's just luck. This is the danger of "peeking."

To solve this, scientists use Bayesian inference, a method that updates beliefs as new data arrives, kind of like how you update your opinion about a movie as you watch more scenes. However, there isn't just one way to do this. Some methods are like guessing based on a hunch, while others are like using a strict rulebook to avoid false alarms. The big question is: which method actually keeps you safe from making bad decisions, and which one just feels safe? This paper dives into the messy reality of these different methods to figure out which ones are actually reliable and which ones are just fancy ways of getting tricked by chance.


The Three Tiers of Truth

The authors, Mårten Schultzberg and Mattias Frånberg from Spotify, realized that people often talk about "Bayesian A/B testing" as if it were a single, magic tool. They discovered it's actually a family of different tools with very different superpowers (and weaknesses). To make sense of this, they organized these tools into a three-tier hierarchy, like a video game with three levels of difficulty and safety.

Level 1: The "Hunch" Tier (Posterior Coherence)

Imagine you are playing a game where you just want to feel confident about your guess. You look at the data and say, "I'm 95% sure the blue button is better!" This is Level 1. It's mathematically consistent, meaning your belief updates make sense internally. But here's the catch: it offers zero protection against false alarms if you keep checking the results.

The paper shows that if you use a "flat" prior (basically starting with no opinion) and just stop whenever you feel 95% sure, you are doing the exact same thing as a "simple peeker." It's like checking your coin flip every second and stopping the moment you see three heads. The paper's simulations confirm that this method has a false positive rate of about 30% (way higher than the 5% people usually want). It feels good, but it's dangerous. Even if you try to use a "decision-theoretic" approach (calculating the cost of a mistake), if you don't have a strict rule for stopping, you might still end up shipping a bad feature half the time.

Level 2: The "Guarded" Tier (Bayes Factor Stopping)

Now, let's add a security guard. Level 2 uses something called a Bayes Factor. Think of this as a score that compares how much the data supports "Version B is better" versus "Version B is the same as A."

The paper finds that if you use a proper prior (a reasonable starting guess) and stop only when this score crosses a specific line, you get a guarantee. No matter how many times you peek, the chance of a false alarm stays below your limit (usually 5%). This is a huge deal. The authors show that for many real-world business costs, this method is almost the best possible way to decide when to stop. It's like having a bouncer who checks your ID every time you try to enter, ensuring that only the truly lucky (or truly skilled) get in.

Interestingly, the paper argues that the choice between "Bayesian" and "Frequentist" (the other main statistical school of thought) often doesn't matter as much as people think. If you set up a Bayesian test with a specific cost model, it often ends up looking exactly like a Frequentist test. The math is different, but the outcome is often the same.

Level 3: The "Master" Tier (Empirical Bayes)

This is the VIP section. Level 3 adds a secret weapon: history. Instead of guessing what a "reasonable" starting point is, this method looks at hundreds of past experiments from the same company to learn the truth about how big effects usually are.

Imagine you are a chef. In Level 2, you guess how much salt to add based on a recipe book. In Level 3, you look at a logbook of every dish you've cooked in the last year to see exactly how much salt the customers actually liked. This is called an Empirical Bayes prior.

The paper shows that when you use this history-based prior, you get two amazing benefits:

  1. Automatic Correction: It naturally fixes the problem of checking too many things at once (multiplicity). If you test 10 buttons, you don't need to do extra math to avoid false alarms; the history does the work for you.
  2. Calibrated Shrinkage: It pulls extreme results back to reality. If a test shows a massive 50% improvement, but your history says improvements are usually tiny, this method says, "That's probably a fluke," and pulls the estimate down. This prevents the "Winner's Curse," where you celebrate a huge win that was actually just noise.

But there's a trap. The paper warns that this Level 3 magic only works if your history is honest and representative.

  • If you only look at your past wins (ignoring the failures), your history is broken, and the method fails.
  • If you mix data from two different types of experiments (like mixing cake recipes with car engine tests), the history gets confused, and the protection disappears.
  • You need a decent amount of history (around 200 past experiments) for this to work reliably.

The Verdict: It's About the Risk, Not the Label

The authors ran simulations to test these tiers against each other and against standard Frequentist methods. Here is what they found:

  • Level 1 (Flat Prior + Peeking): It's a disaster for error control. It produces false positives about 30% of the time, just like simple peeking.
  • Level 2 (Bayes Factor): It keeps false positives low (under 5%) and is very flexible. It doesn't require you to decide in advance how long the experiment will run.
  • Level 3 (Empirical Bayes): When the history is good, it produces the most accurate estimates (lowest error) of all methods. It shrinks wild guesses back to reality better than anyone else.
  • The "Expected Loss" Trap: Some people try to stop based on "how much money we might lose." The paper shows this only works if shipping a bad feature is free. If there is any cost to shipping a bad feature (like fixing code or annoying users), this method starts shipping bad features way too often.

The paper concludes that the "best" method isn't about being Bayesian or Frequentist. It's about what risk you are trying to control.

  • If you need to be absolutely sure you aren't making false claims, you need Level 2 or 3.
  • If you have a lot of history and want the most accurate numbers, Level 3 is the king.
  • If you don't have enough history, stick to Level 2 and use strict rules to avoid false alarms.

In the end, the paper suggests that the most important step isn't picking a fancy statistical name. It's asking: "What happens if I'm wrong?" If the cost of being wrong is high, you need the guardrails of Level 2 or 3. If you treat the method like a magic wand without understanding the rules, you might end up celebrating a victory that was just a lucky guess.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →