Foundations to Frontier
Tests
A. Mathematical Foundations › A7 Information Theory

Minimum Description Length

The minimum description length principle turns Occam's razor into arithmetic: the best model is the one that lets you write down the model plus the data in the fewest bits. You will build two-part codes, see why each real-valued parameter costs about ½ log₂ n bits, meet universal codes (Krichevsky–Trofimov mixtures and normalized maximum likelihood) and their regret, connect MDL to BIC and Bayesian evidence, and use MDL to choose the right polynomial order for a noisy calibration curve where minimum training error fails.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

The shortest explanation wins

Suppose you need to tell a friend a list of a thousand numbers. If they follow a simple rule (“each is the previous plus 3”), you can just tell them the rule and the first number. If they’re random, you have to read them all out. A good model is a short description: it captures the pattern so you only need to describe what’s left over. The minimum description length principle says to pick the model that makes the total message (model plus leftovers) shortest.

Minimum description length: the best model is the shortest explanation
true curve:
MDL choice (degree 3)degree 8 (min training error)012★345678model bitsdata bits (shifted)degree
MDL picks degree 3; total description length is -118.7 bits vs -108.6 bits for degree 8 (relative, at a fixed precision).
Each extra coefficient costs about ½ log₂ n bits to state. It must buy at least that much shorter data encoding, i.e. reduce n/2·log₂(RSS) by that much. With few points or lots of noise, MDL prefers simpler models; with more data it can afford complexity. Minimum training error never stops adding terms.
Why engineers care

Choosing how complex a model should be is everywhere: how many terms in a thruster calibration curve, how many states in a hidden Markov model of a rover’s terrain, how many clusters in sensor data. MDL gives a principled stopping rule that doesn’t need a held-out set, which matters when every data point cost a space mission to collect.

📝 Quick check (Level 0)
0/3 answered
  1. 1. MDL prefers the model that…
  2. 2. Random data with no pattern…
  3. 3. Adding a parameter is worth it only if…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Two-part codes

L(D)=min⁡M[L(M)+L(D∣M)]L(D) = \min_M\big[L(M) + L(D\mid M)\big]

L(D∣M)=−log⁡2p(D∣θ^M)L(D\mid M) = -\log_2p(D\mid\hat\theta_M) is the code length of the data under the fitted model (A7-7). L(M)L(M) is the cost of describing the model.

What does a parameter cost?

With nn data points, a parameter only needs to be stated to precision about 1/n1/\sqrt n (its statistical uncertainty). That takes about 12log⁡2n\tfrac12\log_2n bits. So for a kk-parameter model:

L(D)≈−log⁡2p(D∣θ^)+k2log⁡2nL(D)\approx-\log_2p(D\mid\hat\theta) + \frac k2\log_2n

This is exactly the BIC criterion (Schwarz, 1978), in bits.

Gaussian residuals

For regression with i.i.d. Gaussian noise, −log⁡2p(D∣θ^)=n2log⁡2(RSS/n)+const-\log_2p(D\mid\hat\theta) = \tfrac n2\log_2(\mathrm{RSS}/n) + \text{const}.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Cost of 2 parameters with n = 1024 data points (bits):
  2. 2. The ½ log₂ n parameter cost corresponds to…
  3. 3. L(D | M) is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Universal codes and regret

A universal code for a model class compresses every sequence nearly as well as the best model chosen in hindsight. Its regret is L(xn)−min⁡θ[−log⁡2pθ(xn)]L(x^n) - \min_\theta[-\log_2p_\theta(x^n)].

  • Krichevsky–Trofimov (KT): sequential prediction q(1)=(n1+12)/(n+1)q(1) = (n_1 + \frac12)/(n + 1). It’s a Bayes mixture with a Jeffreys prior, with regret at most about 12log⁡2n+1\frac12\log_2n + 1 on every sequence.
  • Normalized maximum likelihood (NML): pNML(xn)=pθ^(xn)(xn)/COMPnp_{\mathrm{NML}}(x^n) = p_{\hat\theta(x^n)}(x^n)/\mathrm{COMP}_n. Its regret is the same, log⁡2COMPn\log_2\mathrm{COMP}_n, for every sequence, and that is the minimax-optimal worst case (Shtarkov, 1987). For Bernoulli, log⁡2COMPn≈12log⁡2nπ2\log_2\mathrm{COMP}_n\approx\frac12\log_2\frac{n\pi}2.

log⁡2COMP\log_2\mathrm{COMP} is the parametric complexity: how many distinguishable distributions the model class contains. “Refined MDL” uses it in place of the crude parameter count (Rissanen, 1996; Grünwald, 2007).

🐍 Exercise 1: universal codes for coin flips
Compute maximum-likelihood, two-part, KT and NML code lengths for Bernoulli sequences. Verify that NML has the same regret for every sequence, that it's minimax, that it matches ½ log₂(nπ/2), and that KT regret is about ½ log₂ n.
📝 Quick check (Level 2)
0/3 answered
  1. 1. NML regret is…
  2. 2. The KT estimator is a Bayes mixture with prior…
  3. 3. Parametric complexity measures…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Why ½ log₂ n per parameter

Quantize θ\theta to a grid of spacing δ\delta. Stating it costs about log⁡2(1/δ)\log_2(1/\delta) bits. Rounding θ^\hat\theta by δ\delta increases the data cost by about 12nI(θ)δ2/ln⁡2\frac12n I(\theta)\delta^2/\ln2 (Taylor expansion with Fisher information II). Minimizing log⁡2(1/δ)+c nδ2\log_2(1/\delta) + c\,n\delta^2 gives δ∝n−1/2\delta\propto n^{-1/2}, so the cost is 12log⁡2n+O(1)\frac12\log_2n + O(1). ∎

MDL and Bayes

A Bayes mixture code −log⁡2∫p(D∣θ)π(θ) dθ-\log_2\int p(D\mid\theta)\pi(\theta)\,d\theta is a valid universal code. Its Laplace approximation is

−log⁡2p(D∣θ^)+k2log⁡2n2π+12log⁡2∣I(θ^)∣−log⁡2π(θ^)-\log_2p(D\mid\hat\theta) + \frac k2\log_2\frac n{2\pi} + \frac12\log_2\lvert I(\hat\theta)\rvert - \log_2\pi(\hat\theta)

That’s BIC plus O(1)O(1) terms. Choosing the model with the shortest mixture code is choosing the largest marginal likelihood.

Stochastic complexity

Rissanen’s asymptotic expansion of NML: log⁡2COMPn=k2log⁡2n2π+log⁡2∫∣I(θ)∣ dθ+o(1)\log_2\mathrm{COMP}_n = \frac k2\log_2\frac n{2\pi} + \log_2\int\sqrt{\lvert I(\theta)\rvert}\,d\theta + o(1). The integral term penalizes model geometry, not just the parameter count.

Exercise 3.1: is a degree-4 term worth it?

With n = 64, the extra coefficient costs 12log⁡264=3\frac12\log_264 = 3 bits. It’s worth it only if n2log⁡2(RSS3/RSS4)>3\frac n2\log_2(\mathrm{RSS}_3/\mathrm{RSS}_4) > 3, i.e. RSS drops by more than a factor of 26/64≈1.0672^{6/64}\approx1.067 (6.7%).

📝 Quick check (Level 3)
0/3 answered
  1. 1. The optimal parameter precision scales like…
  2. 2. The shortest Bayes-mixture code corresponds to maximizing…
  3. 3. With n = 64, one more parameter costs…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Calibrating with just enough terms

An engineer fits a polynomial to 60 noisy calibration points (thrust vs. command, or sensor output vs. temperature). Minimum training error always takes the highest degree allowed, and overfits. MDL with Gaussian residuals, n2log⁡2(RSS/n)+k2log⁡2n\frac n2\log_2(\mathrm{RSS}/n) + \frac k2\log_2n, recovers the true cubic in most trials and predicts new data better. With no validation set needed, MDL is attractive when data are scarce, as in flight-test or on-orbit calibration.

🐍 Exercise 2 (research): MDL polynomial order selection
Select the degree of a calibration polynomial by MDL over 60 noisy datasets from a cubic. Compare it with minimum training error on the selected degree and on held-out error.

MDL in AI, robotics and aerospace

  • Model order selection: AR model orders for vibration and telemetry time series, the number of HMM states, and the number of map features in SLAM.
  • Change-point and anomaly detection: segmenting telemetry where a new model shortens the description.
  • Neural networks: “keeping networks simple by minimizing the description length of the weights” (Hinton and van Camp, 1993). Modern compression-based generalization bounds and prequential (online) code length estimate the description length of a dataset under a learner (Blier and Ollivier, 2018).
  • Program induction and scientific discovery: symbolic regression that trades off equation complexity against fit (AI Feynman: Udrescu and Tegmark, 2020).

References

  1. J. Rissanen (1978). “Modeling by shortest data description.” Automatica, 14(5).
  2. G. Schwarz (1978). “Estimating the dimension of a model.” Annals of Statistics, 6(2).
  3. Y. Shtarkov (1987). “Universal sequential coding of single messages.” Problems of Information Transmission, 23(3).
  4. J. Rissanen (1996). “Fisher information and stochastic complexity.” IEEE Transactions on Information Theory, 42(1).
  5. P. Grünwald (2007). The Minimum Description Length Principle. MIT Press.
  6. A. Barron, J. Rissanen, B. Yu (1998). “The minimum description length principle in coding and modeling.” IEEE Transactions on Information Theory, 44(6).
  7. G. Hinton, D. van Camp (1993). “Keeping neural networks simple by minimizing the description length of the weights.” COLT.
  8. L. Blier, Y. Ollivier (2018). “The description length of deep learning models.” NeurIPS.
  9. S.-M. Udrescu, M. Tegmark (2020). “AI Feynman: a physics-inspired method for symbolic regression.” Science Advances, 6(16).
  10. R. Krichevsky, V. Trofimov (1981). “The performance of universal encoding.” IEEE Transactions on Information Theory, 27(2).