Skip to content

Guide

Multi-armed bandit vs A/B testing

A fixed A/B test gives a clean answer to one question. A multi-armed bandit keeps moving traffic towards what works. Here is what each does well, what each costs, and how to prove what a bandit adds.

At a glance

Fixed A/B test Multi-armed bandit, as Zigbongo runs it
Traffic split Fixed until the test ends Moves towards what pays as evidence builds
Losing options Keep their share to the end Shrink as the evidence builds
Questions One per test Every choice in a checkout, quiz or onboarding at once
Different people One winner for everyone A best choice for each group of customers, from what you tell it about them
After the result Hard-coded, slowly goes stale Keeps learning; old evidence fades
What it proves The effect of one change, cleanly What everything learned adds, against a holdout of customers who keep your defaults
Checking early Inflates false wins, unless the test is sequential A 95% interval that holds however often you look
Best for One-off decisions and big changes Recurring choices that move revenue per customer

What a fixed A/B test does well

You split people at random between two versions, fix the sample size in advance, and compare once you reach it. Because the split never changes, the groups differ only in the change you made, so the difference between them is its effect: one clean estimate, with an interval and a known chance of a false positive. That's what you want when the number itself matters, such as how much more the new pricing page earns.

What it costs

  • Traffic on the loser until the end. With a 50/50 split, half your customers see the worse version for the whole test, however early it looks bad.
  • One question at a time. Each test needs its own set-up and wait, while your product's other choices (which plan to lead with, how long a trial, which upsell) queue up.
  • One winner for everyone. If annual billing wins for teams and monthly for freelancers, the average hides it, and slicing the result afterwards adds false positives with every slice.
  • A result that goes stale. You hard-code the winner. When prices, traffic or customers change, nobody runs the test again.
  • Peeking breaks the interval. A fixed 95% interval holds for one look at the planned size. In our simulations of tests where nothing differed, reading such an interval daily for 90 days showed a false win at some point in 21% to 34% of runs. Sequential tests fix this, at the price of a wider interval.

What a multi-armed bandit does

A multi-armed bandit (named after a gambler choosing between a row of slot machines, the "one-armed bandits") decides person by person which option to show. Instead of a fixed split, traffic moves towards the options that pay and away from those that don't, as the evidence comes in.

Thompson sampling, in plain words

Zigbongo uses Thompson sampling. For each option it keeps a belief about how well that option pays: wide when there's little data, narrow when there's a lot. Each time someone reaches the decision, it draws one plausible value from each option's belief and shows the option with the highest draw.

  • An option that's probably best wins most draws, so it gets most of the traffic.
  • An option that's still uncertain wins some draws, so it keeps getting a chance.
  • An option that's clearly worse almost never wins, so it fades out.

Nobody sets an exploration rate: exploring follows the uncertainty and fades as it shrinks. Zigbongo adds three guards:

  • It starts from your default. At first, when the draw picks another option, only a fifth of those picks go through and the rest get your default. That rises to all of them over the first 1,000 decisions at each decision point, each place in your product where Zigbongo chooses between options.
  • A floor for options still in the running. Each option keeps at least 2% of the traffic while it still has a 1% or better chance of being best, and never more than 20% of a decision point's traffic goes to the floor in all.
  • Old evidence fades, with a 90-day half-life, so the choice keeps up when your customers change.

Contextual bandits choose for each group of customers

A plain bandit finds the option that's best on average. A contextual bandit also takes what you know about the person or the moment (their plan, country, traffic source or earlier answers) and learns which option is best for each. In Zigbongo you send these as inputs with the decision, as exact values or in bands, and each group of customers gets its own best choice.

The price is traffic. In simulation, a five-step quiz found its best version after about 20,000 sessions (the median of 100 simulated runs, where the best version earns 44% more than the default). A session is one person's run through the quiz. Flows that personalize by context need more.

The usual objection: weaker statistics

It's a fair objection. A bandit moves traffic as it goes, so its groups aren't comparable: the leading option was shown more often, later, to whoever arrived then. Their averages don't give a clean estimate of option B against option A, and a bandit alone can't tell you whether its learning beat doing nothing.

How Zigbongo measures: a standing holdout

Zigbongo answers it as an A/B test would: with a control group that never changes.

  • 5% keep your defaults. In each flow (one place in your product where Zigbongo chooses for a customer, such as a checkout), 5% of people (you can change the share per flow) get your default at every decision point. This is the holdout. Who is in it is fixed per person, and nothing is learned from them.
  • The lift of Zigbongo's choices as a whole. Everyone else is the side Zigbongo chooses for, including the moments they got your default anyway, such as after a timeout. The two sides' difference is the lift of everything Zigbongo learned over what you'd have done anyway, in your outcome's units and as a percentage.
  • A 95% interval that holds however often you look. It's an always-valid interval (a confidence sequence), so checking the dashboard daily doesn't inflate false wins. The dashboard says "Clearly better" only when the interval leaves out zero.
  • Measured continuously, for as long as the flow runs. Each session counts once the time you allow for its outcome, its attribution window, has passed, and the comparison starts when each side has 20 such sessions with a non-zero outcome. Holdout and lift has the details.

What it doesn't give you:

  • It measures Zigbongo's choices as a whole, not each option. Each option's estimate on the dashboard is Zigbongo's own belief about it. It ranks options, but it isn't a randomized comparison of two of them.
  • Proof comes later than learning. A 5% holdout is small. In the simulated quiz above, the lift became clear after a median of 42,500 sessions, against about 20,000 to find the best version. A larger holdout gets there sooner, with more people seeing your default choices meanwhile.
  • With very skewed revenue, the 5% error rate is approximate at first. In simulation, with revenue where a few orders are very large and few purchases in a 5% holdout, about 8% of comparisons where nothing differed showed a false win at some point, rather than 5%.

When a classic A/B test is still the right tool

  • A one-off decision you'll hard-code. If you'll choose once and not revisit it, a fixed test answers that question cleanly and you're done.
  • A change too big to run as options. A bandit keeps choosing for as long as the flow runs, so every option stays live in your code. A redesign of the whole app isn't something to maintain twice: test it once, then ship the winner.
  • When you need a clean estimate of one effect. If the number is the deliverable, such as how much a price rise costs in conversions, a randomized split with a planned size gives the most precise answer for its traffic.
  • When the outcome takes many months. A bandit learns from outcomes as they arrive. If yours shows up long after the decision, there's little to learn from meanwhile, and a fixed test that waits for it is simpler.

The two fit together: fixed tests for the big one-off questions, a bandit for the many recurring choices that move revenue per customer. How it works shows the two API calls behind it, and pricing is per session, with 10,000 sessions free every month.

Let every decision earn its keep.

Start from your defaults and let the holdout prove every gain. A few customers keep seeing what you show today, so you see what Zigbongo adds. 10,000 sessions a month on us.

Start free