Resample the independent units rather than their repeated rows
Identify conversation, user, and source dependence; preserve it in cluster resampling; and distinguish more bootstrap repetitions from more independent evidence.
On this page
The question for today
What you’ll understand
- Explain why repeated related examples can understate uncertainty.
- Choose a bootstrap unit and statistic consistent with the estimand.
- State finite-cluster and distribution-shift limits of resampling.
An evaluation has one hundred rows, but each original prompt was repeated four times with trivial formatting changes. Treating the rows as independent can make a score look much more precise than the underlying evidence supports. Dependence is a property of how cases were generated, not a nuisance removed by shuffling the file. Identify the highest relevant independent units, retain their grouping, and design an uncertainty procedure that respects that structure. Cluster resampling can approximate sampling variation under appropriate assumptions; it does not manufacture new independent tasks or users.
Describe the dependence before selecting a formula
Examples can share a conversation, repository, document, author, or generation template. Their outcomes may move together because they rely on the same knowledge or failure mechanism. Repeating more variants within one source can reveal local robustness while contributing less information about new sources than an equal number of independent sources would. In a simplified equal-size model, the variance inflation depends on within-cluster correlation. That model is a diagnostic calculation, not a universal formula for arbitrary overlapping groups, unequal cluster sizes, or unknown dependence.
The intended population determines which units should be considered exchangeable. For performance on new users, users may be the sampling units even when each provides many conversations. If repositories share a common upstream project, repository IDs alone may miss additional dependence. Grouping choices should follow collection and deployment knowledge, with sensitivity analyses when uncertainty remains. Saravanan and colleagues illustrate how treating nested measurements as independent can misstate uncertainty. Their hierarchical-bootstrap results concern their modeled structures; they do not justify blindly applying the same hierarchy to every evaluation dataset.
Keep the resampling unit and the statistic aligned
For a basic cluster bootstrap, sample cluster identities with replacement and keep each selected cluster's observed rows together. Recompute the declared statistic on that resample. For paired model comparisons, resample both models' outcomes on the same selected clusters. If the estimand gives each cluster equal weight, average cluster means. If it gives each request equal weight, recompute the request-weighted numerator and denominator; unequal cluster sizes make these different statistics. The resampling design should approximate the original sampling process rather than quietly change the target weights.
A multi-stage sample may call for a justified hierarchical bootstrap that also resamples lower-level units, while a block or other dependence-aware method may be needed for time series. There is no instruction to resample every level automatically. Cluster bootstrap intervals are generally approximations whose adequacy depends on the statistic, population, cluster count, and sampling design. A handful of highly unequal clusters can make the approximation poor. Report the number and size distribution of independent clusters, the exact resampling procedure, the interval construction, and sensitivity to plausible alternative grouping choices.
Distinguish computational precision from evidence
Increasing the number of bootstrap resamples reduces Monte Carlo noise in the bootstrap calculation, but it does not increase the number of independent source clusters. A resample cannot add a missing language, undo contamination, or make an old workload representative of a new population. Validate implementation with simple examples where the sampling variance is known, and retain grouping identities in the artifact. Report unresolved dependence or low support directly rather than hide it behind many decimal places from a large resampling run.
The sampling lab offers a precise counterexample to row counting, not a bootstrap implementation. For each separate view, Reset, set both p=0.5 and n to 25 or 100, predict, then inspect. Independent sample-mean variances are 0.01 and 0.0025. In the worked example, one hundred perfectly repeated rows contain only twenty-five independent Bernoulli outcomes, so the twenty-five-trial variance is the relevant toy result. The display has no clusters or resampling controls. Its role is to contrast those two explicit assumptions, while actual cluster inference requires the retained grouping and justified procedure.
Work it through
Four identical rows do not quadruple independent evidence
A fictional dataset has twenty-five independent source prompts. Each prompt has one Bernoulli outcome with success probability 0.5, copied identically into four rows. The score averages all one hundred rows, and every cluster has the same size.
Because all four copies are identical, the one-hundred-row mean equals the mean of the twenty-five original independent outcomes. The within-cluster correlation is one.
Its true sampling variance is 0.5×0.5/25=0.01, with standard deviation 0.1. Pretending all one hundred rows were independent would give variance 0.0025 and standard deviation 0.05.
The equal-size design effect is 1+(4−1)×1=4, multiplying the naive variance by four. Resample original prompt clusters rather than their individual copies when approximating this sampling process.
The repeated-row statistic has the precision of twenty-five independent outcomes in this construction. Generating more bootstrap replicates cannot change that evidence count.
The living notebook
Explore the model
Interactive lab · sampling
Contrast independent evidence with duplicated rows
For each view: Reset, set both p=0.5 and n, predict, then inspect. n=25 gives variance 0.01; n=100 gives 0.0025. These are two independent Bernoulli models. The first matches the worked perfect-copy construction’s mean; the instrument itself performs no cluster bootstrap or correlated sampling.
- Mean sample proportion
- 0.5
- Sample-mean variance
- 0.0125
- Uniform CDF error bound
- ≤ 0.1062
Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forCount independent sources and preserve their structure. A large row count or resampling count is not automatically a large effective evidence base.
Pause & reason
Check your understanding
Your turn
Try it yourself
One cluster has ten rows scoring one, and another has one row scoring zero. Compute the request-weighted and equal-cluster-weighted means. What changes if the bootstrap silently uses the other statistic?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Compare the pooled numerator and denominator with the mean of the two cluster means.
Compare with the solution
The request-weighted mean is 10/11≈0.90909, while the equal-cluster mean is (1+0)/2=0.5. Switching statistics changes the estimand. Two clusters also provide very limited population evidence; resampling does not resolve that limitation.
Keep the idea
Take it with you
- Dependence follows source and collection structure, not file row order.
- Resample justified independent units and preserve the estimand’s weighting.
- Bootstrap approximation and Monte Carlo precision do not repair distribution shift or missing independent support.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.