Lion Cipher Lab

Tell a real eval win from noise: bootstrap a confidence interval and a paired McNemar test on a 50-item security eval, and find you can't ship the difference

Why it matters

Two models score 71% and 76% on your 50-item security eval and someone wants to ship the second one. The 5-point gap looks decisive and it is nothing. This lab builds the tools that show why, from Python's standard library and a planted answer key, so every claim is a number you generated rather than a chart you were handed. First the point scores: model A gets 36 of 50 and model B gets 38 of 50, a 4-point measured gap. Then a bootstrap - resample the 50 items with replacement 20000 times and read the percentiles - which puts each model's accuracy in an interval 24 points wide and puts the…

What you'll learn

Steps in this lab

  1. The words first: eval, accuracy, sampling noise, confidence interval, bootstrap, paired test, McNemar, power - and the fact that the two models here are planted vectors
  2. Open a terminal and make a scratch folder (all three operating systems)
  3. Build the 50-item eval and score two models on it (point accuracy first)
  4. Bootstrap a 95% confidence interval for each model - and for the difference
  5. The paired test done by hand: McNemar from the 2x2 table, and why the unpaired test is wrong
  6. The calculation that should have come first: power, minimum detectable effect, required n
  7. How to read an eval delta, and when a difference is actually worth a model swap

Open the full interactive lab →