arXiv:2610.12987cs.CLOct 2026

Manuscript Offprint

arXiv:2610.12987

Forecasting Corpus-Sampling Disagreement in Masked Text Reconstruction

Hare Krishna

ABSTRACT

If a second text corpus were collected from the same population, how much would a predictor’s outputs change? We study this question for masked-text reconstruction using a smoothed predictor built from nearby token-pair counts and evaluated over the full 50,257-token GPT-2 vocabulary. Treating each source document as one observation, we derive a first-order formula for the expected disagreement between predictors fitted to two independent corpora. The formula accounts for variable document length, random context counts, and correlations across token offsets, and it can be evaluated from a separate reference corpus without access to either target corpus. On TinyStories, WikiText-103, and CNN/DailyMail, growing each corpus from 512 to 2,048 chunks of 64 tokens lowers disagreement by only 5–40%, far short of the 75% implied by 1/n scaling. The forecast tracks this slow decline, which we trace to smoothing of rarely seen contexts. Forecast accuracy depends less on how these correlations are modeled than on the size of the reference corpus: small references systematically underpredict disagreement. A source-split jackknife that uses only reference data reduces this calibration error by 57–59%. After this correction, a simpler smoothed-multinomial approximation is most accurate when the reference corpus is smaller than the target corpus, and a nonlinear source bootstrap is most accurate when it is larger. Finally, small masked diffusion language models trained on the same corpora show that the count-based forecasts partly identify which inputs are most sensitive to the corpus, but miss the neural models’ much faster decline in disagreement.

1 Introduction and Related Work

A text corpus reflects the particular stories, articles, and other sources that happened to be collected. A second collection from the same population will contain different examples and token frequencies, so a predictor built from it can change as well. How large should we expect that change to be? Answering this question would help us decide how much text to collect and judge how strongly a prediction depends on the chosen corpus. Average test error alone cannot answer it: similarly accurate predictors may disagree on the same input (Marx et al., 2020), and comparable validation performance can conceal differences in deployment behavior (D'Amour et al., 2022).

Code: https://github.com/learncsai/masked-diffusion-model-text-reconstruction

We study how corpus sampling affects predictions in a masked-text reconstruction problem. Our reconstructor predicts a hidden token by combining conditional token frequencies at nearby positions. Independent corpora A and B supply separate count tables, while the unigram baseline and combination weights are fixed using shared auxiliary data. We measure the observed disagreement as the mean squared distance between the two reconstructors' output vectors on identical masked inputs. Our forecast targets the expected value of this disagreement across independent draws of A and B at a specified corpus size. We compute the forecast from an independent reference corpus and assess it against the measured disagreement averaged over multiple A/B pairs. Because only the count tables differ between the two reconstructors, this comparison isolates variation due to corpus sampling. Separately, we measure relative MSE improvement over the shared unigram to assess reconstruction accuracy.

Two features of text make the calculation less straightforward than a standard inverse-sample-size argument. First, token-pair counts are dependent. An article can contribute several chunks, overlapping pairs share tokens, and counts at different offsets fluctuate together. Second, each conditional row is a ratio whose denominator, the number of times the context appears, is itself random. Our smoothing rule pulls rows with few observations strongly toward the unigram (Chen and Goodman, 1999), so a larger corpus does two things at once. It reduces sampling noise in the estimated frequencies, and it lets the predictor rely more heavily on those frequencies. The second effect partly offsets the first, which is why disagreement can fall much more slowly than 1/n.

Contributions. (1) We derive a first-order, source-level formula for expected disagreement (Proposition 1) that accounts for source length, random row totals, and cross-lag covariance. It enables forecasts from independent reference data without using the target A/B counts or outputs, and explains how smoothing can produce substantially slower decay than 1/n at finite corpus sizes. We call it the source law throughout the article.

(2) We show that correcting finite-reference error can matter more than retaining additional covariance detail. A source-split jackknife reduces small-reference error by 57–59% for both the source and smoothed multinomial forecasts. In our main experiments, the corrected multinomial law outperforms the source law with a small reference, while the corrected nonlinear source bootstrap is most accurate with a larger one. In simulations with known population values, the multinomial law does better partly because two of its errors cancel.

(3) We test the count-based forecasts against disagreement between small MDLMs trained on separate corpora. The forecasts partly identify the inputs on which the MDLMs disagree most. We also compare the directions in which their token scores change. Overall token frequencies predict these directions as well as the reconstructor does. With the number of training steps held fixed, MDLM disagreement falls much faster with corpus size than reconstructor disagreement. The forecasts therefore help identify inputs sensitive to corpus sampling, but do not fully explain the size or pattern of neural prediction changes.

Related work. Existing work studies corpus uncertainty through embedding stability, resampling, and covariance estimates for word representations (Antoniak and Mimno, 2018; Gries, 2022; Vallebueno et al., 2024). For word-frequency comparisons, Lijffijt et al. (2016) emphasize treating texts as independent observations while allowing dependence among words within a text. GloVe-V (Vallebueno et al., 2024) instead defines uncertainty over word co-occurrences rather than over the documents that produce them. Our multinomial law makes the analogous count-level assumption, whereas our source law treats complete sources as the sampling unit and retains dependence within each source. Influence functions measure how single training examples change a model's predictions (Koh and Liang, 2017) and Brunet et al. (2019) trace embedding bias back to individual documents. The infinitesimal jackknife linearizes a procedure with respect to observation weights (Jaeckel, 1972; Efron, 1982; Giordano et al., 2019). Wager et al. (2014) use jackknife methods to estimate how much a random forest's prediction at a fixed input varies across training samples, a target close to ours.

Datamodels learn how a model's predictions depend on which examples it is trained on, using outputs from models trained on many subsets of the same dataset (Ilyas et al., 2022). Our analytic forecast does not require training models on many subsets of the corpus: a first-order approximation gives an explicit variance formula for smoothed lag counts at a fixed chunk budget, and its inputs are estimated from an independent reference corpus. Treating a complete source as the sampling unit keeps its internal dependence and lets us separate source-length, row-normalization, and cross-lag contributions. We compare this formula with a smoothed multinomial approximation and a nonlinear source bootstrap. All three are computed from a finite reference corpus, so a forecast can fail in two ways. Its approximation to the sampling variation can be too crude, or the reference can estimate the required rows and covariances poorly.

In our experiments, the second problem is the bigger one. Both analytic laws (source law and multinomial) capture much of the slow, smoothing-driven decline in disagreement with corpus size, but both underpredict its level when the reference is small. Part of the gap comes from contexts the reference never sees, which contribute nothing to the forecast even when the new corpora contain them. We reduce this bias with a source-split jackknife (Quenouille, 1956), applied the same way to both laws. After correction, the multinomial law is still the better calibrated of the two. Exact population calculations explain this: even with no reference error, linearization makes the source formula overshoot the actual disagreement by 3–12% in our controlled experiment. The multinomial law gives smaller variance estimates that partly offset this overshoot. As the reference grows and estimation error shrinks, linearization error becomes a larger share of what remains. This fits our finding that a corrected bootstrap, which refits the smoothed rows on every resample instead of linearizing, gives the best forecasts when the reference is larger than the target.

We then ask whether these local statistics also explain variation in a trained neural denoiser. In image diffusion, Kadkhodaie et al. (2024) show that denoisers trained on non-overlapping datasets learn nearly the same score function when the datasets are sufficiently large. Zhang et al. (2024) study consistency of generated outputs across diffusion models under common initial noise and deterministic sampling. Wang et al. (2026) connect image-diffusion consistency to empirical means and covariances through a Gaussian linear denoiser and random matrix theory. That Gaussian analysis does not carry over directly to text, where tokens are categorical, corruption is by masking, and the predictor divides by random context counts. Table 7 in Appendix C.3 maps out the correspondence.

For text, Nguyen (2024) approximates transformer predictions using training-data n-gram statistics and relates approximation quality to prediction variability across training runs. That variability comes from different shuffles of a fixed corpus; our target is variation across independently sampled corpora. Our matched experiment with small masked diffusion language models (MDLMs) compares token-prediction vectors on identical masked inputs, and tests how far the count-based predictions carry over in magnitude, input ranking, and output direction.

References (37)