---
title: Is my improvement real? When a difference is more than chance
url: https://jarroba.com/en/is-my-improvement-real/
author: Ramón Invarato
date: 2026-11-30
modified: 2026-11-30
language: en
license: CC BY-NC-SA 3.0 (https://creativecommons.org/licenses/by-nc-sa/3.0/) — attribution: "Is my improvement real? When a difference is more than chance", Ramón Invarato, jarroba.com
categories: Artificial intelligence
tags: A/B test, ai, AI course, Artificial Intelligence, p-hacking, p-value, statistical significance
series: Level 1 — Uncertainty: the raw material of AI (part 4 of 4)
---

# Is my improvement real? When a difference is more than chance

> Your change raises the metric: real improvement or chance? A/B testing, the p-value and the mistake of peeking at results too early. AI course, 1.4.

You change something (the text on a button, the instructions you give a model, the whole model) and the number you care about goes up. Has it really improved, or was it chance? It depends on how much data you have. And the worst thing is to push the data until it says what you already thought.

To see why the question matters, imagine an online shop with a product page. Out of every 100 people who visit it, about 12 buy. But each visitor decides on their own, so 1000 visits do not always give exactly 120 purchases: sometimes more come out and sometimes fewer, just as flipping a coin 1000 times does not always give 500 heads. Now run a thought experiment: show half of the visits the page as it is and the other half an exact copy, with nothing changed. In the picture below, with 1000 visits each, the original sells 128 and the copy 110; in the next round (which could be the next day, with other people), 113 against 134. Neither of those differences is real, because the two pages are the same.

[![Drawing: three times the same page against an exact copy, 1000 visits each and a true purchase rate of 12%. The purchases come out 128 against 110, 113 against 134 and 113 against 122: differences of −1.8, +2.1 and +0.9 points with nothing having changed](https://jarroba.com/wp-content/uploads/2026/11/a-contra-a-www.jarroba.com_-1.svg)](https://jarroba.com/wp-content/uploads/2026/11/a-contra-a-www.jarroba.com_-1.svg)

## Try this first

Open the **[A/B Test](https://jarroba.com/tools/en/ab-test?na=1000&xa=120&nb=1000&xb=140)** tool. In the **Analyse** tab there is an example experiment: a version A of a page, seen by 1000 people, of whom 120 bought (12%), and a version B, the same page with something changed (for example, the text of the buy button), with 1000 visits and 140 purchases (14%). The tool calls the purchases **conversions**: what counts as a success in each visit. B looks better, but the tool, surprisingly, tells us: **“These data don’t show any difference”**.

Change the four numbers so that there is two and a half times more data, with the same percentages: A with 2500 visitors and 300 conversions, B with 2500 and 350 ([link with that data](https://jarroba.com/tools/en/ab-test?na=2500&xa=300&nb=2500&xb=350)). It is still 12% against 14%. Now the tool says **“B converts better than A”**.

[![A/B Test with the same percentages, 12% against 14%: with 1000 visitors per version, “These data don't show any difference” (p-value 0.18); with 2500, “B converts better than A” (p-value 0.036)](https://jarroba.com/wp-content/uploads/2026/11/ab-1000-y-2500-www.jarroba.com_-1-1024x969.png)](https://jarroba.com/wp-content/uploads/2026/11/ab-1000-y-2500-www.jarroba.com_-1.png)

The number that decides is the **p-value** (the probability of seeing a difference like this by pure chance, if A and B were the same; explained in detail below): 0.18 with 1000 visits and 0.036 with 2500.

Go to the **[Peeking early](https://jarroba.com/tools/en/ab-test?tab=peeking)** tab. It simulates an experiment in which **A and B are identical** (the “true lift of B” is at 0; the tool calls this an **A/A** test, because B is really another A) and in which someone looks at the result 10 times while the data arrive, stopping as soon as it comes out “significant” (with a p-value below 0.05, the usual bar for believing a difference). Read the first line: **“Real false positive rate: 19.0 %”** (a **false positive** is declaring a winner that does not exist). Almost one experiment in five declares a winner between two identical things.

[![The Peeking early tab: A and B identical and 10 looks; stopping at p < 0.05, the real false positive rate is 19.0% instead of 5%. The Pocock and O'Brien-Fleming rules stay close to 5%](https://jarroba.com/wp-content/uploads/2026/11/mirar-antes-de-tiempo-www.jarroba.com_-1-1024x560.png)](https://jarroba.com/wp-content/uploads/2026/11/mirar-antes-de-tiempo-www.jarroba.com_-1.png)

## What just happened

The tool decides with the **p-value**: the probability of seeing a difference like this *if there were none*. With 1000 visits per version, the p-value is 0.18: a difference of 2 points between two identical versions would come up by chance almost once in every five times. The usual practice is not to believe it until it drops below 0.05, and with 2500 visits it drops to 0.036.

[![Drawing: histogram of the differences between A and B in 20,000 A/A experiments of 1000 visits per version. Most fall near 0; in red, those that reach 2 points or more in either direction, 18.6%. That is the p-value, which the tool computes as 0.18](https://jarroba.com/wp-content/uploads/2026/11/p-valor-a-a-www.jarroba.com_-1.svg)](https://jarroba.com/wp-content/uploads/2026/11/p-valor-a-a-www.jarroba.com_-1.svg)

Below, the tool gives a **confidence interval** (95% CI), the range in which the true difference probably lies. With 1000 visits it runs from −0.95 to +4.96 points: it includes zero, so B could be slightly worse, the same or much better. With 2500 it runs from +0.13 to +3.87: it no longer includes zero. This is what the [article on minimal statistics](https://jarroba.com/?p=51489) explains: with more data, the error gets smaller, and the same difference goes from being indistinguishable from noise to not being so.

[![Drawing: the two confidence intervals on the same line, with the measured difference, +2 points, in the center. With 1000 visits it runs from −0.95 to +4.96 and crosses 0; with 2500 it runs from +0.13 to +3.87 and leaves it out](https://jarroba.com/wp-content/uploads/2026/11/intervalos-1000-y-2500-www.jarroba.com_-1.svg)](https://jarroba.com/wp-content/uploads/2026/11/intervalos-1000-y-2500-www.jarroba.com_-1.svg)

Note what [the tool said with 1000 visits](https://jarroba.com/tools/en/ab-test?na=1000&xa=120&nb=1000&xb=140): “These data don’t **show** any difference”. It did not say “there is no difference”. With 1000 visits per version, this experiment would detect a real improvement of 2 points only about one time in four. The **[Plan](https://jarroba.com/tools/en/ab-test?tab=plan)** tab calculates this before you start: to detect a move from 12% to 14% with a **power** of 80% (getting it right eight times out of ten if the improvement exists) you need **4,436 visitors per version**. To see it, set the “minimum lift” to 16.67%, which is what 2 points are on top of 12, or [open it already set](https://jarroba.com/tools/en/ab-test?tab=plan&baseline=12&mde=16.67). The general idea is in **[the Power tab of the Hypothesis testing tool](https://jarroba.com/tools/en/hypothesis?tab=power)**: two overlapping bells, one for “no effect” and another for “there is an effect”, and the more data, the less they overlap.

[![The Plan tab of A/B Test with the conversion at 12% and the minimum lift at 16.67%, from 12% to 14%: 4,436 visitors per variant are needed](https://jarroba.com/wp-content/uploads/2026/11/planificar-12-a-14-www.jarroba.com_-1-1024x291.png)](https://jarroba.com/wp-content/uploads/2026/11/planificar-12-a-14-www.jarroba.com_-1.png)

[![The Power tab of Hypothesis testing: two bells, “no effect” and “there is an effect”; the blue area is the power, 90.8% with effect 0.6 and a sample of 30](https://jarroba.com/wp-content/uploads/2026/11/dos-campanas-potencia-www.jarroba.com_-1-1024x485.png)](https://jarroba.com/wp-content/uploads/2026/11/dos-campanas-potencia-www.jarroba.com_-1.png)

## The classic mistake

You might think that looking at the results every day does no harm, as long as you only stop once it is significant. That is exactly what does harm. Each time you look, the noise gets another chance to cross the 0.05 line, and it only has to cross it once for you to stop. With a single look at the end, the false positive rate is the promised 5%. With 10 looks, 19%; with 50, 32%. Evan Miller explained it in 2010 in an article, with this rule: looking is fine, as long as you do not stop the experiment before it ends ([How Not To Run an A/B Test](https://www.evanmiller.org/how-not-to-run-an-ab-test.html)).

[![Drawing of an invented example: the p-value of an A/A test over ten looks goes up and down; at look 5 it drops to 0.04, below 0.05, and whoever stops there declares a winner that does not exist; at the end it is at 0.41](https://jarroba.com/wp-content/uploads/2026/11/mirar-diez-veces-www.jarroba.com_-1.svg)](https://jarroba.com/wp-content/uploads/2026/11/mirar-diez-veces-www.jarroba.com_-1.svg)

Pushing the data until something comes out significant has a name, ***p-hacking***, and it does not have to be done on purpose ([*Data dredging*, on Wikipedia](https://en.wikipedia.org/wiki/Data_dredging)). There are two honest ways out: decide the size before starting (the **[Plan](https://jarroba.com/tools/en/ab-test?tab=plan)** tab) or use rules designed for looking several times, which demand more at each look. In the **[Peeking early](https://jarroba.com/tools/en/ab-test?tab=peeking)** tab there are two: one by Pocock, a medical statistician who proposed it in 1977 for clinical trials ([*Pocock boundary*, on Wikipedia](https://en.wikipedia.org/wiki/Pocock_boundary)), and one by O’Brien and Fleming. With either of them, the false positive rate goes back to around 5%.

In AI exactly the same thing happens. If you compare two versions of some instructions, or two models, with a handful of test questions, and repeat until one “wins”, you have done *p-hacking* under another name (measuring a model well has its own article: A benchmark for AI).

And even if you do not repeat, size rules. With instructions A that get 35 of 50 questions right (70%) and instructions B that get 38 (76%), [A/B Test](https://jarroba.com/tools/en/ab-test?na=50&xa=35&nb=50&xb=38) says nothing is shown: p-value 0.50. The same difference with [1000 questions](https://jarroba.com/tools/en/ab-test?na=1000&xa=700&nb=1000&xb=760) is already taken as shown: p-value 0.0025. Here “visitors” are questions and “conversions” are correct answers.

[![A/B Test used to compare two prompts. With 50 questions, 70% against 76%: “These data don't show any difference”, p-value 0.4992. With 1000 questions and the same percentages: “B converts better than A”, p-value 0.0025](https://jarroba.com/wp-content/uploads/2026/11/dos-prompts-50-y-1000-www.jarroba.com_-1-1024x969.png)](https://jarroba.com/wp-content/uploads/2026/11/dos-prompts-50-y-1000-www.jarroba.com_-1.png)

## Try it yourself

Test yourself

In **[the Plan tab of A/B Test](https://jarroba.com/tools/en/ab-test?tab=plan&baseline=12&mde=10)**, with the conversion at 12%, the “minimum lift” is at 10%. How many visitors does it ask for per variant? Then set it to 25%.

With 10%, about ___; with 25%, ___.

**Hint:** Type the numbers without a thousands comma. They are under “Visitors per variant”.

See the answer

**Answers: 12000 ± 10 and 2036.**

An improvement 2.5 times smaller asks for almost 6 times more visitors. The standard error drops with the square root of the amount of data, the one in the [article on minimal statistics](https://jarroba.com/?p=51489): to see a difference half as large you need four times more data.

In **[Peeking early](https://jarroba.com/tools/en/ab-test?tab=peeking)**, raise the “true lift of B” above 0: now there is a real winner.

Test yourself

With a real winner, which rule finds it sooner?

- **A.** Stopping at p < 0.05: it is the one that asks for the least at each look, even though it is wrong more often when there is no winner.
- **B.** O’Brien-Fleming, because it is the most demanding at the start.
- **C.** All three at once: if there is a winner, the rule does not matter.

See the answer

**The answer is A.**

Look at the table below: stopping at p < 0.05 settles for |z| ≥ 1.960 at each look; Pocock and O’Brien-Fleming ask for more, especially at the start. With a [real lift of 10%](https://jarroba.com/tools/en/ab-test?tab=peeking&rate=5&visitors=20000&looks=10&lift=10), the first one detects it in about 73 out of every 100 experiments; O’Brien-Fleming, in about 60, and Pocock, in about 49. In exchange, those two do not fall into the first one’s mistake, which declares a false winner 19% of the time when there is none. That is the price of being allowed to look.

## Further reading

- [How Not To Run an A/B Test](https://www.evanmiller.org/how-not-to-run-an-ab-test.html), by Evan Miller: the problem of peeking early, with the table of how much to demand at each look.
- [*Data dredging*, on Wikipedia](https://en.wikipedia.org/wiki/Data_dredging): *p-hacking* and its variants, which are not always peeking early.

## Series: Level 1 — Uncertainty: the raw material of AI

1. [The unlikely happens too: chance and distributions](https://jarroba.com/en/chance-and-distributions.md)
2. [Bayes without formulas: why a positive does not mean what it seems](https://jarroba.com/en/bayes-without-formulas.md)
3. [A sample is not the whole truth: minimal statistics](https://jarroba.com/en/minimal-statistics.md)
4. [Is my improvement real? When a difference is more than chance](https://jarroba.com/en/is-my-improvement-real.md)

