Md. Asif Uddin
    I.7.X09

    Measuring the 1/B law instead of assuming it

    probability▲▲△

    Build a population of per-example gradients with known mean and variance, draw four thousand minibatches at each of six sizes, and compare the measured variance of the batch mean against σ2/B\sigma^2/B. Check unbiasedness at the same time, and say why the population was given a deliberately non-normal shape.

    Hint

    Two claims are being tested, and they need different evidence: that the mean of the batch means sits at μ\mu, and that their spread falls as 1/B1/B.

    Solution

    The population. N=10 000N = 10\,000 values with μ=−0.000960\mu = -0.000960 and σ2=7.859247\sigma^2 = 7.859247. The shape is a sawtooth with occasional large spikes — deliberately not a bell curve, so that agreement cannot be an artefact of the per-example gradients happening to be normal. Real per-example gradients are not normal either; they are heavy-tailed, with a few examples contributing far more than the rest.

    The measurements. 4000 batches at each size:

    BBmeasured Var⁡\operatorname{Var}σ2/B\sigma^2/Bratiomean of means
    17.8455407.8455407.8592477.8592470.9980.9980.0879000.087900
    24.0768444.0768443.9296243.9296241.0371.0370.0174870.017487
    80.9988290.9988290.9824060.9824061.0171.017−0.012431-0.012431
    320.2484670.2484670.2456010.2456011.0121.0120.0200180.020018
    1280.0611200.0611200.0614000.0614000.9950.9950.0071090.007109
    5120.0148890.0148890.0153500.0153500.9700.9700.0029930.002993

    Unbiasedness. Every “mean of means” sits near μ=−0.000960\mu = -0.000960, and the agreement tightens as BB grows — not because the estimator becomes less biased, which it never was, but because the estimate of its mean becomes more precise. Unbiasedness is a property at every BB; only our ability to see it improves.

    The 1/B1/B law. Ratios between 0.9700.970 and 1.0371.037 across three orders of magnitude in BB. The variance falls by a factor of 512512 from B=1B{=}1 to B=512B{=}512, matching the prediction to within four percent at the worst point.

    Where the residual error comes from. The ratios wander by a few percent because 4000 trials estimate a variance with a standard error of roughly 2/(4000−1)≈2.2%\sqrt{2/(4000-1)} \approx 2.2\% — so the observed spread is what sampling noise alone predicts. Measuring a variance is itself a noisy business, and quoting three decimal places on the ratio would be quoting the noise.

    Why the non-normal shape matters. The derivation in I.7.X10 uses only linearity of expectation and independence — nothing about the distribution’s shape. A demonstration on Gaussian data would be consistent with a much weaker claim that happened to need normality. Using a spiky population tests the theorem that was actually proved.

    What this does not establish. The law assumes independent draws. Sorted batches (I.7.X05), duplicated examples, or any correlation within a batch break the variance half while leaving the unbiasedness half intact — and no measurement of this kind detects that, because the sampling here was constructed to be independent. The experiment confirms the theorem under its hypotheses; it says nothing about a pipeline that violates them.

    Draws on