Occam’s razor

Also known as: Ockham's razor · law of parsimony · principle of parsimony

On this page 7

Occam’s razor, also known as the law of parsimony or Ockham’s razor, is the principle that among competing explanations that fit the evidence equally well, the simplest one should be preferred. In AI fundamentals and in artificial intelligence more broadly, it serves as a guiding heuristic for model selection: when two models achieve similar accuracy on observed data, the one with fewer assumptions or lower complexity is expected to generalize better to unseen data.

The principle is named after the fourteenth-century philosopher William of Ockham. Machine learning gave it precise mathematical forms, including Bayesian model comparison, minimum description length and generalization bounds, but it remains a preference, not a law of nature, and modern deep learning complicates its simplest readings.

How Occam’s razor guides learning algorithms

Occam’s razor guides learning by penalizing unnecessary complexity so that a model captures the underlying pattern rather than the noise in its training data. A model that memorizes every training example can reach zero training error yet fail on new inputs, a failure known as overfitting.

Learning algorithms implement the razor through an inductive bias toward simplicity. Decision tree pruning removes branches that add little predictive value, regularization such as L1 or L2 penalties shrinks weights, and early stopping halts training before the model fits noise. Each technique trades a slightly worse fit on training data for better expected performance on test data.

The table below shows how common techniques express the principle in practice.

TechniqueHow it favors simplicityTypical setting
L1 regularizationDrives many weights to exactly zeroSparse linear models
L2 regularizationPenalizes large weightsNeural networks, ridge regression
Tree pruningRemoves low-value branchesDecision trees
Early stoppingLimits effective training timeGradient-based training
Feature selectionKeeps only informative inputsTabular data models
DropoutDiscourages co-adapted unitsDeep neural networks
Techniques that apply a simplicity preference

Formal versions of the principle

Several branches of theory turn the informal razor into measurable quantities. They differ in how they define simplicity, but all of them link shorter or more constrained descriptions to more reliable prediction.

FrameworkMeasure of simplicityCore idea
Minimum description lengthTotal bits for model and dataBest model compresses data most
Bayesian model comparisonMarginal likelihoodComplex models spread probability thinly
Kolmogorov complexityShortest program lengthIdeal but uncomputable measure
Solomonoff inductionPrior weighted by program lengthShorter programs get higher prior
VC dimension boundsCapacity of a hypothesis classLower capacity tightens error bounds
Information criteria (AIC, BIC)Parameter count penaltyFit minus a complexity term
Formal interpretations of parsimony

The Bayesian view is especially instructive: a flexible model must distribute its prior probability across many possible datasets, so it assigns lower evidence to any single outcome. This effect, sometimes called the Bayesian Occam factor, produces a preference for simplicity without any explicit penalty.

Occam’s razor and modern deep learning

Modern deep learning appears to contradict Occam’s razor, because networks with billions of parameters often generalize well even though they can fit random labels. This observation, together with the double descent curve, shows that raw parameter count is a poor measure of complexity.

Researchers now argue that simplicity in deep networks lies in the functions they actually learn, not in their size. Stochastic gradient descent tends to find flat minima and smooth functions, an implicit regularization that acts like a built-in razor. The principle therefore survives, but in a more subtle form.

AspectClassical readingModern deep learning reading
Complexity measureNumber of parametersNorms, flatness, compressibility
Source of simplicityExplicit penaltiesOptimizer and architecture biases
OverparameterizationExpected to overfitOften generalizes well
Test error curveU-shapedDouble descent possible
Classical and modern readings compared

Applying the razor in model selection

In practice, the razor acts as a tie-breaker, not a replacement for validation. Practitioners compare candidate models on held-out data and choose the simpler model only when the difference in performance is within statistical noise.

SituationRecommended choiceReason
Equal validation accuracySimpler modelLower variance, easier maintenance
Complex model clearly betterComplex modelEvidence outweighs the preference
Small training datasetStrong regularizationLimited data cannot support complexity
Interpretability requiredSparse or rule-based modelDecisions must be explained
Large data and computeScaled model with regularizersImplicit biases control overfitting
Decision guidance for choosing between models

Simpler models bring practical benefits beyond accuracy: lower inference cost, easier debugging, fewer failure modes and clearer explanations for auditors. These operational advantages often justify a simpler choice even when a complex model is marginally better.

Misconceptions and limits

The razor is frequently misread as a claim that simple explanations are always true. It only says that, given equal explanatory power, simplicity is the better bet. The no free lunch theorem reminds practitioners that no bias, including a simplicity bias, helps on every possible problem.

  • Simplicity depends on representation: a function that looks complex in one encoding can be short in another.
  • Oversimplification causes underfitting, which is as harmful as overfitting.
  • Parameter count alone misleads, especially for overparameterized neural networks.
  • The razor does not replace evidence; validation results take priority.

A further limit concerns what counts as an assumption. Two models with the same number of parameters can embody very different prior commitments, and a model with more parameters may encode weaker assumptions about the data. Experienced practitioners therefore judge simplicity by behavior on held-out data, robustness to distribution shift and ease of explanation, rather than by any single numeric proxy. Used this way, the razor remains a valuable discipline that keeps model development honest about the evidence it actually has.

The idea in brief

Occam’s razor says: do not make things more complicated than needed. If two explanations fit the facts equally well, pick the simpler one.

In AI, this helps a system learn real patterns. A model that is too complex can memorize its examples. It then fails on new cases. A simpler model often handles new situations better. Still, simple is not always right. The data must decide first, and simplicity only breaks the tie.

A practical scenario

A data science team at a regional bank builds a model to predict loan defaults from about 40,000 historical applications. A gradient-boosted ensemble with 1,500 trees reaches an AUC of 0.861 on validation data. A logistic regression with 14 carefully selected features reaches an AUC of 0.856.

Repeated cross-validation shows that the gap is within the range of random variation. The team applies Occam’s razor and deploys the logistic regression. It runs faster, its coefficients can be explained to regulators, and it is easier to monitor for drift.

Six months later, a shift in applicant demographics occurs. The simpler model loses only two points of AUC, while a shadow copy of the ensemble loses five, which confirms that the parsimonious model generalized more robustly.