SStatistics, Built

Stage V · PhD Research

Part 64 of 65

Statistics in the Age of AI

PhDstarts at this level64 min of film15 chaptersprerequisites: Part 34, Part 57, Part 58

When machines make the predictions, generate the data and grade each other, what does honest uncertainty look like?

A new model scores 85.2% on a thousand questions against 84.7% for the previous best. On a constructed table the paired 95% interval for the half point runs from -1.88 to 2.88 points, and in fresh benchmarks written under the same model the order reverses a third of the time. The part treats evaluation as estimation: questions that cluster need cluster-robust errors, two models on the same questions need a paired analysis and McNemar's test, an arena is a Bradley-Terry logistic regression, and item response theory picks anchor questions. Reusing a test set adaptively overfits it, and a noisy threshold limits the damage. Then the machines move into the data: labels from a judge are corrected by prediction-powered inference, and a Gaussian refitted to its own samples loses variance by a factor (n-1)/n each generation. It ends with conformal factuality, watermarks as hypothesis tests, simulation-based inference, Tweedie's formula inside diffusion models, experiments in a market with interference, and open problems. Every example is constructed arithmetic or seeded simulation; no real model is evaluated.

What you need. Prediction-powered inference from Part 34, conformal prediction from Part 57, sequential and adaptive analysis from Part 58; logistic regression and cluster-robust variances.

Hook
a leaderboard: 85.2% vs 84.7%
Mathematics
evaluation error bars, arenas and IRT, the reusable holdout, PPI with model labels, model collapse, conformal for LLMs, watermark tests, SBI
Built
statkit.evals

What you will be able to do

Bachelor's

  • Compute a benchmark score's standard error and say why two overlapping intervals do not answer which model is better.
  • Compare two models on the same questions with a paired interval and McNemar's test, using only the questions on which they disagree.

Master's

  • Fit a Bradley-Terry model as a logistic regression and say why only differences of strengths are identified.
  • Derive the expected variance ((n-1)/n)^t of a Gaussian refitted to its own samples, and show that it tends to zero almost surely.

PhD

  • State what prediction-powered inference assumes about the predictor and the two samples, and derive its variance.
  • Derive Tweedie's formula for a noised density and explain how an exact empirical score memorizes the training points.

Practice

  • Report a benchmark comparison with cluster-robust and paired standard errors, and count ties and reversals rather than announcing an order.
  • Recognize adaptive reuse of a test set, and interference between arms of an experiment on a deployed system.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Bachelor's 14 min · Master's 32 min · PhD 64 min · Practice 32 min.

  1. 0The leaderboardBachelor's4 min
  2. 1Benchmarks are samplesBachelor's4 min
  3. 2Paired comparisonsBachelor's4 min
  4. 3ArenasPractice5 min
  5. 4IRT for benchmarksPhD5 min
  6. 5Adaptive reuse of test setsPractice4 min
  7. 6Labels from modelsPractice5 min
  8. 7Synthetic data and model collapsePhD5 min
  9. 8Uncertainty for language modelsPhD4 min
  10. 9Watermarks as hypothesis testsPhD5 min
  11. 10Simulation-based inferencePhD4 min
  12. 11Generative models as density estimatorsPhD5 min
  13. 12Causal questions about AI deploymentsPractice4 min
  14. 13Open problemsPhD4 min
  15. Recap, problems, and the road aheadAll tracks2 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.

The leaderboardBachelor's4 min

A familiar announcement. A new model scores 85.2 percent on a benchmark, against 84.7 percent for the previous best: a new state of the art. The benchmark has a thousand questions. How much of the half point is the model, and how much is the particular thousand questions that happened to be written? This part answers that question, and its relatives, for a field that now runs on leaderboards. The opening table is explicitly constructed for illustration; the remaining examples are seeded simulations or exact calculations. None evaluates a real system.

Part eleven's error bars. A thousand yes-or-no questions at 85 percent give a standard error of about points, so each score is uncertain by about 2.2 points either way. The intervals overlap almost entirely. The better question is about the difference, on the same questions: half a point, with a paired ninety-five percent interval from to points. Only the questions the models disagree on carry information: that the new model got right and the old one wrong, and the other way. McNemar's test gives p of .

Another way to see it. Suppose the two models really are 85.2 and 84.7 percent accurate on the population of questions the benchmark samples. Write a fresh thousand independent questions under this same latent-probit joint model, and score both again. In simulated re-writings, the previous best comes out ahead percent of the time. A third of the time, the announcement would have gone the other way. A leaderboard is an estimate, and its order is a random variable.

And the benchmark is the easy case. Arenas rank models by people's votes between pairs of answers: a logistic regression, Part twenty-four's. Labels are increasingly produced by other models, which makes them measurements with error, Part forty-one's. Training data is increasingly produced by models too, which feeds a fitted distribution back into its own fit. And when a model is deployed, its users interact, Part sixty-two's interference. Every lesson of the degree has a new home.

The thesis of this part is modest. Machine learning's evaluations are statistical estimates, made from samples, often reused, sometimes graded by machines. The tools to report them honestly already exist: clustered standard errors, paired designs, sandwich intervals, prediction-powered inference, conformal guarantees, randomized designs. What is new is the scale, and a few genuinely new questions, such as what happens when a model learns from its own output.

The plan. Chapters one to five: benchmarks as samples, paired comparisons, arenas, item response theory, and the reuse of test sets. Chapters six to eight: labels from models, synthetic data and model collapse, and uncertainty for language models. Chapters nine to twelve: watermarks as tests, simulation-based inference, generative models as density estimators, and causal questions about deployments.

Two promises come due. Part eleven built intervals from independent observations, each used once; chapters one, two and five handle questions that cluster, models that share questions, and test sets used again and again. Part thirty-four treated a model's predictions as given data; chapters six and seven ask what happens when the labels, and then the training data, come from models.

1Benchmarks are samplesBachelor's4 min

What is a benchmark estimating? Imagine a population of questions: everything the benchmark's authors might have written, by the same process, on the same topics. The model's accuracy on that population is the quantity of interest; the benchmark's thousand questions are a sample from it, Part eight's setting. There is a second source of randomness, the model's own sampling when its temperature is above zero. Evan Miller's 2024 paper on error bars for evaluations treats both, and recommends averaging several answers per question to shrink the second.

If the questions are independent draws, Part six's central limit theorem does everything. The mean score is approximately normal, with standard error the standard deviation of the scores over the square root of n. For right-or-wrong questions that is the square root of p times one minus p over n: about 1.1 points at 85 percent and a thousand questions. Report it. The interval is plus or minus 1.96 of those, and a leaderboard without it is a list of point estimates.

But benchmark questions are rarely independent. Reading-comprehension benchmarks ask several questions about each passage; coding benchmarks test several cases of each problem; translated benchmarks ask the same question in many languages. A model that misunderstands a passage tends to miss all its questions together. The scores are correlated within clusters. Then the iid error bar is too small, and the fix is Part twenty-three's cluster-robust standard error: sum the residuals within each cluster before squaring.

A simulated benchmark: passages with questions each, and each passage with its own difficulty for the model. The iid standard error says points, and its ninety-five percent interval covers the true accuracy only percent of the time. The cluster-robust standard error is points, and covers percent. The empirical standard deviation of the score across simulated benchmarks is points: the clustered error bar was right, and the iid one was too small by forty percent.

How much do clusters cost? Part eighteen's design effect answers it. With clusters of size m and intraclass correlation rho, the variance is multiplied by one plus m minus one times rho. Here numerical integration of the logistic-normal design gives a variance ratio of , which implies an intraclass correlation of . So a thousand clustered questions are worth about independent ones. Ten questions per passage buys much less than ten passages.

In practice. Report an error bar with every score, and say how it was computed. Cluster on the unit that was sampled: the passage, the problem, the source document. If questions were written by a handful of annotators, the annotator is a cluster too. Bootstrapping is rarely needed for a mean; when it is, resample clusters, not questions, or the bootstrap inherits the iid mistake, as Part sixteen warned.

2Paired comparisonsBachelor's4 min

Paired comparisons, power, and the leaderboard's winner's curse. Two models answer the same questions, so their scores are not independent samples. Hard questions are hard for both. The variance of the difference in means is the sum of the two variances minus twice their covariance. The unpaired interval ignores the covariance. With positively correlated errors, here a correlation of between the two models' right-or-wrong scores, it is too wide. The paired interval works with the per-question differences directly: their standard deviation over root n. It is Part ten's paired t, and Part thirteen's blocking, with questions as blocks.

For right-or-wrong scores the paired test has a name. Classify each question: both right, both wrong, only A right, only B right. The questions both get right or both get wrong say nothing about which is better. Quinn McNemar's test, from 1947, uses only the discordant ones: under the null, each is equally likely to favour either model. So the count favouring A, out of the discordant total, is binomial with probability a half, an exact test of Part fourteen.

Power, Part ten's other half. Two models whose true accuracies are 86 and 84 percent, a two-point gap, with correlated errors, at several benchmark sizes. The unpaired test, in red, detects the gap percent of the time with a thousand questions. The paired test, in green, detects it percent of the time, and percent with two thousand. Pairing is free power. And even paired, a thousand-question benchmark usually cannot tell a two-point difference from noise. Plan the benchmark's size from the smallest difference worth detecting, as Part thirteen planned experiments.

Now many models. Suppose k models are all exactly 85 percent accurate, and all are scored on the same thousand questions, with independent errors. The top score is biased upward: by points with twenty models. A normal approximation gives the bias as the standard error times the expected maximum of k standard normals, which grows like the square root of two log k. It is Part fifty-six's winner's curse. A model at the top of a crowded leaderboard is likely to score lower on fresh questions, even if nothing about it was tuned to the benchmark.

Comparing many models requires a stated error criterion. Holm controls familywise false rejection for valid individual tests; BH instead controls false discovery rate under its dependence conditions and does not certify a selected best model. A confidence set for the best model can be formed from simultaneous pairwise contrast bounds, retaining every model that no other model demonstrably exceeds. Overlap of ordinary marginal intervals is only a descriptive screen and has no automatic simultaneous rank coverage. Confirm a selected winner on fresh questions or use justified selective inference. The confirmation target, question distribution and stopping rule should be fixed before looking.

3ArenasPractice5 min

Arenas: pairwise votes, and the Bradley-Terry model behind the ranking. Some things have no answer key: which of two essays is better written, which explanation is clearer. Wei-Lin Chiang and colleagues' Chatbot Arena, described in 2024, shows a visitor two anonymous models' answers to the visitor's own prompt, and records a vote. Millions of votes later, the models are ranked. The statistics are a century old: Ernst Zermelo in 1929, and Ralph Bradley and Milton Terry in 1952, for ranking chess players and taste tests from pairwise contests.

The Bradley-Terry model gives each model a strength theta. The probability that i beats j is the logistic function of theta i minus theta j. So each battle is a row of a logistic regression, with plus one in model i's column, minus one in model j's, and the vote as the outcome; one model is fixed at zero, because only differences are identified. Fit by maximum likelihood, Part twenty-four's IRLS, or Hunter's minorize-maximize algorithm from Part twenty-one. The Elo scale is the same thing, multiplied by four hundred over log ten.

Eight simulated models compete in six thousand independent battles from a connected Bradley-Terry model. Strengths are relative to model A. The blue intervals are marginal sandwich Wald intervals, not simultaneous bands. The reference model is fixed at zero by parametrization, rather than known with infinite precision in an absolute scale. White ticks show the generating relative strengths. A single realized table need not contain every tick in every interval. Gold highlights a separate asymptotic confidence set for rank one, computed using Bonferroni simultaneous pairwise contrasts and the full covariance matrix. A candidate remains if no competitor has a positive lower bound over it. This corrects the earlier interval-overlap heuristic; it is still a large-sample construction, not an exact finite-sample rank theorem.

Three ways to get the intervals. The inverse Fisher information, which trusts the model: for the top model, a standard error of . An independent-battle sandwich, robust to some variance misspecification but still requiring a well-defined target: . And the bootstrap over battles, . Here the model is true, and all three agree; over fresh arenas, the sandwich interval for the gap between the top two models covered percent of the time. In a real arena voters differ and prompts differ, the model is wrong, and dependence may require clustering by voter or prompt. An ordinary sandwich or bootstrap over individual battles alone does not repair that dependence or self-selection. Chatbot Arena reports both.

Why not Elo's online ratings, which chess uses? Elo updates after each game by a fixed step towards the surprise. Its ratings depend on the order in which the games were played. Feed the same six thousand battles in fifty random orders, and the resulting min-to-max Elo ranges, shown in red, describe ordering sensitivity. They are not confidence intervals and need not exceed every likelihood interval. For a fixed set of comparisons between models that do not change, the order carries no information, and the maximum-likelihood fit uses all of them at once. Chatbot Arena moved from online Elo to Bradley-Terry for this reason.

Votes measure preference, and preference mixes substance with style. In this simulation, model D writes longer answers, and voters prefer longer answers, whatever their quality. Plain Bradley-Terry puts D at , near the top, though its true strength is . Add the difference in length as a covariate, as Chatbot Arena's style control did in August 2024, and D's strength drops to , with the length effect estimated at against a true . It estimates a conditional equal-length comparison in this correctly specified simulation. Length is itself an output of the model, so adjusting it is not automatically causal confounder control, and it works only if length varies within each model's answers, so that it is not confused with the model itself.

Cautions an arena inherits from the degree. The voters are a self-selected sample, and their prompts are not a designed population: Part eighteen. Models that are tested many times privately before release, with only the best version shown, enjoy the winner's curse of chapter two. And the ranking answers one question, which answer this crowd prefers, not which model is more accurate or more helpful for a given use.

4IRT for benchmarksPhD5 min

Item response theory: benchmarks as tests, models as test-takers. Psychometrics met this problem a century ago, with students instead of models. Item response theory gives each test-taker an ability theta, and each question a difficulty b and a discrimination a. The chance of a right answer is the logistic function of a times the quantity theta minus b: Allan Birnbaum's two-parameter model, from 1968, a cousin of Part twenty-five's hierarchical models and of chapter three's Bradley-Terry, with the question as the opponent. Questions everyone gets right, or no one does, can have little information near the abilities being compared. Observing everyone correct does not prove the true item response probability is exactly one.

A simulated benchmark: questions and models, with abilities and item parameters drawn at random. Fit the model to the by table of right and wrong answers, a bounded penalized joint fit, initialized by alternating updates and checked for optimizer convergence. This nonconvex fit is not certified as a global maximum. A final affine normalization preserves all fitted response probabilities. The fitted abilities correlate with the true ones, and the difficulties . Discriminations are harder, a correlation of : sixty test-takers say little about how sharply each question separates them. Part twenty-two's information again: each item has only sixty observations.

The use: evaluating new simulated models cheaply, conditional on this one fitted item bank. Score three hundred new models on only a hundred of the thousand questions, and estimate each one's accuracy on all thousand. The plain mean of the hundred misses by points, root mean square. Estimating the model's ability from the same random hundred, with the fitted item parameters, and predicting its accuracy on all the items, misses by . Choosing the hundred to span the difficulties, the most discriminating question in each stratum, misses by : less error than the plain mean in this run, for the same cost. The target is each new model's realized full thousand-item score, including the sampled anchor responses, not an independent population accuracy or a confidence guarantee.

Why it works: Fisher information, item by item. An item's information about theta is a squared times p times one minus p, largest for discriminating items whose difficulty matches the ability. In this benchmark the hundred most informative items, for an average model, carry percent of the total information; percent of the items are answered correctly by more than ninety-five percent of models and carry almost none. Adaptive testing, choosing each next question where the current ability estimate is most uncertain, is Part fifty-eight's sequential design applied to exams, and it is how computerized tests like the GRE have worked for decades.

The same idea on real benchmarks. Felipe Maia Polo and colleagues' tinyBenchmarks, in 2024, fitted item response models to the published answers of hundreds of language models. They found that a hundred curated questions estimate a model's accuracy on the fourteen thousand of MMLU, a standard knowledge benchmark, with an average error under two points. The fitted abilities also show what a benchmark measures, and when a benchmark is saturated: when the best models' abilities sit beyond nearly every question's difficulty.

Two cautions. The model assumes one ability. Language models have many, and a model strong at code and weak at history breaks a one-dimensional scale; multidimensional item response theory, Part thirty-one's factor analysis with logistic links, is the remedy. And the item parameters were learned from past models. A new kind of model, unlike any in the calibration set, is Part sixty's distribution shift. Check the small-sample estimate against the full benchmark now and then.

5Adaptive reuse of test setsPractice4 min

A test set is meant to be used once. In practice, the same public test set is used to compare thousands of models, and each new model is designed knowing how the last one scored. Every decision informed by the test score is a query to the test set. After enough adaptive queries, the test score measures how well the field has fitted that particular test set, not the population. Part twenty-eight's model selection, at the scale of a research community. Cynthia Dwork, Vitaly Feldman, Moritz Hardt, Toniann Pitassi, Omer Reingold and Aaron Roth showed in 2015, in Science, that differential privacy is the tool that controls it.

An experiment inspired by their adaptive selection example, using Gaussian noise features here. features and labels of pure noise: no classifier can beat fifty percent on new data. The analyst computes each feature's correlation with the label on a training set of , asks the holdout set for the same correlations, keeps the features where the two agree in sign and are both large, and builds a classifier from the top k. Then reports the classifier's accuracy on the holdout. Each step is reasonable; together they reuse the holdout adaptively.

The truth is fifty percent. The reused holdout reports accuracies climbing with k, to percent: a discovery, apparently. On fresh data the same classifiers score fifty percent, as they must. The holdout had been fitted through the selection. Answer every query through the noisy-threshold heuristic instead, and the reported accuracies stay between and percent: in this small paired simulation. This is a descriptive comparison, not a Thresholdout implementation or a differential-privacy guarantee.

The formal Thresholdout algorithm uses bounded statistical queries, a persistent noisy threshold, noise in the comparison, noisy holdout answers and a finite budget of exceptional disclosures. Queries agreeing sufficiently with training return the training value; the private comparison itself must be accounted for. When a discrepancy triggers a holdout answer, the algorithm spends budget and refreshes its noisy threshold. When budget is exhausted it stops. Our simplified routine lacks those details and uses unbounded Gaussian correlations, so we label it a noisy-threshold heuristic. Strong enough differential privacy can imply quantitative adaptive generalization under specified sampling assumptions. It does not mean that arbitrary private analyses cannot overfit, or that every holdout automatically supports n squared queries. Query count, accuracy, confidence and exceptional-disclosure budget all enter the theorem.

Competitions have a simpler version. Avrim Blum and Moritz Hardt's Ladder, in 2015, updates a public leaderboard only when a submission beats the best so far by more than a set margin, and then rounds the score. Small improvements, which are mostly noise, are not reported, so the leaderboard leaks little about the test set. They showed that an attacker can climb an ordinary leaderboard with random submissions, by keeping those that happen to score well, and that the Ladder stops it.

The modern form of reuse is worse. Benchmarks are published on the web, and models are trained on the web, so test questions leak into training data. Detecting it is Part sixty-three's membership inference, asked of a benchmark: does the model treat these questions as familiar, more likely than rephrasings of them? Likelihood contrasts can also reflect ordinary differences in wording or difficulty; calibrated controls are needed before treating familiarity as proof of membership. Practical defenses include fresh, private test sets, written after the training data were collected, and rotated before they leak.

6Labels from modelsPractice5 min

Labels from models: judges with errors, and how to correct for them. Grading open-ended answers by hand is slow, so evaluations increasingly ask another model to grade: an LLM judge. A judge is a measurement instrument, Part forty-one's, with a sensitivity and a specificity: how often it passes a correct answer, and how often it fails a wrong one. Judges are known to prefer longer answers, answers in the first position, and answers that resemble their own. So a model's score according to a judge is a biased estimate of its score according to people.

A simulation. A model is truly right on percent of questions. A lenient judge passes percent of right answers and fails only percent of wrong ones. Its expected pass rate is the sensitivity times the truth plus one minus the specificity times the rest: percent, a bias of points. Five thousand judged answers make the judge's estimate very precise, and precisely wrong: its interval covers the truth percent of the time.

Prediction-powered inference corrects a fixed judge using human labels. In this experiment the labeled and unlabeled samples are independent draws from the same population, and the predictor is fixed independently of them. Add the judge's mean on the large unlabeled set to the average human-minus-judge residual on the small labeled set. The two expectation terms cancel predictor bias, and independent-sample variance adds. This mean estimate is unbiased under that design regardless of predictor quality. The displayed normal interval is asymptotic, and a poor predictor can increase width. If the predictor is fitted on these labels, cross-fitting or other analysis is required. Sampling shifts, incorrect label-inclusion weights or dependent samples can invalidate the simple formula.

Over simulations: the judge alone gives a tight interval around the wrong value, covering percent of the time. The human labels alone are unbiased, and wide: points. Prediction-powered inference uses both, covers percent of the time, and its interval, points, is percent narrower than the humans' alone. The judge's labels were worth something after all, once their bias was measured.

The same idea in regression. Social scientists now use language models to code documents, such as whether a speech is populist, and then regress the codes on covariates. Naoki Egami, Musashi Hinck, Brandon Stewart and Hanying Wei's design-based supervised learning, in 2023, has experts code a random subsample with known probabilities, and combines the expert and model codes in a doubly robust pseudo-outcome: Part thirty-six's AIPW, with the expert labels as the treatment. Valid coefficients and intervals, under the specified random-label design, positive known inclusion probabilities, appropriate weighting, predictor-fitting control and asymptotic variance conditions. Label observation is a missing-data indicator, not a causal treatment.

Two cautions. The human labels must be a random sample of the same answers; unweighted labels only from hard cases break this simple design. Deliberate unequal-probability labeling can be valid with positive known probabilities and suitable weighting. And the human labels themselves are measurements, with their own disagreement: the target is what a person would say, not the truth. When people disagree, report their agreement, for example by Jacob Cohen's kappa, and define the target rater or consensus process. Pairwise human agreement is not a universal accuracy ceiling: an aggregate judge can agree with a reliable consensus more than two noisy individual raters agree with one another.

7Synthetic data and model collapsePhD5 min

Models are now trained partly on text and images that earlier models produced. Ilia Shumailov and colleagues reported in Nature in 2024 that training generation after generation on the previous generation's output makes models forget: the tails of the distribution go first, and the output narrows towards a few typical modes. They called it model collapse. The phenomenon has a one-line statistical core, visible in the simplest model there is. Fit a normal distribution; sample from the fit; fit again.

Set the initial fitted Gaussian moments to mean zero and variance one, before the first recursive refit. This fixes the generation indexing. At each generation draw n independent points from the current Gaussian and fit their mean and maximum-likelihood variance. The next generation repeats that step, discarding earlier observations in the replacement experiment. The accumulation experiment instead retains a standardized initial sample with those same zero-and-one moments and appends all later draws. Under replacement, each variance update multiplies the previous variance by an independent chi-squared n-minus-one factor divided by n. Thus with variance one at time zero, the expectation after t refits is the displayed t-th power, without an extra unplotted initial shrinkage.

So the variance after t generations is a product of t independent factors. Its expectation is the product of their expectations, n minus one over n to the t. With n of , that is to the t: halving every generations. That is the bias of the maximum-likelihood variance, Part nine's divide by n, compounded. Dividing by n minus one would fix the mean, but not what comes next.

The typical path is worse than the mean. Take logs: the log variance is a sum of t independent terms, each the log of chi-squared over n, a random walk. Its step has a negative mean, for n of , by Jensen's inequality: the log of an average exceeds the average of the logs. Even with the unbiased divisor the drift stays negative. By Part six's strong law, the log variance goes to minus infinity almost surely, and the variance to zero. The mean decays slowly only because of rare paths that wander high.

The simulation, with draws per generation, on a log scale. Six lineages, and the middle eighty percent of four hundred: the variance falls by orders of magnitude; after three hundred generations the median is ten to the minus thirteen, and every lineage is below one percent of where it started. The exact mean, nineteen twentieths to the t, decays far more slowly: the mean is not the typical value. In green, a different practice: keep all earlier data, and add each generation's samples to the pool instead of replacing it. The accumulation paths lose far less variance here; this does not guarantee recovery of every population feature or every rare event.

This is a mechanism, not a universal theorem for every synthetic-data pipeline. Finite resamples can omit rare events, and repeated fitting can amplify omissions; the effect depends on the estimator, regularization, sample size and access to real data. In this fixed-size Gaussian replacement chain, variance tends to zero almost surely. At finite times it remains positive almost surely; convergence is not finite-time absorption. Other estimators and refreshed real data can behave differently. Our multiplicative calculation explains this toy exactly, while the cited empirical studies examine richer models under particular training recipes.

The cure follows from the toy. Matthias Gerstgrasser and colleagues showed in 2024 that if real data are kept and synthetic data are added to it, rather than replacing it, the error remains controlled under their specified accumulation models, because each new generation is a shrinking fraction of the pool, and the errors it adds form a convergent sum. Keep the real data, mark the synthetic, and weight towards the real. And measure: Part sixty's shift diagnostics, run between generations, catch a narrowing distribution early.

8Uncertainty for language modelsPhD4 min

Does a language model know when it is likely to be wrong? Saurav Kadavath and colleagues at Anthropic asked in 2022, and found that large models' probabilities on multiple-choice answers were well calibrated, in Part thirty-four's sense: among answers given seventy percent, about seventy percent were right. Models could also be trained to estimate the probability that their own free-form answer was correct. Calibration is measurable, with reliability diagrams and expected calibration error, and repairable, with Part thirty-four's temperature scaling.

Calibration can be lost. OpenAI's GPT-4 report showed the pretrained model well calibrated on a multiple-choice benchmark, and the model after training on human preferences less so. Preference optimization need not preserve the pretraining calibration objective. The reported plot is an empirical comparison, not proof that every preference-training method rewards confidence or worsens calibration. So calibration must be checked on the deployed model, not inherited from the base model, and checked within subgroups of questions, Part sixty-three's multicalibration.

A guarantee, rather than an estimate, comes from Part fifty-seven. Christopher Mohri and Tatsunori Hashimoto's conformal factuality, in 2024, splits each answer into claims, and scores each claim's confidence. On calibration answers whose claims have been checked, find for each answer the smallest threshold above which every kept claim is true: the score of its most confident false claim. Take Part fifty-seven's conformal quantile of those thresholds. Filtering a new answer to the claims above it gives an answer that is entirely true with probability at least one minus alpha, marginally over exchangeable complete responses and calibration data, with fixed scoring and reliable truth labels. It may keep no claims at all. It does not certify each individual answer or semantic truth when the checker is wrong.

A simulation: answers of claims, each true with probability , with confidence scores that are informative but noisy. Unfiltered, only percent of answers are entirely true. After conformal filtering, the fraction of entirely true answers tracks one minus alpha, the grey line: percent at alpha of a tenth. The price is in the gold line: at alpha of a tenth, only percent of claims survive. Factuality is bought with informativeness, and a better confidence score buys more of both.

Other conformal guarantees for generation. Victor Quach and colleagues' conformal language modeling, in 2024, keeps sampling answers until the set of samples contains an acceptable one with guaranteed probability, and prunes redundant ones. For multiple-choice questions, ordinary prediction sets from Part fifty-seven apply directly, and the set's size is a measure of the model's uncertainty. All of them inherit Part fifty-seven's fine print: the guarantee is marginal under its stated exchangeability and calibration design. A generic shift is not repaired merely by reusing old calibration; suitable new data or an explicit shift method is needed.

What remains hard. Checking claims is itself expensive, so the calibration set is small, and chapter six's judges are tempting; their errors then enter the guarantee. Claims can be dependent without breaking response-level conformal calibration. What matters is exchangeability of whole responses, a fixed decomposition/scoring pipeline and reliable labels. Splitting into claims can itself miss an assertion or alter meaning. And a guarantee over typical questions says little about the rare question that matters most, Part fifty-seven's conditional coverage problem, unsolved in general.

9Watermarks as hypothesis testsPhD5 min

Can text say which model wrote it? John Kirchenbauer and colleagues' watermark, in 2023: before generating each token, hash the previous token to split the vocabulary into a green list, a fraction gamma of it, and a red list. Add a bias delta to the green tokens' logits. For a uniform high-entropy next-token distribution, or the stated idealization that pre-bias green probability is gamma, this makes green probability with gamma of a quarter and delta of two, about percent of the time instead of twenty-five. When the model is certain, the bias barely matters, but quality preservation is an empirical question for this soft logit-bias scheme, not a consequence of entropy alone. Anyone with the hash key can count the green tokens.

Our idealized detector tests a proportion. Assume independent green indicators with null probability gamma. Then the green count is exactly binomial and the standardized z statistic is approximately normal for suitable sample sizes. A rule z greater than four has a length-dependent exact binomial tail. The Gaussian reference tail is about three in a hundred thousand, but short texts can differ substantially. A p-value is not the probability the author used AI, and base rates matter. Real keyed generation has context dependence, repeated contexts, key reuse and adversarial selection. Hashing alone does not prove independent indicators or a model-free binomial null for all human text. Calibrate the actual keyed detector and account for repetitions and scanning multiplicity.

The power under an ideal independent-token mixture, computed exactly from its binomial distribution, against the length of the text. If every token is one where the model was uncertain, forty tokens are detected percent of the time. In this toy each token independently belongs to an informative component with probability forty percent, and the remaining tokens have baseline green probability. This is not a theorem for arbitrary low-entropy text; under this mixture, it takes about a hundred and sixty tokens to reach percent. And if someone rewrites half the tokens, the signal halves: percent at forty tokens. Power, as always, is about the effect size and the sample size, here the green excess per token and the number of tokens.

Two statistical details. For short texts the normal approximation is poor: at ten tokens, the exact false-positive rate of the z greater than four rule is , more than ten times the nominal three in a hundred thousand. Use the exact binomial tail, Part fourteen's lesson. And repeated phrases break independence: repeated contexts can reuse a green list. Deduplicating repeated token pairs is one mitigation, rather than a universal independence proof. Scott Aaronson's scheme, and the distortion-free schemes that followed, use the key to drive the sampling itself, with non-distortion guarantees defined over the prescribed random key or sampling randomness. Conditional on a reused fixed key and repeated contexts, stronger independence claims need justification.

The adversary. Paraphrasing with another model rewrites most tokens and destroys most of the signal, as the red curve showed. Inserting the watermarked text into a longer human one dilutes it; a windowed test that scans for the most watermarked stretch recovers some power, at the price of multiple testing, Part thirty-three. No watermark survives an adversary who rewrites everything. The test is strong evidence when it fires and weak evidence when it does not: absence of a watermark proves nothing.

Watermarks are deployed. Sumanth Dathathri and colleagues at Google DeepMind described SynthID-Text in Nature in 2024: a tournament-sampling watermark running on Gemini's responses. In a live comparison over about twenty million responses, users' ratings of watermarked and unwatermarked answers were indistinguishable: an A/B test of Part thirteen, used to assess quality preservation on those feedback metrics. Failure to detect a difference does not by itself establish exact equivalence; the design, intervals and detectable effects matter. The authors note the same limit: rewriting the text weakens detection.

10Simulation-based inferencePhD4 min

Simulation-based inference, and posteriors that are too sure of themselves. Much of science now has a simulator instead of a likelihood: particle collisions, galaxy formation, epidemics, neurons. Given parameters, the simulator produces data; the probability of the data cannot be written down. Part twenty-seven's approximate Bayesian computation was the first answer: simulate, and keep the parameters whose output looks like the data. Neural networks gave a second: train a network on many simulated pairs to output the posterior directly, neural posterior estimation, which Kyle Cranmer, Johann Brehmer and Gilles Louppe surveyed in 2020.

The training objective is honest in principle. Draw theta from the prior and x from the simulator, and maximize the average log of q of theta given x. The expected objective is maximized by the true posterior: it is a proper scoring rule, Part twenty-four's log score, averaged over the prior predictive. But with a finite number of simulations and a flexible network, the fit can overfit, and an overfitted density estimator can be too narrow: it has learned the training simulations' noise as signal.

Joeri Hermans and colleagues checked, in 2022, under the title A Trust Crisis in Simulation-Based Inference? Across benchmark problems and methods, many posterior approximations were overconfident: their ninety percent credible regions contained the true parameter less than ninety percent of the time. They recommended checking coverage routinely, and preferring conservative methods, such as ensembles of estimators. Coverage is checkable because the simulator is available: simulate new pairs, and see how often the credible region contains the parameter that generated the data.

A toy version, where the truth is known. Theta is standard normal, and the data are ten draws from a normal with mean theta; the true posterior is normal, with a simple formula. The approximation: regress theta on an eighth-degree polynomial of the sample mean, fitted on N simulations, and report a normal posterior with the regression's prediction as its mean and its residual variance as its variance. Two versions: the residual variance measured on the training simulations, and on a second, held-out set.

Coverage of the ninety percent credible interval, against the number of training simulations, over fresh parameters and data. With the in-sample residual variance, the posterior is overconfident when simulations are scarce: percent coverage with simulations. With the variance measured on held-out simulations, coverage is percent: above nominal in this experiment. Both versions now share the same fitted mean and test draws; only the residual-variance sample differs. Held-out RMS residuals do not guarantee a calibrated conditional posterior or conservative coverage in every problem. Both converge to ninety percent as the simulations grow. This toy isolates one training-error mechanism; it does not explain every failure in the cited SBI study. Coverage here averages over the prior predictive, rather than being guaranteed at each fixed parameter.

The general check is Part twenty-six's simulation-based calibration. Draw theta from the prior, simulate x, compute the approximate posterior, and record the rank of the true theta among posterior draws. Correct posterior draws give uniform ranks under the SBC experiment. U shapes, humps and slopes can suggest spread or bias errors, but do not uniquely diagnose them. Uniform ranks are necessary and not sufficient: returning the prior while ignoring data can also pass basic SBC. And when the simulator itself is wrong about the world, no calibration on simulations can reveal it: Part twenty-eight's model checking against real data is still required.

11Generative models as density estimatorsPhD5 min

Generative models are density estimators: Tweedie's formula inside diffusion. A diffusion model generates images by starting from noise and removing it step by step. Forward: add Gaussian noise to a data point, more and more, until nothing of it is left. Backward: learn to undo a little noise at each level, and run the chain in reverse. Everything the model learns is one function, the score: the gradient of the log density of the noised data at each noise level. A generative model is a density estimator, Part twenty-nine's subject, in disguise.

The link to statistics is Part twenty-five's Tweedie formula. If y is x plus normal noise of variance sigma squared, the posterior mean of x given y is y plus sigma squared times the score of y's marginal density. So learning the score is learning the Bayes denoiser, and the training loss, denoising score matching, is the mean squared error of a denoiser, Part forty-five's Bayes risk. Robbins's empirical Bayes estimated the same quantity from data in 1956, in the empirical-Bayes estimation tradition. Robbins's 1956 work was not the later baseball-data example.

The data: a mixture of two normal clusters, centred at minus two and one and a half. Observe a point with noise of standard deviation one. The grey diagonal would trust the observation. Tweedie's denoiser, in green, pulls each observation towards the cluster it probably came from, with a steep switch in between: shrinkage, Part twenty-five's, towards a learned prior. A diffusion model learns this curve at every noise level.

Probability flow uses the score of the noised marginal density. Exact transport requires starting from that same noised law. Here each sampler starts from its exact Gaussian-mixture marginal at sigma eight, using common component uniforms and normal draws, rather than replacing that marginal by a centered wide Gaussian. Integrate dx over d sigma equal to minus sigma times the score down a decreasing grid. The comparison uses Heun integration on four hundred noise levels and checks its change against a two-hundred-level grid. The endpoint is sigma .01, not zero, so even the empirical-score sampler ends near the training points with residual noise. Finite grid error and positive endpoint noise make these approximate samples. Arbitrary estimated scores at different noise levels need not correspond to one internally consistent density family.

Now the statistical puzzle. With n training points, the score that minimizes the training loss exactly is the score of the empirical distribution, noised: a mixture of n tiny normals centred on the training points. Sampling with it reproduces the training points. The optimal model, on the training data, is a lookup table: memorization. Architecture, optimization, stopping and data can regularize real diffusion models, while large networks may still memorize. Explicit smoothness in this toy acts as a bandwidth, Part twenty-nine's kernel smoothing, applied implicitly.

Twenty training points from the two-cluster density, in white. Samples from the probability flow with the exact empirical score land on the training points: the median distance from a sample to the nearest training point is . The small positive endpoint noise leaves narrow neighborhoods of training points; this is approximate reproduction rather than exactly identical atoms. Smooth the empirical score, here by giving each training point a little spread of its own, and the samples spread out: a median distance of , compared with the true-law sampler's . Similar nearest-point distance is not evidence of correct density or full generalization. The density plot and this diagnostic show only this one-dimensional example.

What the theory says. Kazusato Oko, Shunta Akiyama and Taiji Suzuki proved in 2023 that diffusion models with suitably chosen networks estimate a smooth density at nearly minimax rates, up to stated logarithmic factors, in total variation and Wasserstein-one for specified Besov smoothness classes, suitable networks, loss minimization and sampling conditions. This is not a guarantee for arbitrary trained networks or data distributions. Fitted to an unrestricted class instead, they memorize, as the red curve showed. So generative modelling inherits density estimation's whole theory: the curse of dimensionality, unless the data lie near a low-dimensional set; and the bandwidth choice, now hidden inside the network and its training.

12Causal questions about AI deploymentsPractice4 min

Benchmarks measure a model in isolation. The questions people care about are causal. Does deploying the assistant make programmers more productive? Do students who use it learn more, or less? Does a new recommender increase sales, or move them from one seller to another? These are Part thirty-five's potential outcomes, and randomized experiments answer them, when they are run. Two complications from Part sixty-two come with them: users interact, and the outcomes that matter take a long time to observe.

Interference in a marketplace, simulated. buyers and items. Each buyer wants an item with probability ; a new recommender raises that by half. When more buyers want items than there are items, the items go to wanting buyers by weighted random sampling, proportional to their treatment-specific demand weights. Supply binds: the recommender cannot create items, only decide who gets them. Run an ordinary A/B test, half the buyers treated, and compare purchase rates.

Over three hundred simulated tests, the A/B comparison says the recommender raises purchases by points. But treated buyers win items that control buyers would otherwise have bought: the control group is harmed by the treatment group, a spillover. The effect of switching everyone on, against everyone off, is points: supply caps it. The A/B test overstated it more than fourfold. Randomize whole markets instead, separate ones, half fully treated, and the estimate is points, targeting the same global intervention contrast because each of the twenty independent markets has the same buyer count and supply as the original market. The bars show plus or minus 1.96 repeated-experiment standard deviations, not confidence intervals for the Monte Carlo means. Twenty markets here involve eighty thousand buyers, compared with four thousand in the single-market A/B experiment, so their precision is not a fixed-budget design comparison. Valid inference would use its own assignment design and market-level variance. Part sixty-two's cluster design, and its price.

The designs that handle it. Cluster randomization by market, city or school, Part thirteen. Switchback experiments, which alternate a whole market between treatment and control over time, a crossover design, used by ride-hailing and delivery platforms. And two-sided randomization, of both buyers and sellers, whose combinations let the spillover itself be estimated, as Ramesh Johari and colleagues analysed in 2022.

Long-term effects create another measurement problem. Whether students learn more may be visible only much later; homework scores and engagement are faster but can change meaning when an assistant is introduced. A surrogate index learned from older data needs conditional-mean comparability across samples and an appropriate surrogacy condition, together with the relevant causal design, overlap and estimation assumptions. A graph with no bypass is not a complete substitute for those conditions. An assistant could raise homework scores by writing the answers while learning stays unchanged. That can invalidate the older conditional outcome mapping. Short-term metric gains alone do not identify long-term benefits.

And when no experiment was run. People who choose to use an assistant differ from those who do not, so comparing them is Part thirty-six's confounded comparison. The staggered rollout of a tool across teams or countries is Part thirty-seven's difference in differences, with its modern estimators for staggered adoption. The statistics of AI deployment is the statistics of policy evaluation: the same designs, the same assumptions, stated as clearly.

13Open problemsPhD4 min

Open problems for statistics in the age of AI. The part in one table: each claim made about AI systems, the old statistical tool that checks it, and what is new about the setting. A model's accuracy is a mean with a standard error, clustered. A comparison is a paired test. A leaderboard's order is a Bradley-Terry fit, with crowds, style and selection to account for. A cheap estimate is item response theory. A clean test score needs a holdout protected from reuse and leakage. A judged score needs a few human labels to rectify it. Training data fitted to models must keep its anchor in real data. A trustworthy answer is a conformal set of claims. Authorship is a binomial test. A posterior from a simulator needs its coverage checked. And an effect on people needs a randomized design that respects how people interact.

Problem one: what benchmarks measure. A benchmark score is used as evidence of reasoning, or coding ability, or knowledge: a latent construct, in Part forty-one's and psychometrics' language. Whether a score measures its construct, and nothing else, is the question of construct validity, which educational testing spent a century on, and which model evaluation has barely begun. IRT and other measurement models already address parts of this question. Validating and transporting constructs across changing model families and uses remains an active research problem.

Problem two: benchmarks that outlive their usefulness. Models now saturate a new benchmark within a year or two, and test questions leak into training data. Dynamic benchmarks, refreshed continually, can reduce leakage while complicating comparability across time: Part seventeen's problem of a changing measuring instrument. Designs for evaluation that stay comparable as the questions change, with linking and equating from testing, and that resist contamination, are open.

Problem three: evaluating agents. A model that acts over many steps, using tools and a computer, produces long trajectories whose outcomes are noisy and expensive: each episode can take hours. The relevant statistics are Part fifty-eight's sequential designs and Part sixty-two's off-policy evaluation: few, costly, highly variable episodes, and the wish to stop early. Variance reduction, anytime-valid comparisons and honest error bars for long-horizon agent evaluations are open.

Problem four: statistics with models in every loop. Models label the data, generate the data, judge the outputs, and are trained on the judgements: chapter six, chapter seven and chapter three at once. Each step's errors can be correlated with the next step's, which can break the sampling and conditional-mean assumptions used by a simple analysis. Prediction-powered inference permits predictor errors correlated with outcomes; the issue is uncontrolled fitting dependence, selection or shift, not any correlation of errors. Inference that remains valid when the measuring instruments are themselves trained on what they measure is open.

Problem five: guarantees for this question. The conformal and coverage demonstrations average over their specified sampling experiments. Other guarantees, such as fixed-model testing bounds, condition on different objects; not every guarantee in this part is the same kind of marginal statement. A person relying on one answer wants a conditional statement, about their question, which Part fifty-seven proved impossible without assumptions, in general. Which useful conditional guarantees are achievable for generative models, over which classes of questions, and at what price in informativeness, is open.

Five open problems. Construct validity for model evaluations. Benchmarks that stay comparable and clean. Evaluating agents. Inference with models in every loop. And conditional guarantees for generation.

Recap, problems, and the road aheadAll tracks2 min

Part sixty-four in fourteen lines. A half-point lead reversed a third of the time on a fresh benchmark. Clustered questions need clustered error bars. Models on the same questions need paired comparisons, and crowded leaderboards inflate the winner. Arenas are Bradley-Terry regressions, with explicit equal-style conditional comparisons. Item response theory makes small benchmarks informative. A reused holdout reported sixty-four percent for a coin flip. A few human labels rectify a biased judge. The fixed-size Gaussian replacement chain collapses; synthetic-data pipelines need their own analysis. Conformal filtering gives marginal all-kept-claims coverage under reliable labels and exchangeable responses, sometimes by keeping no claims. Watermarks are binomial tests. Simulators' posteriors need their coverage checked. The exact empirical score memorizes. And marketplaces need randomized markets, not randomized buyers.

A promise for the last part. Every part so far applied methods to questions and data that someone else had posed and collected. It assumed the question, the data and even the answer's form were given. Part sixty-five asks how new statistical knowledge is made: a question chosen, a conjecture, a proof, a protocol-guided simulation, a real application, and an honest report.

Where it comes back. In Part sixty-five: a simulation study with an explicit protocol, reported whatever it shows; the full Coverage Board, every promise of the degree tested; and an open problem from these last parts, attacked as a dissertation.

Six problems, with full solutions in the README. The cluster-robust standard error with singleton clusters; the paired variance and McNemar's statistic; the concavity of the Bradley-Terry likelihood; the Gaussian's collapse; the unbiasedness of prediction-powered inference; and Tweedie's formula. Pause here if you want to try them.

The books behind this part: Barocas, Hardt and Narayanan; Frederic Lord's item response theory; and Dwork and Roth; with the papers from Miller's error bars to the minimax rates of diffusion models.

Sixty-four parts of sixty-five. A half-point lead on a leaderboard is a statistical claim, and every lesson of the degree applies to it. Next, the last part: the dissertation.

Where it goes next. The weighted conformal intervals and the open problem of conditional guarantees pass to the dissertation of Part 65, and the benchmark rows join its full Coverage Board.

Key results

The part's results in one place, for revision.

The cluster-robust standard error (CR1)\(\displaystyle \widehat{\mathrm{SE}}^2=\frac{G}{G-1}\cdot\frac{1}{n^2}\sum_{c=1}^{G}\Bigl(\sum_{i\in c}(x_i-\bar x)\Bigr)^2\)
The paired variance\(\displaystyle \operatorname{Var}(\bar a-\bar b)=\frac{\sigma_a^2+\sigma_b^2-2\sigma_{ab}}{n},\qquad\allowbreak \bar a-\bar b=\frac{n_{10}-n_{01}}{n}\)
Bradley-Terry\(\displaystyle P(i\text{ beats }j)=\frac{1}{1+e^{-(\theta_i-\theta_j)}}\)
Prediction-powered inference for a mean\(\displaystyle \hat\theta=\frac1N\sum_{i=1}^{N}f(\tilde x_i)+\frac1n\sum_{i=1}^{n}\bigl(y_i-f(x_i)\bigr),\qquad\allowbreak \operatorname{Var}\hat\theta=\frac{\operatorname{Var}f}{N}+\frac{\operatorname{Var}(y-f)}{n}\)
The Gaussian's collapse\(\displaystyle \operatorname{E}\hat\sigma_t^2=\Bigl(\frac{n-1}{n}\Bigr)^{t},\qquad\allowbreak \hat\sigma_t^2\to 0\ \text{almost }\allowbreak \text{surely}\)
Tweedie's formula\(\displaystyle \operatorname{E}[x\mid y]=y+\sigma^2\,\nabla\log p_\sigma(y),\qquad\allowbreak y=x+N(0,\sigma^2)\)

Try it

Lab 64 · Benchmarks are samples; a model fed its own output forgets

Write 1,500 benchmarks of 200 passages with 10 questions each, and compare the coverage of the usual standard error with the cluster-robust one. Then fit a normal law to 20 draws, sample 20 new draws from the fit, refit, and repeat: after t refits the expected variance should be ((n - 1)/n)^t.

Figure produced by Lab 64: Benchmarks are samples; a model fed its own output forgets
Produced by the lab below, seed 0, in 0.5 s.
python -m videos.stats.labs 64 needs numpy, scipy, matplotlib · download lab64.py · source on GitHub
population accuracy (baseline 0.8 on the logit scale)  0.7613   mean score 0.7611
sd of the score across benchmarks                      0.0141   iid SE 0.0095   cluster SE 0.0144
design effect 1 + (m - 1) ICC                          2.30   (cluster SE / iid SE)^2 = 2.30
95% interval covers the population accuracy            iid 79.9%   cluster-robust 94.9%
mean fitted variance after 10 refits                   0.574   (theory (19/20)^10 = 0.599)
drift of log variance per refit                        -0.1057   (theory E log(chi2_19 / 20) = -0.1048)
runs with variance below 0.01 after 60 refits          78%

Questions that share a passage carry less information than their number suggests, and each refit to one's own samples loses a little variance that is never given back.
The code (83 lines; it asserts its own result)
"""Lab 64: put honest error bars on a clustered benchmark, then refit a Gaussian to its own samples."""

import math

import numpy as np

from videos.coursekit import labs
from explainer.stats.kit import evals

TITLE = "Benchmarks are samples; a model fed its own output forgets"
GOAL = ("Write 1,500 benchmarks of 200 passages with 10 questions each, and compare the coverage of the usual "
        "standard error with the cluster-robust one. Then fit a normal law to 20 draws, sample 20 new draws from "
        "the fit, refit, and repeat: after t refits the expected variance should be ((n - 1)/n)^t.")
TASKS = [
    "Set the passage effect tau to 0. What are the design effect and the two coverages now?",
    "Score a second model on the same questions with evals.correlated_pair and compare evals.paired_compare's "
    "paired and unpaired intervals for the difference.",
    "Call evals.gaussian_collapse with accumulate=True, so each refit keeps all earlier samples. Does the variance "
    "still drift to zero?",
]


def run(seed=0):
    rng = np.random.default_rng(seed)
    lab = labs.Lab()

    # 1. a clustered benchmark: 200 passages of 10 questions, a random passage effect on the logit scale
    G, m, base, tau, reps = 200, 10, 0.8, 1.0, 1500
    z, w = np.polynomial.hermite_e.hermegauss(80)
    pz = 1 / (1 + np.exp(-(math.log(base / (1 - base)) + tau * z)))
    truth = float(w @ pz / w.sum())  # the population accuracy, by quadrature
    icc = float((w @ pz ** 2 / w.sum() - truth ** 2) / (truth * (1 - truth)))
    deff = evals.design_effect(m, icc)
    score, se_i, se_c = np.zeros(reps), np.zeros(reps), np.zeros(reps)
    for r in range(reps):
        b = evals.clustered_benchmark(G, m, base, tau, rng)
        score[r], se_i[r] = evals.mean_se(b["x"])["mean"], evals.mean_se(b["x"])["se"]
        se_c[r] = evals.cluster_se(b["x"], b["cluster"])["se"]
    cov_i = float(np.mean(np.abs(score - truth) <= 1.96 * se_i))
    cov_c = float(np.mean(np.abs(score - truth) <= 1.96 * se_c))
    lab.row("population accuracy (baseline 0.8 on the logit scale)", f"{truth:.4f}   mean score {score.mean():.4f}")
    lab.row("sd of the score across benchmarks", f"{score.std(ddof=1):.4f}   iid SE {se_i.mean():.4f}   cluster SE {se_c.mean():.4f}")
    lab.row("design effect 1 + (m - 1) ICC", f"{deff:.2f}   (cluster SE / iid SE)^2 = {np.mean(se_c ** 2) / np.mean(se_i ** 2):.2f}")
    lab.row("95% interval covers the population accuracy", f"iid {cov_i:.1%}   cluster-robust {cov_c:.1%}")
    assert abs(score.mean() - truth) < 0.003, "the score is unbiased for the population accuracy"
    assert abs(np.mean(se_c ** 2) / np.mean(se_i ** 2) / deff - 1) < 0.1, "CR1 recovers the design effect"
    assert cov_i < 0.85 and abs(cov_c - 0.95) < 0.025, "only the cluster-robust interval keeps its promise"

    # 2. model collapse: a Gaussian refitted to n of its own samples, generation after generation
    n, T, runs = 20, 60, 400
    col = evals.gaussian_collapse(n, T, runs, rng)
    # the kit's path at index t is the variance after t refits to the model's own samples (index 0 is the start, 1)
    paths, fits = col["paths"][:, 1:], np.arange(1, T + 1)
    theory = col["expected"][1:]
    drift = float(np.mean(np.log(paths[:, -1])) / fits[-1])
    lab.row("mean fitted variance after 10 refits", f"{paths[:, 9].mean():.3f}   (theory (19/20)^10 = {theory[9]:.3f})")
    lab.row("drift of log variance per refit", f"{drift:.4f}   (theory E log(chi2_19 / 20) = {col['drift']:.4f})")
    lab.row(f"runs with variance below 0.01 after {fits[-1]} refits", f"{np.mean(paths[:, -1] < 0.01):.0%}")
    assert fits[9] == 10 and abs(theory[9] - (19 / 20) ** 10) < 1e-12 and abs(paths[:, 9].mean() / theory[9] - 1) < 0.25, "the mean variance follows ((n - 1)/n)^t"
    assert abs(drift - col["drift"]) < 0.006 and col["drift"] < math.log(19 / 20), "the log variance drifts down, faster than the mean"
    lab.note = ("Questions that share a passage carry less information than their number suggests, and each refit to "
                "one's own samples loses a little variance that is never given back.")

    fig, ax = labs.figure(2, size=(11, 4.2))
    grid = np.linspace(truth - 0.09, truth + 0.09, 200)
    ax[0].hist(score, bins=45, density=True, color=labs.BLUE, alpha=0.6, label=f"{reps:,} benchmark scores")
    for se, color, name in ((se_i.mean(), labs.RED, "iid SE"), (se_c.mean(), labs.GREEN, "cluster-robust SE")):
        ax[0].plot(grid, np.exp(-0.5 * ((grid - truth) / se) ** 2) / (se * math.sqrt(2 * math.pi)), color=color,
                   label=f"normal with the {name}")
    ax[0].set(title="2,000 questions in 200 passages: which SE matches?", xlabel="benchmark accuracy", ylabel="density")
    ax[0].legend()
    t = fits
    for path in paths[:25]:
        ax[1].plot(t, path, color=labs.GREY, lw=0.7, alpha=0.5)
    ax[1].plot([], [], color=labs.GREY, lw=0.7, label="25 single runs")
    ax[1].plot(t, paths.mean(0), color=labs.BLUE, label=f"mean of {runs} runs")
    ax[1].plot(t, theory, color=labs.GOLD, ls="--", label="((n - 1)/n)^t")
    ax[1].plot(t, np.exp(col["drift"] * t), color=labs.RED, ls=":", label="typical run: exp(t E log(chi2/n))")
    ax[1].set(yscale="log", title="A Gaussian refitted to 20 of its own samples", xlabel="number of refits t to its own samples",
              ylabel="fitted variance (log scale)")
    ax[1].legend(loc="lower left")
    lab.fig = fig
    return lab

Now change it

  1. Set the passage effect tau to 0. What are the design effect and the two coverages now?
  2. Score a second model on the same questions with evals.correlated_pair and compare evals.paired_compare's paired and unpaired intervals for the difference.
  3. Call evals.gaussian_collapse with accumulate=True, so each refit keeps all earlier samples. Does the variance still drift to zero?

Problems, with solutions

Try each problem before opening its solution.

  1. CR1 with singleton clusters. Show that with singleton clusters the CR1 standard error equals the iid standard error \(s/\sqrt{n}\).

    Solution
    • With G = n clusters of one, the cluster sums are the residuals rᵢ.
    • So SE² = n/(n − 1) · Σrᵢ²/n² = Σrᵢ²/(n(n − 1)) = s²/n.
  2. The paired variance and McNemar. For two 0/1 score vectors, show \(\mathrm{Var}(\bar a - \bar b) = (\sigma_a^2 + \sigma_b^2 - 2\sigma_{ab})/n\) and that McNemar's statistic depends only on \(n_{10}, n_{01}\).

    Solution
    • ā − b̄ is the mean of dᵢ = aᵢ − bᵢ, so its variance is Var(d)/n = (σ_a² + σ_b² − 2σ_ab)/n.
    • dᵢ is 1, −1 or 0, so Σdᵢ = n₁₀ − n₀₁. Conditioning on the n₁₀ + n₀₁ discordant questions, each is equally likely to be +1 or −1 under the null, so the test uses only n₁₀ and n₀₁.
  3. Bradley–Terry. Show that the Bradley–Terry log-likelihood is concave in \(\theta\), and that only differences \(\theta_i - \theta_j\) are identified.

    Solution
    • The log-likelihood is Σ[yₖ xₖ·θ − log(1 + e^{xₖ·θ})] with xₖ = e_i − e_j. Its Hessian is −Σ pₖ(1 − pₖ)xₖxₖᵀ, which is negative semidefinite, so it is concave.
    • Each xₖ sums to zero, so adding c to every θ leaves every xₖ·θ unchanged: only differences are identified.
  4. The Gaussian's collapse. Show that \(E[\hat\sigma_t^2] = ((n - 1)/n)^t\) for Gaussian recursive refits starting with fitted variance one, and that \(\hat\sigma_t^2 \to 0\) a.s.

    Solution
    • Starting from fitted variance σ̂²₀=1, σ̂²ₜ = Π_{s ≤ t} χ²_{n−1,s}/n with independent factors, so E σ̂²ₜ = ((n − 1)/n)ᵗ.
    • log σ̂²ₜ / t → E log(χ²_{n−1}/n) by the strong law. By Jensen, that is below log((n − 1)/n) < 0, so log σ̂²ₜ → −∞ and σ̂²ₜ → 0 almost surely.
  5. Prediction-powered inference. Show that the prediction-powered mean \(\bar f_N + \overline{(y - f)}_n\) is unbiased for any judge \(f\), and find its variance.

    Solution
    • E f̄_N = E f and E(y − f)‾ₙ = E y − E f, so the sum has expectation E y for a fixed predictor independent of the labeled/unlabeled samples, from a common target population. A predictor trained on these labels needs fitting-dependence control such as cross-fitting.
    • The two averages are over independent samples, so the variance is Var(f)/N + Var(y − f)/n.
  6. Tweedie. Derive Tweedie's formula \(E[x \mid y] = y + \sigma^2 \nabla \log p_\sigma(y)\) for \(y = x + \sigma Z\).

    Solution
    • p_σ(y) = ∫ φ_σ(y − x)p(x)dx. Differentiating under the integral, ∇p_σ(y) = ∫ (x − y)/σ² · φ_σ(y − x)p(x)dx.
    • Dividing by p_σ(y) gives ∇log p_σ(y) = (E[x | y] − y)/σ². Rearranging gives the formula.

Notes and sources

Sources

  • Benchmarks and pairs. E. Miller, "Adding Error Bars to Evals", arXiv:2411.00640 (2024); Q. McNemar, Psychometrika 12 (1947); L. Kish, Survey Sampling (1965).
  • Arenas.
    • E. Zermelo, Math. Z. 29 (1929); R. Bradley & M. Terry, Biometrika 39 (1952); D. Hunter, Ann. Statist. 32 (2004);
    • W.-L. Chiang et al., "Chatbot Arena", ICML (2024); LMSYS, "Does style matter? Disentangling style and substance in Chatbot Arena" (28 August 2024).
  • IRT. A. Birnbaum, in Lord & Novick, Statistical Theories of Mental Test Scores (1968); F. Lord (1980); F. Maia Polo et al., "tinyBenchmarks", ICML (2024).
  • Holdouts. C. Dwork, V. Feldman, M. Hardt, T. Pitassi, O. Reingold & A. Roth, Science 349 (2015); A. Blum & M. Hardt, ICML (2015).
  • Labels from models. A. Angelopoulos, S. Bates, C. Fannjiang, M. Jordan & T. Zrnic, Science 382 (2023); N. Egami, M. Hinck, B. Stewart & H. Wei, NeurIPS (2023); J. Cohen, Educ. Psychol. Meas. 20 (1960).
  • Collapse. I. Shumailov et al., Nature 631 (2024); M. Gerstgrasser et al., "Is model collapse inevitable?" (2024).
  • Uncertainty.
    • S. Kadavath et al., "Language models (mostly) know what they know" (2022); OpenAI, "GPT-4 technical report" (2023);
    • C. Mohri & T. Hashimoto, ICML (2024); V. Quach et al., ICLR (2024).
  • Watermarks. J. Kirchenbauer et al., ICML (2023); R. Kuditipudi et al. (2023); S. Dathathri et al., Nature 634 (2024).
  • Simulators. K. Cranmer, J. Brehmer & G. Louppe, PNAS 117 (2020); J. Hermans et al., TMLR (2022); S. Talts et al. (2018).
  • Diffusion.
    • J. Sohl-Dickstein et al., ICML (2015); Y. Song & S. Ermon, NeurIPS (2019); J. Ho, A. Jain & P. Abbeel, NeurIPS (2020); Y. Song et al., ICLR (2021);
    • H. Robbins (1956); K. Oko, S. Akiyama & T. Suzuki, ICML (2023).
  • Deployments. R. Johari, H. Li, I. Liskovich & G. Weintraub, Management Science (2022); S. Athey, R. Chetty, G. Imbens & H. Kang (2019).
  • Open problems. L. Cronbach & P. Meehl, Psychol. Bull. 52 (1955).
About this partfrom its README

Part 64 of the 65-part course. Every example is constructed arithmetic or seeded simulation, with no real model evaluated and no API calls. Published empirical results are attributed to their original papers rather than represented as new experiments.

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hook: the leaderboard.
  2. Benchmarks are samples. Clustered questions (Miller 2024) (Board).
  3. Paired comparisons. McNemar; power; leaderboard multiplicity (Board).
  4. Arenas. Bradley–Terry; sandwich and bootstrap intervals (Chiang et al. 2024); style control (verify).
  5. IRT for benchmarks (Part 25) (verify recent work).
  6. Adaptive reuse of test sets. The reusable holdout (Dwork et al. 2015); the Ladder (Blum & Hardt 2015).
  7. Labels from models. PPI (Part 34); design-based supervised learning (Egami et al. 2023); LLM judges as measurement error (Part 41).
  8. Synthetic data and model collapse (Shumailov et al. 2024). A Gaussian refit to its own samples, derived and computed.
  9. Uncertainty for language models. Calibration (Kadavath et al. 2022); conformal methods for generation (verify).
  10. Watermarks as hypothesis tests (verify).
  11. Simulation-based inference in science. Calibration failures (Hermans et al. 2022).
  12. Generative models as density estimators. Tweedie's formula inside diffusion (Part 25); statistical rates (verify).
  13. Causal questions about AI deployments. Interference; surrogate indices.
  14. Open problems.

Built: statkit.evals.

Build the film

python -m videos.stats.stats64.compute        # the part's numbers, into .cache/stats64
python tools/build.py stats64                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py stats64 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/stats/stats64. Setup: see the course page. Source of these notes: the README and the scenes' narration.