Key takeaways
- Benchmark scores carry sampling noise: swap in new questions and the score moves. The size of that noise is the standard error, roughly p(1−p)/n. For 1,000 questions at around 70% accuracy, that's about plus or minus 1.4 points.
- The p-value is the probability, assuming the null hypothesis is true, of seeing data at least this extreme. The smaller it is, the harder it is to blame luck. It is not the probability that the null hypothesis is true.
- Asking "are these groups different?": compare means with a t-test, several groups with ANOVA, whole distributions with the KS test, and categories with the chi-squared test. For two models' right and wrong answers on the same test set, reach for McNemar's test.
- Asking "are these variables related?": Pearson looks at linear relationships, Spearman at ranks and monotonic relationships, and mutual information catches any kind of dependence (though it isn't really a test).
- Three common misreadings: a p-value isn't the chance the null is true; significant doesn't mean important; and if you run lots of comparisons, you have to correct your threshold.
71.2 vs. 70.5: is A really better?
Say you're reading a paper. The authors compare two models on a benchmark with 1,000 questions: model A scores 71.2 and model B scores 70.5. In the results table, A's score is in bold, which is the paper's way of saying A is better.
But the gap is only 0.7 points. Put another way: out of 1,000 questions, A got just 7 more right. So, is A really better than B, or were those 7 questions just luck?
Evaluating models constantly raises this kind of question: are two models (or two sets of numbers) really different, or is it just chance? This bonus episode steps outside the model to learn a little statistics, whose tests exist precisely to separate real differences from random wobble. The plan: the noise hiding in a score, p-values, whether two groups differ, whether two variables are related, and the most common ways people misread all of this.
Where noise comes from: new questions, new score
Where do a benchmark's 1,000 questions come from? They're a small handful picked out of all the questions you could possibly ask. It's like a poll that asks 1,000 people, hoping to learn what a whole country thinks. A test is one sample of the model's true ability.
Suppose that across every possible question, model A has a true accuracy of 71%. Each time we give it a brand-new test, what will it score?
- The first test gives 73.2. Swap in new questions: 69.3. Swap again: 70.4.
- Repeat this 60 times, each with 1,000 brand-new questions. The score isn't fixed: it scatters around 71, with lots of results in the middle and fewer at the edges, piling up into a bell shape.
This wobble, caused purely by which questions happened to get picked, is called sampling noise. The model hasn't changed one bit; only the test has.
Watch out: Noise has other sources too, like random sampling during generation: ask the same question twice and you might get two different answers. This episode only looks at the noise from sampling the questions.
How big is the noise? The standard error
How spread out is that cloud of dots? We can calculate it directly.
Start with a single question. The model gets it right with probability p and wrong with probability 1−p, like flipping a slightly lopsided coin. A single question scores either 1 or 0, and its variance (a measure of how far results tend to land from the average) is
p(1−p)
Average over 1,000 questions and the luck on each one partly cancels out: the variance of the average gets divided by n, the number of questions. Take the square root and you get the standard deviation of the average score, called the standard error (SE). It's the size of the noise:
SE=np(1−p)=10000.71×0.29≈0.014
That's 1.4 points.
The average of many questions tends to follow a bell-shaped curve called the normal distribution. It has a handy rule: about 95% of results land within 2 standard errors of the center. Sure enough, 56 of our 60 dots fall within 71±2.9.
More questions, less noise, but only by the square root
| Questions n |
Standard error |
| 100 |
about 4.5 points |
| 1000 |
about 1.4 points |
| 10000 |
about 0.45 points |
Intuition: The noise shrinks with n: four times as many questions only cuts the noise in half.
The null hypothesis: first assume no difference
Back to A and B: 71.2 and 70.5, each carrying about 1.4 points of noise. Drawn as bells, they overlap almost completely. So is a 0.7-point gap big or small? We need a way to decide.
Statistics works a bit like a courtroom: start by assuming the defendant is innocent, then ask whether the evidence is strong enough to knock that assumption down. Here, "innocent" is the null hypothesis, written H0: A and B are equally good, and the 0.7-point gap is pure luck.
A thought experiment
If the null hypothesis were true, what would the gap look like? Take two models that are exactly equally good, give each its own 1,000-question test, and record the difference in scores. Repeat that 200 times. The gap is sometimes positive, sometimes negative, and the results pile up into a bell centered on zero.
How wide is it? Each model brings its own share of noise, and the two combine, so the standard error of the gap is
1.44×2≈2.03
Now mark the gap we actually saw, 0.7. We have to count −0.7 as well, because B beating A by 0.7 would be just as extreme. Out of the 200 runs, 146 produced a gap at least that big, in one direction or the other:
- 146/200≈0.73;
- working it out directly with the normal distribution's formula gives the same 0.73.
That number is the p-value. Writing d for the score difference:
p=P(∣d∣≥0.7 H0)
The definition: the p-value is the probability, assuming the null hypothesis is true, of seeing data at least this extreme. So 0.73 means that even if A and B were exactly the same, more than 7 times out of 10 you'd see a gap this big or bigger. That 0.7-point gap isn't surprising at all.
How to read a p-value
What if the observed gap were bigger? On the bell curve under the null, the area of the two tails beyond the gap is the p-value:
| Observed gap |
p-value |
| 0.7 points |
about 0.73 |
| 2 points |
about 0.33 |
| 4 points |
about 0.05 |
The bigger the gap, the harder it is to stumble on in a world with no real difference, so the p-value shrinks and the null hypothesis does a worse job of explaining the data.
By convention, people use 0.05 as the threshold: if p<0.05, they call the result "statistically significant" and reject the null hypothesis. That threshold corresponds to a gap of about 1.96 standard errors, which here is nearly 4 points. A would have to beat B by about 4 points to count as significant. A gap of 0.7 is nowhere close.
Watch out: 0.05 is just a convention; there's nothing sacred about it. p=0.049 and p=0.051 are almost exactly the same strength of evidence.
Watch out: A large p-value does not show that A and B are equally good. It only says these data can't tell them apart. It's like a court ruling "not guilty, for lack of evidence", which isn't the same as proving the defendant innocent.
The t-test: signal divided by noise
Look back at that calculation. At its heart there's one ratio: the observed gap divided by its standard error. The top is the signal, the bottom is the noise, and the bigger the ratio, the less it looks like luck. Our 0.7/2.03 is only about 0.34.
A t-test runs on exactly this idea. It answers: do these continuous measurements have a different mean? In its most basic form, take the sample mean, subtract a reference value, and divide by the standard error:
t=s/nxˉ−μ0
Here xˉ is the sample mean, μ0 the reference value, s the sample standard deviation and n the sample size. Notice that s is itself estimated from the sample, and with a small sample that estimate can be off. So t doesn't follow a normal distribution; it follows the t-distribution, which has fatter tails. Its shape is set by the degrees of freedom, which for one sample is n−1. The bigger the sample, the closer the t-distribution gets to a normal.
There are three flavors of t-test:
- One-sample: is the mean of one group equal to some given value?
- Two-sample: do two groups have the same mean? For example, the losses from two training configurations.
- Paired: the same items measured twice. Is there a systematic difference? This is really a one-sample t-test in disguise, run on the per-item differences.
Watch out: The t-test assumes the data are roughly normally distributed. With a big enough sample, the mean is close to normal anyway, so this requirement can be relaxed.
Example: five random seeds
A question you'll meet all the time in training: does a new learning-rate setting lower the validation loss? Train the new and old configurations 5 times each, with 5 different random seeds:
- The new configuration's average loss is 2.304 and the old one's is 2.338, a gap of just 0.034.
- The gap looks tiny, but the 5 runs of each configuration vary from one another even less, so the standard error is tiny too.
Run a two-sample t-test (s1 and s2 are each group's sample standard deviation):
t=s12/5+s22/52.338−2.304=0.01340.034≈2.53
Look that up in the t-distribution and p≈0.036, below 0.05. With just 5 seeds each, the result is significant.
Intuition: What matters isn't how big the gap is in absolute terms, but how big it is compared to the noise.
Paired tests: same questions, shared luck cancels
Back to A and B. So far we've pretended each took its own separate test, but in reality they both answered the very same 1,000 questions. That matters a lot. Some questions are easy and both models get them right; some are hard and both get them wrong. Those questions tell us nothing about which model is better.
So record a difference for each question: +1 if A is right and B is wrong, −1 if A is wrong and B is right, and 0 if they agree. Then run a one-sample t-test on those differences to ask whether the average difference is zero. That's a paired test. The 1,000 questions sort into four groups:
|
B right |
B wrong |
| A right |
650 |
62 |
| A wrong |
55 |
233 |
- The average difference is still 0.7 points, but the standard error is only 1.08, roughly half of the 2.03 from before. The luck the two models share has canceled out.
- t≈0.65 and p≈0.52: still not significant. But this ruler is much more precise: an observed gap of more than about 2.1 points would now count as significant.
McNemar's test: only the questions they disagree on
For the setup where both models answer the same test and each answer is simply right or wrong, the go-to tool is McNemar's test, which compares two classifiers on the same dataset. It only looks at the questions where the two models disagree: the 62 and 55 in the table, 117 in all.
If the null hypothesis holds, each of those 117 questions is equally likely to go A's way or B's way, like flipping a coin 117 times. A wins 62, not far from the middle, 58.5. Adding up the outcomes at least that extreme (both tails) gives a probability of about 0.58.
In practice people usually use an approximation. With b and c the two disagreement counts:
χ2=b+c(b−c)2=117(62−55)2≈0.42
Looking that up gives p≈0.52. Both ways agree: nowhere near significant.
So, from these 1,000 questions alone, we can't say A is better than B. To tell them apart you'd need either more questions or a bigger gap.
Intuition: "Two models, the same test set, each answer right or wrong" is the most standard setup in evaluation, and McNemar's test is usually the best fit for it.
More than two groups: ANOVA
What if you want to compare more than two groups, say three learning rates with 5 random seeds each? A t-test on every pair is tedious, and it creates the multiple comparisons problem we'll get to later.
Analysis of variance, or ANOVA (also called an F-test), generalizes the t-test to more than two groups and answers in one go: does any of these k groups have a different mean? Its statistic is called F: the differences between the groups divided by the spread within each group. Just like t, it's signal divided by noise.
Here F≈23 and p<0.001: at least one group differs from the others. To find out which one, you'd need follow-up comparisons.
Beyond the mean: the KS test
A different question. Take the length of two models' answers. Both average around 300 tokens, and a t-test says there's no visible difference in the means. But you can see at a glance that they're different: one is very consistent, the other swings between long and short. A t-test only compares means, so it can't see a difference in shape.
The KS test (Kolmogorov-Smirnov test) compares whole distributions: were two groups of continuous observations drawn from the same underlying distribution?
- Draw each group as a cumulative distribution curve (CDF): length along the bottom, and up the side, the share of answers no longer than that.
- The biggest vertical gap between the two curves is the KS statistic, D.
Here D=0.4 and p<0.01: the two distributions really are different. What's more, the KS test doesn't require normally distributed data; it works for any continuous variable.
Categorical data: the chi-squared test
What if the data aren't continuous numbers but categories? Take 400 four-choice questions where the correct answer is A, B, C or D exactly 100 times each. Model X picks A a whopping 150 times, while model Y spreads its picks fairly evenly. Do the two have the same distribution of choices?
The chi-squared test asks whether two groups of a categorical variable come from the same distribution. It works like this:
- Work out how many we'd expect in each cell if the two groups had the same distribution: the expected counts E.
- For every cell, take the difference between the observed count O and the expected count, square it, divide by the expected count, and add it all up:
χ2=∑E(O−E)2
The bigger the mismatch, the bigger chi-squared gets. Here χ2≈16.3 with p≈0.001: model X clearly has a soft spot for answer A. That's a kind of position bias.
The "are the groups different?" toolbox
First ask what kind of data you have, then what question you want to answer:
| Data and question |
Test |
| One group, continuous: is the mean equal to some value? |
one-sample t-test |
| Two groups, continuous: same mean? |
two-sample t-test |
| Same items measured twice: systematic difference? |
paired t-test |
| Three or more groups, continuous: does any mean differ? |
ANOVA (F-test) |
| Two groups, continuous: same whole distribution? |
KS test |
| Two groups, categorical: same category distribution? |
chi-squared test |
| Two classifiers, same test set: which gets more right? |
McNemar's test |
If you're comparing two models' right and wrong answers on the same test set, remember the last row.
Are two variables related? Pearson correlation
Another common question: are two variables related? For example, when you use an LLM as a judge to score answers, do longer answers get higher scores? Each dot is one answer, with its length along the bottom and its score up the side, and there seems to be a slight trend toward the upper right. How do we turn that trend into a number?
Working it out by hand with four points
- Find the averages: x averages 2.5 and y averages 4. Draw a cross at the averages, splitting the plane into four regions.
- Multiply the deviations: for each point, find how far it is from the average in x and in y, and multiply the two. Points in the top-right and bottom-left regions give positive products; points in the top-left and bottom-right give negative ones. All four points sit in the positive regions, and the products add up to 7. The more positive this total, the more it holds that when x is big, y tends to be big too.
- Scale: divide by the square root of the two sums of squared deviations multiplied together. Here the sum for x is 5 and for y is 10:
r=5×107=7.077≈0.99
That's the Pearson correlation coefficient:
r=∑(xi−xˉ)2∑(yi−yˉ)2∑(xi−xˉ)(yi−yˉ)
The top is the sum of the deviation products; the bottom scales the result so it always lands between −1 and 1.
What different values of r look like
- Close to 1: the dots almost form a rising straight line.
- Around 0.5: there's a trend, but it's scattered.
- Close to 0: no straight-line pattern.
- Negative: when one goes up, the other goes down.
Intuition: Picture fitting a straight line through the scatterplot. r measures how tightly the dots hug that line.
Back to length and score: r≈0.53. Besides the coefficient r, the Pearson test also gives a p-value for whether r is significantly different from zero. Here p≈0.003: in this data, longer answers really do get higher scores from the judge. That's a well-known bias of LLM judges, sometimes called verbosity bias.
Pearson's blind spots: Spearman and mutual information
It only recognizes straight lines
Pearson has a blind spot: it only recognizes straight lines.
- A perfect parabola: y is completely determined by x, yet r is exactly zero. On balance, the points on the left pull r negative and the points on the right pull it positive, and the two cancel out exactly.
- A curve that keeps rising and gets steeper and steeper: it's monotonic, so whenever x is bigger, y is bigger too. But Pearson only gives 0.85, because the points don't lie on a straight line.
Watch out: An r=0 only means there's no linear relationship. It doesn't mean there's no relationship.
Spearman: switch to ranks first
Spearman's correlation takes a different approach: replace each variable's values with their ranks (the smallest gets rank 1, the next smallest rank 2, and so on), then compute Pearson on the ranks.
Switch to ranks and that ever-steeper curve falls exactly on a straight line, so Spearman equals 1. It only cares about order, not the actual values, so it measures monotonic relationships.
Looking only at order has another perk: outliers don't throw it off. Ten points rising neatly give both coefficients close to 1. Add a single outlier, and Pearson crashes to 0.09 while Spearman still holds at 0.5.
|
Pearson |
Spearman |
| Measures |
linear relationships |
monotonic relationships |
| Computed from |
raw values |
ranks |
| Outliers |
sensitive |
robust |
| Strength |
easier to interpret |
catches nonlinear monotonic trends |
Mutual information
If a relationship is neither a straight line nor monotonic, like that parabola, you can use mutual information. It captures any kind of dependence, nonlinear ones included, but it's more of a measure than a rigorous statistical test.
Misreading #1: p is not "the chance the null is true"
Finally, the three most common ways people misread p-values. Number one: reading p=0.03 as "there's only a 3% chance the null hypothesis is true".
A p-value is the probability of data this extreme, given that the null is true. The probability that the null is true, given the data, is a different thing. It runs in the opposite direction:
P(data∣H0) = P(H0∣data)
An analogy: if it's raining, the ground is almost certainly wet. But if the ground is wet, it didn't necessarily rain. Maybe the sprinklers were just on.
Putting numbers on it
Say you try out 200 ideas for improving your model, and only 20 of them actually work:
- For an idea that really works, the test has an 80% chance of catching it. That's the power of the test. So 16 of the 20 come out significant.
- Of the 180 useless ideas, 5% still come out significant at the 0.05 threshold by pure chance: that's 9.
- Pull out all the significant results: 25, of which 9 are false. That's 36%, nowhere near "only a 5% chance of being wrong".
Watch out: How much you can trust a significant result also depends on how many of your ideas really worked to begin with. The p-value on its own can't tell you that.
Misreading #2: significant doesn't mean important
Misreading number two: significant means important. In statistics, "significant" only means "probably not luck". It doesn't mean the gap is big.
- Suppose the test set had a million questions and A beat B by only 0.1 points. With a paired test, the p-value could drop as low as 0.003. Statistically significant, but in practice 0.1 points means almost nothing.
- Flip it around: with only a few questions, even a big gap might not be significant.
A p-value always depends on both the size of the gap and the size of the sample. A better habit is to report the gap itself together with its confidence interval: roughly, the range where the true gap probably lies.
- A and B differ by 0.7 points, and the 95% confidence interval is about [−1.4, 2.8]. It crosses zero, so the true gap could be positive or negative.
- In the million-question example, the interval is narrow and doesn't cross zero, but the whole thing is squeezed in around 0.1. You can see at a glance: significant, but tiny.
Misreading #3: multiple comparisons
Misreading number three comes from multiple comparisons. Suppose A and B are actually identical, and we run one test on each of 20 different benchmarks.
When the null is true, p-values are spread evenly between 0 and 1, so every test has a 5% chance of landing below 0.05 by luck. If the tests are independent, the chance that at least one of the 20 comes out significant is
1−0.9520≈64%
Say benchmark number 3 has a p-value of 0.037. It's "significant"! Report only that one, and you'll reach the wrong conclusion.
A simple fix is the Bonferroni correction: if you run m tests, divide the threshold by m. Here that's 0.05/20=0.0025, and the formerly "significant" result no longer is.
Watch out: By the same logic, tweaking an experiment over and over and stopping as soon as p<0.05 is a hidden form of multiple comparisons too.
Looking back on the journey
This is also the very last episode of the series, so here's the road we've traveled:
- Episode 0: a language model does just one thing, predicting the next token.
- Episodes 1–5: we built a neural network and saw how gradients, backpropagation and optimizers let it learn from data.
- Episodes 6–10: we opened up the Transformer (attention, position encoding, normalization) and did the accounting for parameters, compute and memory.
- Episodes 11–14: inference, with sampling, the KV cache, speculative decoding and FlashAttention making generation fast and good.
- Episodes 15–17: scale, with scaling laws, numerical precision and parallel training for building bigger models.
- Episodes 18–20: post-training, with policy gradients, PPO, RLHF, GRPO and DPO turning a text-continuer into an assistant.
- Episodes 21–22: beyond the Transformer, with recurrent networks and state space models, and multimodal models that can see.
- Episode 23: reading experimental numbers.
So the next time you see "71.2 versus 70.5", you'll ask one question first: is that gap bigger than the noise?
Recap
- A benchmark score is one sample of a model's true ability, so it carries sampling noise: SE=p(1−p)/n, about plus or minus 1.4 points for 1,000 questions. Four times as many questions only halves the noise.
- The p-value is the probability of data at least this extreme if the null hypothesis were true. The smaller it is, the harder luck is to blame. 0.05 is only a convention, and a large p-value doesn't mean the two are equally good.
- Nearly every test is signal divided by noise. Compare means with a t-test (one-sample, two-sample or paired), several groups with ANOVA, whole distributions with KS, categories with chi-squared, and two models' right/wrong answers on the same test set with McNemar's test, which only looks at disagreements. Pairing cancels shared luck and makes the ruler more precise.
- Correlation: Pearson measures linear relationships and is sensitive to outliers; Spearman measures monotonic relationships using only ranks and is robust to outliers; mutual information catches any dependence but isn't a rigorous test.
- Don't misread: a p-value isn't the probability the null is true; significant doesn't mean important, so report the gap and its confidence interval; and after many comparisons, correct the threshold (Bonferroni, for example).