The Central Limit Theorem in ML

⚡ Key Takeaways

One-line statement: The sum (or average) of many independent random variables, each with finite variance, converges in distribution to a normal (Gaussian) distribution — regardless of the underlying distributions. In words: Averages tend to be bell-shaped, no matter what you average. Where it applies in ML: sampling-based estimators, mini-batch gradients, bootstrap confidence intervals, error analysis, weight initialization, and the justification for Gaussian noise models. Who/when: de Moivre (1733), Laplace (1810), Lyapunov (1901), and Lindeberg–Lévy (1920s).

💡 The Core Insight

Adding up many small independent random contributions averages out their idiosyncrasies. The fluctuations that survive are exactly the ones a Gaussian describes, because the Gaussian is the unique attractor (fixed point) under the operation "add independent copies and rescale." The CLT is the mathematical statement that this attractor is reached, and it explains why estimator noise in ML shrinks like σ/n\sigma/\sqrt{n} — the single most important rate in statistical learning.

Formal Statement

DefinitionConvergence in Distribution

A sequence of random variables ZnZ_n converges in distribution to a random variable ZZ, written Zn→dZZ_n \xrightarrow{d} Z, if their cumulative distribution functions satisfy

1
lim⁡n→∞FZn(z)=FZ(z)at every continuity point z of FZ.\quad \lim_{n\to\infty} F_{Z_n}(z) = F_Z(z) \quad \text{at every continuity point } z \text{ of } F_Z.

Derivation hint: This is the weakest standard mode of stochastic convergence; it concerns the shape of the distribution, not pointwise values of the variables. The continuity-point restriction handles jumps in FZF_Z. Here FZn(z)=Pr⁡(Zn≤z)F_{Z_n}(z) = \Pr(Z_n \le z) is the CDF. The CLT is a statement about this mode of convergence.

DefinitionThe Standardized Sample Mean

Let X1,…,XnX_1, \dots, X_n be i.i.d. with E[Xi]=μ\mathbb{E}[X_i] = \mu and Var⁡(Xi)=σ2∈(0,∞)\operatorname{Var}(X_i) = \sigma^2 \in (0, \infty). Define the sample mean and its standardized form:

2
Xˉn=1n∑i=1nXi,Zn=Xˉn−μσ/n=1σn∑i=1n(Xi−μ).\quad \bar{X}_n = \frac{1}{n}\sum_{i=1}^n X_i, \qquad Z_n = \frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}} = \frac{1}{\sigma\sqrt{n}}\sum_{i=1}^n (X_i - \mu).

Derivation hint: Subtract the mean (E[Xˉn]=μ\mathbb{E}[\bar X_n]=\mu) and divide by the standard deviation of Xˉn\bar X_n, which is σ/n\sigma/\sqrt n since Var⁡(Xˉn)=σ2/n\operatorname{Var}(\bar X_n)=\sigma^2/n for independent terms. The factor n\sqrt{n} is the precise scaling that keeps ZnZ_n from collapsing to 00 (which Xˉn−μ\bar X_n - \mu does) or exploding (which ∑(Xi−μ)\sum(X_i-\mu) does).

TheoremLindeberg–Lévy Central Limit Theorem

Let X1,X2,…X_1, X_2, \dots be i.i.d. random variables with finite mean μ\mu and finite, nonzero variance σ2\sigma^2. Then

3
Zn=n (Xˉn−μ)σ→dN(0,1)as n→∞,\quad Z_n = \frac{\sqrt{n}\,(\bar{X}_n - \mu)}{\sigma} \xrightarrow{d} \mathcal{N}(0,1) \quad \text{as } n \to \infty,

Derivation hint: Show the characteristic function of ZnZ_n converges to e−t2/2e^{-t^2/2}, the characteristic function of N(0,1)\mathcal N(0,1), then invoke Lévy's continuity theorem. equivalently Pr⁡(Zn≤z)→Φ(z)=∫−∞z12πe−u2/2 du\Pr(Z_n \le z) \to \Phi(z) = \int_{-\infty}^z \frac{1}{\sqrt{2\pi}} e^{-u^2/2}\,du for all zz. No assumption on the shape of the XiX_i distribution is needed beyond finite variance.

TheoremLyapunov CLT — dropping identical distribution

Let X1,…,XnX_1, \dots, X_n be independent (not necessarily identically distributed) with means μi\mu_i, variances σi2\sigma_i^2, and set sn2=∑i=1nσi2s_n^2 = \sum_{i=1}^n \sigma_i^2. If for some δ>0\delta > 0 the Lyapunov condition holds,

4
lim⁡n→∞1sn2+δ∑i=1nE ⁣[∣Xi−μi∣2+δ]=0,\quad \lim_{n\to\infty}\frac{1}{s_n^{2+\delta}}\sum_{i=1}^n \mathbb{E}\!\left[|X_i - \mu_i|^{2+\delta}\right] = 0,

Derivation hint: This condition forces no single term to dominate the sum; it controls the (2+δ)(2+\delta)-th moments relative to the total variance, which is what makes the Lindeberg argument go through. then 1sn∑i=1n(Xi−μi)→dN(0,1)\frac{1}{s_n}\sum_{i=1}^n (X_i - \mu_i) \xrightarrow{d} \mathcal{N}(0,1). This is the version relevant to heterogeneous ML data (e.g., summing differently-scaled features or non-i.i.d. gradient components).

Why It Holds / Derivation

ProofCharacteristic-Function Proof of Lindeberg–Lévy

Assume WLOG μ=0\mu = 0 (otherwise replace XiX_i by Xi−μX_i - \mu) and σ2\sigma^2 finite. Let Yi=Xi/σY_i = X_i/\sigma, so E[Yi]=0\mathbb{E}[Y_i]=0, Var⁡(Yi)=1\operatorname{Var}(Y_i)=1. Then Zn=1n∑i=1nYiZ_n = \frac{1}{\sqrt n}\sum_{i=1}^n Y_i.

Step 1 — Characteristic function of one term. The characteristic function is φ(t)=E[eitY1]\varphi(t) = \mathbb{E}[e^{itY_1}]. Since E[Y12]<∞\mathbb{E}[Y_1^2]<\infty, φ\varphi is twice differentiable at 00 with a Taylor expansion

5
φ(t)=1+it E[Y1]−t22E[Y12]+o(t2)=1−t22+o(t2).\quad \varphi(t) = 1 + it\,\mathbb{E}[Y_1] - \tfrac{t^2}{2}\mathbb{E}[Y_1^2] + o(t^2) = 1 - \tfrac{t^2}{2} + o(t^2).

Derivation hint: Differentiate under the expectation: φ′(0)=iE[Y1]=0\varphi'(0)=i\mathbb E[Y_1]=0, φ′′(0)=−E[Y12]=−1\varphi''(0)=-\mathbb E[Y_1^2]=-1. The o(t2)o(t^2) remainder is justified by finite second moment.

Step 2 — Characteristic function of ZnZ_n. By independence the characteristic function of a sum factorizes, and scaling by 1/n1/\sqrt n rescales the argument:

6
φZn(t)=E ⁣[exp⁡ ⁣(itn∑iYi)]=[φ ⁣(tn)]n.\quad \varphi_{Z_n}(t) = \mathbb{E}\!\left[\exp\!\left(\tfrac{it}{\sqrt n}\textstyle\sum_i Y_i\right)\right] = \left[\varphi\!\left(\tfrac{t}{\sqrt n}\right)\right]^n.

Derivation hint: E[∏ieisYi]=∏iE[eisYi]\mathbb E[\prod_i e^{i s Y_i}] = \prod_i \mathbb E[e^{i s Y_i}] for independent YiY_i, with s=t/ns = t/\sqrt n identical across terms by i.i.d.

Step 3 — Take the limit. Substitute the expansion at t/nt/\sqrt n:

7
φZn(t)=[1−t22n+o ⁣(1n)]n→n→∞e−t2/2.\quad \varphi_{Z_n}(t) = \left[1 - \frac{t^2}{2n} + o\!\left(\tfrac{1}{n}\right)\right]^n \xrightarrow[n\to\infty]{} e^{-t^2/2}.

Derivation hint: Use lim⁡n→∞(1+an/n)n=ea\lim_{n\to\infty}(1 + a_n/n)^n = e^{a} when an→aa_n \to a; here an→−t2/2a_n \to -t^2/2 and the o(1/n)o(1/n) term vanishes after multiplication by nn.

Step 4 — Conclude. The limit e−t2/2e^{-t^2/2} is the characteristic function of N(0,1)\mathcal{N}(0,1). By Lévy's continuity theorem, pointwise convergence of characteristic functions to a function continuous at 00 implies convergence in distribution. Hence Zn→dN(0,1)Z_n \xrightarrow{d} \mathcal{N}(0,1). ■\blacksquare

∎
mathematician · Pierre-Simon Laplace | 1749–1827

Laplace gave the first general (if non-rigorous) statement and proof of the CLT in his 1810 memoir, generalizing de Moivre's 1733 normal approximation to the binomial. He developed the characteristic-function method ("Laplace transform" of distributions) that, made rigorous by Lyapunov and Lévy a century later, became the standard modern proof. Laplace's central interest was error theory: he wanted to know why the average of many astronomical measurements was reliable — exactly the question a machine learning practitioner asks of a validation estimate today.

Building Intuition

🧠 Intuition

Think of each Xi−μX_i - \mu as a tiny random "kick." Summing nn kicks, the positive and negative ones partly cancel; what remains is a random walk of typical size n\sqrt n (not nn, because of cancellation — this is the diffusive scaling). Dividing by n\sqrt n in ZnZ_n exactly cancels this growth and exposes a stable shape. Why is that shape Gaussian and nothing else? Because the Gaussian is the only distribution (with finite variance) that reproduces itself when you add independent copies and rescale — it is the fixed point of the "convolve-and-shrink" operation. The CLT says every finite-variance distribution flows toward this fixed point. In ML terms: it does not matter whether your per-example loss is heavy on one side, bimodal, or discrete; once you average enough examples, the average's uncertainty is bell-shaped.

Figure
Convergence of the standardized sample mean toward the standard normal as n grows. Histograms of ZnZ_n for a skewed (exponential) source flatten their skew and approach the gold Gaussian curve.
CLT: distribution of Z_n approaches N(0,1) z density n = 2 (skewed) n = 10 N(0,1) limit -2 0 2

Worked Examples

ExampleConfidence Interval on Validation Accuracy

Given: A classifier is evaluated on n=2,000n = 2{,}000 held-out examples drawn i.i.d. from the test distribution. Each example is a Bernoulli trial XiX_i with Xi=1X_i = 1 if correctly classified. Observed accuracy p^=Xˉn=0.86\hat p = \bar X_n = 0.86.

Goal: A 95% confidence interval for the true accuracy pp.

Steps: 1. Each XiX_i has mean pp and variance p(1−p)p(1-p). By the CLT, p^≈N ⁣(p,  p(1−p)/n)\hat p \approx \mathcal N\!\big(p,\; p(1-p)/n\big) for large nn. 2. Estimate the standard error with p^\hat p:   SE=p^(1−p^)/n=0.86⋅0.14/2000\;\mathrm{SE} = \sqrt{\hat p(1-\hat p)/n} = \sqrt{0.86 \cdot 0.14 / 2000}. 3. Compute: 0.86⋅0.14=0.12040.86\cdot 0.14 = 0.1204; divide by 2000=6.02×10−52000 = 6.02\times10^{-5}; square root =0.00776= 0.00776. 4. The 95% interval uses z0.975=1.96z_{0.975} = 1.96: margin =1.96×0.00776=0.0152= 1.96 \times 0.00776 = 0.0152. 5. Interval =0.86±0.0152= 0.86 \pm 0.0152.

Answer: p∈[0.845, 0.875] with 95% confidence (dimensionless accuracy)\boxed{p \in [0.845,\ 0.875] \text{ with } 95\% \text{ confidence (dimensionless accuracy)}}. The CLT is what licenses the Gaussian zz-multiplier; with n=2000n=2000 the Bernoulli skew is negligible.

ExampleMonte Carlo Estimate of an Expectation

Given: We estimate μ=E[f(W)]\mu = \mathbb{E}[f(W)] (e.g., expected reward) by Monte Carlo with n=10,000n = 10{,}000 i.i.d. samples. The sample mean is fˉ=4.20\bar f = 4.20 and the sample standard deviation is s=3.0s = 3.0 (units: reward).

Goal: Report the estimate with a one-standard-error band, and find nn needed to halve the error.

Steps: 1. By the CLT, fˉ≈N(μ,s2/n)\bar f \approx \mathcal N(\mu, s^2/n). Standard error =s/n=3.0/10000=3.0/100=0.03= s/\sqrt n = 3.0/\sqrt{10000} = 3.0/100 = 0.03. 2. Report: μ^=4.20±0.03\hat\mu = 4.20 \pm 0.03 (reward). 3. Error scales as 1/n1/\sqrt n. To halve 0.03→0.0150.03 \to 0.015 we need n′=2n\sqrt{n'} = 2\sqrt n, i.e. n′=4nn' = 4n. 4. Required: n′=4×10000=40000n' = 4 \times 10000 = 40000.

Answer: μ^=4.20±0.03 reward;  n′=40,000 samples to halve the error\boxed{\hat\mu = 4.20 \pm 0.03 \text{ reward};\ \ n' = 40{,}000 \text{ samples to halve the error}}. The quadrupling cost to halve error is the practical sting of the CLT's 1/n1/\sqrt n rate.

Common Misconceptions

⚠️ What the CLT does NOT say
  • It does not say the data XiX_i become normal. The sample mean's distribution becomes normal; the raw data keep whatever shape they had.
  • It does not require a large individual dataset to be Gaussian — it requires a large number of summands/averages.
  • "n≥30n \ge 30 is always enough" is a rule of thumb, not a theorem. Heavily skewed or heavy-tailed (but finite-variance) sources may need thousands of samples for the normal approximation to be accurate in the tails.
  • The CLT is about convergence in distribution, which is the weakest mode — it says nothing about almost-sure or L2L^2 convergence of ZnZ_n (which in fact does not hold; ZnZ_n keeps fluctuating).
CounterexampleInfinite variance breaks the CLT

Let X1,X2,…X_1, X_2, \dots be i.i.d. Cauchy with density 1π(1+x2)\frac{1}{\pi(1+x^2)}. The Cauchy distribution has no finite mean and infinite variance, so the CLT hypotheses fail. Remarkably, the sample mean Xˉn\bar X_n of nn Cauchy variables is itself exactly Cauchy with the same scale — averaging does not concentrate it at all, and n(Xˉn−μ)\sqrt n(\bar X_n - \mu) never converges to a Gaussian. In ML this matters: gradient noise or importance-sampling weights with heavy tails (Pareto-type, infinite variance) can violate the CLT, so the usual 1/n1/\sqrt n error shrinkage and Gaussian confidence intervals are simply wrong. Such cases fall under Generalized Central Limit Theorem with α\alpha-stable limits instead of Gaussian.

Connections

connection

The CLT sits at the hub of statistical ML reasoning.

  • It justifies the Law of Large Numbers companion result: while the LLN says Xˉn→μ\bar X_n \to \mu, the CLT quantifies how fast and with what fluctuations.
  • It underlies the Bootstrap, which resamples to approximate the sampling distribution that the CLT describes asymptotically.
  • It motivates Gaussian Distribution noise models and the Maximum Likelihood Estimation asymptotic normality of estimators (θ^≈N(θ,I−1/n)\hat\theta \approx \mathcal N(\theta, I^{-1}/n)).
  • In optimization, it frames Stochastic Gradient Descent as a noisy gradient ∇=gˉ+N(0,Σ/B)\nabla = \bar g + \mathcal N(0, \Sigma/B) over a mini-batch of size BB.
  • Its failure mode connects to the Generalized Central Limit Theorem and Heavy-Tailed Distributions.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1733 — Abraham de Moivre: approximates the binomial distribution by the normal curve for large nn — the first special case of the CLT (de Moivre–Laplace theorem).
- 1810 — Pierre-Simon Laplace: states and (heuristically) proves a general CLT using characteristic functions, motivated by the theory of measurement errors.
- 1853 — Augustin-Louis Cauchy & Irénée-Jules Bienaymé: dispute over least squares forces clarification of the conditions and counterexamples (Cauchy distribution).
- 1887 — Pafnuty Chebyshev: develops the method of moments toward a rigorous CLT.
- 1901 — Aleksandr Lyapunov: gives the first fully rigorous proof under his moment ([Lyapunov]) condition, allowing non-identical distributions.
- 1922 — Jarl Waldemar Lindeberg: proves the CLT under the weaker Lindeberg condition, the most general sufficient condition for i.n.i.d. arrays.
- 1925 — Paul Lévy: develops the continuity theorem and the modern characteristic-function machinery; later studies α\alpha-stable laws (the heavy-tailed generalizations).
- 1935 — William Feller & Lévy: establish that the Lindeberg condition is essentially necessary (Feller–Lévy), closing the classical theory.
- 20th c. onward: extensions to martingales, dependent and mixing sequences, high-dimensional ([Berry–Esseen] rates), and random-matrix CLTs underpinning modern ML theory.

Subtleties & Limits

open-problem
  • Rate of convergence. The Berry–Esseen theorem bounds the error as sup⁡z∣FZn(z)−Φ(z)∣≤C ρ/(σ3n)\sup_z|F_{Z_n}(z)-\Phi(z)| \le C\,\rho/(\sigma^3\sqrt n) where ρ=E∣X−μ∣3\rho=\mathbb E|X-\mu|^3; the optimal constant CC and tail-uniform rates remain delicate, and the bound degrades for skewed data.
  • High dimensions. In modern ML, nn samples in d∼nd \sim n dimensions break classical CLT intuition; multivariate CLTs need conditions on dd growing with nn, an active area (Chernozhukov–Chetverikov–Kato high-dimensional CLTs).
  • Dependence. Real data and gradients are correlated (sequential, mixing, or graph-structured). CLTs exist for martingales and weakly dependent sequences, but verifying mixing/ergodicity in deep learning dynamics is largely open.
  • Heavy tails. When variance is infinite, the limit is α\alpha-stable, not Gaussian; characterizing when ML quantities (importance weights, attention scores, gradient noise) are heavy-tailed is an empirical and theoretical frontier.

See Also

Law of Large Numbers · Gaussian Distribution · Monte Carlo Methods · Bootstrap · Maximum Likelihood Estimation · Stochastic Gradient Descent · Berry–Esseen Theorem · Generalized Central Limit Theorem · Heavy-Tailed Distributions