Minimum description length

Also known as: MDL principle

On this page 7

Minimum description length (the MDL principle) is a formal criterion for choosing among models: the best explanation of a dataset is the one that lets you compress it the most, counting both the length of the model description and the length of the data once encoded with that model. Among the ideas that form the theoretical core of artificial intelligence and machine learning, it turns Occam’s razor into a measurable quantity.

The principle was introduced by Jorma Rissanen in 1978 and builds on information theory and Kolmogorov complexity. It links learning with compression: any regularity in data can be used to describe that data with fewer bits, so finding structure and finding a short code are the same task.

How the MDL principle scores a model

The classic two-part code splits the total cost into two terms. L(H) is the number of bits needed to state the hypothesis H, including its structure and parameter values, and L(D|H) is the number of bits needed to encode the data D when the receiver already knows H. MDL selects the hypothesis that minimizes L(H) + L(D|H).

The two terms pull in opposite directions. A very simple model is cheap to state but fits poorly, so the residual errors cost many bits. A very flexible model fits every point, yet describing its many parameters costs more than it saves. The minimum sits where added complexity stops paying for itself, which is how MDL guards against overfitting without a separate validation set.

Code lengths connect to probabilities through the Shannon relation: an event with probability p can be encoded in about -log2 p bits. Minimizing code length is therefore closely tied to maximizing probability, with the important addition of an explicit price for model complexity.

Each component of the two-part score, and what drives its size, is summarized here.

ComponentWhat it measuresGrows when
Model cost L(H)Bits to describe structure and parametersParameters are many or very precise
Data cost L(D|H)Bits to encode data given the modelFit is poor or noise is high
Total description lengthSum of both costsModel is too simple or too complex
Parameter precisionBits per encoded parameterSample size increases
Components of a two-part MDL score

Crude, refined and practical forms of MDL

MDL exists in several formulations that differ in how rigorously the model cost is defined. The early two-part version depends on arbitrary choices of how to encode parameters, which later work replaced with codes that have provable optimality properties.

VariantCore ideaTypical use
Crude two-part MDLSeparate codes for model and dataTeaching, quick model comparison
Normalized maximum likelihoodMinimax optimal universal code for a model classRigorous selection with parametric complexity
Bayesian mixture codeData encoded with a prior-weighted mixtureLinks MDL with Bayesian evidence
Prequential MDLEach point coded by a model fit on earlier pointsSequential data, neural network evaluation
Asymptotic approximationPenalty of about (k/2) log2 n bitsFast scoring of large model families
Main variants of minimum description length

The asymptotic penalty of (k/2) log n for k parameters and n observations matches the Bayesian information criterion, which is why BIC is often called a rough MDL approximation. Refined MDL also accounts for the geometry of the model class, so two models with the same parameter count can receive different complexity costs.

Minimum description length belongs to a family of methods that trade fit against complexity, but its justification is distinct. MDL does not assume that a true model exists in the candidate set; it seeks the best compressor available, a stance that suits misspecified real-world problems.

ApproachBasisKey difference from MDL
Kolmogorov complexityShortest program producing the dataUncomputable; MDL restricts codes to model classes
Solomonoff inductionPrior over all programsIdealized prediction, not a practical tool
Bayesian information criterionAsymptotic marginal likelihoodMatches only the leading MDL term
Akaike information criterionExpected predictive divergenceSmaller penalty, aims at prediction
Cross-validationEmpirical held-out errorNeeds data splits, no coding view
MDL and neighboring approaches to model selection

The relation to Bayesian inference is close but not identical. With suitable codes the two often give the same ranking, yet MDL treats probability distributions as coding devices rather than beliefs, which avoids debates about subjective priors.

Applications in machine learning

MDL appears wherever a learner must decide how much structure the data supports. Typical uses include the following:

  • Polynomial and regression order: choosing the degree that compresses the data best.
  • Decision tree pruning: removing branches whose description costs more than the errors they prevent.
  • Clustering and mixture models: selecting the number of components.
  • Pattern and rule mining: keeping the itemsets that compress a database most effectively.
  • Neural network analysis: prequential code length as a measure of generalization and representation quality.

In deep learning research, MDL supports the observation that generalization relates to compressibility. Prequential coding estimates how many bits a network needs to learn a dataset online, and lower code length signals that the architecture captures real regularities rather than noise.

Limitations and frequent misunderstandings

MDL is principled but not automatic. The result depends on the chosen code or model class, and a poor choice of parameter encoding in crude two-part form can bias selection. Computing the normalized maximum likelihood term is intractable for many complex models, so practice relies on approximations.

  • Shorter is not truer: MDL picks the best compressor in the candidate set, not a guaranteed true model.
  • Not plain file compression: running a ZIP tool on data is only a loose proxy for MDL.
  • Small samples: asymptotic penalties can mislead when n is small.
  • Deep networks: naive parameter counting overstates complexity, so prequential or variational codes are preferred.

In simple terms

Imagine sending a long list of numbers to a friend over an expensive line. You can send every number one by one. Or you can send a short rule plus corrections, such as each number is twice the one before.

Minimum description length says the best explanation is the shortest message. It counts both the rule and the corrections. A rule that is too simple needs many corrections. A rule that is too detailed is long by itself. The winning rule sits in between.

A practical example

An engineer at a power utility fits a curve to two years of hourly load data, about 17,500 points, and must decide how many seasonal terms to include. A model with 4 Fourier terms leaves large residuals, while one with 60 terms traces noise from individual holidays and storms.

Using an MDL score with a (k/2) log n penalty, each candidate is scored as residual code length plus parameter cost. The total falls steeply up to about 12 terms, then rises slowly as extra terms add more parameter bits than they save on residuals. The engineer selects the 12-term model.

When tested on the following quarter, the selected model gives lower forecast error than the 60-term version, confirming that the shortest total description captured the real daily and weekly cycles while ignoring one-time events.