· Xiaojing Yang · Statistics · 3 min read

中文

Bootstrap Resampling for Model Evaluation

Bootstrap resampling estimates uncertainty by repeatedly reusing the observed test set.

Core idea

Bootstrap asks: if this test set is the evidence I have, how much would the score move under resampling?

1. The intuition

In many AI projects, collecting a much larger test set is expensive. Bootstrap gives us a practical way to estimate uncertainty from the test set we already have.

Bootstrap loop
Original test set
N evaluated examples
Resample with replacement
Create a new pseudo-test set
Compute metric
BLEU, chrF, accuracy, COMET, F1
Repeat
Hundreds or thousands of times
Summarize
Interval or difference distribution

2. Why sampling with replacement?

Sampling with replacement lets one example appear multiple times and another not appear at all. This mimics the idea that the observed test set is one sample from a broader population.

original: [1, 2, 3, 4, 5]
sample:   [2, 2, 4, 5, 5]

The bootstrap distribution of scores shows how sensitive the metric is to the composition of the test set.

3. Model comparison

For paired tasks like MT, summarization, or classification on the same examples, bootstrap is often more useful when applied to the difference between systems on each resampled set.

Single-score bootstrap

How uncertain is this model score?

Paired bootstrap

How stable is the difference between two systems?

4. AI/NLP example

For English—Norwegian domain MT, I would bootstrap over sentence pairs. Each resampled test set produces BLEU, chrF, and maybe COMET for both systems. If most resamples show LoRA beating the baseline, the evidence is stronger than a single metric table.

5. Limitations

Bootstrap does not fix a bad test set. If the test set is biased, too small, duplicated, or missing the hard domain cases, bootstrap estimates uncertainty around that flawed sample.

Takeaway

Bootstrap is one of the most practical bridges between statistics and AI evaluation: it makes uncertainty visible without requiring a new dataset.

References and learning path

This note uses the statistics-to-machine-learning route that fits my AI/NLP research goals: build intuition with Seeing Theory and StatQuest, connect it to Python practice with Think Stats, then deepen the ML connection with ISLR/ISLP, CS229, and selected statistical inference references.

Share:
Back to Blog

Related Posts

View All Posts »