Foundations

Inductive Bias: The Assumptions Every Learner Has to Make

Why data alone cannot decide what happens on new inputs, which assumptions common models build in, and how to choose them on purpose.

Key takeaways

  • A finite dataset is consistent with many different functions, so generalizing requires a preference that comes from outside the data.
  • Some bias restricts which functions are possible, and some ranks the possible ones, for example by favoring small weights.
  • Model architectures encode assumptions such as smoothness, locality, order or symmetry.
  • The optimizer, initialization and stopping rule add preferences of their own, even when nobody intended them.
  • A bias that matches the problem saves large amounts of data, while a mismatched one puts a ceiling on accuracy.

Inductive bias is the set of assumptions that lets a learning method choose among the many explanations that fit its training data equally well. Without such assumptions there is no reason to predict one thing over another on an input you have never seen.

So the question is never whether your model makes assumptions. It is which ones, whether they suit your problem, and whether you picked them or inherited them by accident.

Why data is not enough

Take a function of three yes-or-no inputs. There are 8 possible input patterns. Suppose your training data shows the correct answer for 5 of them.

How many functions agree with those 5 answers? The other 3 patterns can each be answered either way, so there are 2³ = 8 functions that fit perfectly. On any one unseen pattern, four of them say yes and four say no. Counting all consistent functions equally gives you no prediction at all.

To get one, you must prefer some of the eight. You might prefer the rule that is shortest to write, or assume the output depends on only one input, or predict like the most similar seen pattern. Each preference is an inductive bias, and each can give a different answer. None is justified by the five rows alone.

This connects to the no free lunch theorems: averaged over every conceivable target function, no preference beats another. Preferences pay off because the problems we care about are not drawn uniformly from all possible functions.

Two forms of bias

A restriction bias limits the hypothesis space. A linear model cannot represent a circle in its raw inputs, however much data suggests one.

A preference bias keeps many functions available but favors some. A penalty on squared weights allows large weights if the data insist, while leaning toward small ones. A decision tree algorithm that greedily picks the most informative split first tends to produce trees with strong predictors near the root.

Preference is often the safer of the two, since evidence can overrule it. Restriction is stronger medicine: very data-efficient when right, and permanently wrong when it is not.

Assumptions built into common models

Method Main assumption
Linear and logistic regression Effects add up, and each feature acts through a weighted sum
k-nearest neighbors Points that are close, by your distance, have similar outputs
Decision trees The answer changes at thresholds on individual features
Naive Bayes Features are independent of one another given the class
Lasso (L1 penalty) Only a few features matter much
Margin-based classifiers A boundary far from the training points is preferable
Convolutional networks Nearby pixels relate, and a pattern means the same thing wherever it appears
Recurrent networks Order matters, and the same update applies at each step
Graph networks Relations matter, and the numbering of nodes does not
Where a learner's preferences come from
Inductive bias What decides between equally good fits Data augmentation Which changes should not matter Optimizer Which solutions get found Features What the model can see Architecture Which structure is built in Penalties Which solutions cost more Inductive bias What decides between equally good fits Features What the model can see Architecture Which structure is built in Penalties Which solutions cost more Optimizer Which solutions get found Data augmentation Which changes should not matter

Symmetry as a powerful assumption

Many problems have changes that should leave the answer alone, or alter it in a predictable way. Shifting a cat a few pixels does not make it a dog. The total price of a shopping basket does not depend on the order the items are listed.

A quantity is invariant to a change if it stays the same, and equivariant if it changes in step. A convolution layer is, apart from edge effects and with a stride of 1, equivariant to shifts: move the input and the feature map moves with it. Pooling over positions then produces something close to invariance.

You can build symmetry into the architecture, or encourage it by adding transformed copies of training examples. The second route needs care. Mirroring photos of animals is usually harmless, but mirroring images of text or road signs can change their meaning.

The same data, three different predictions

Suppose you observe the points (1, 2), (2, 4) and (3, 6) and are asked for the output at x = 10.

  • A linear model through the origin continues the trend and answers 20.
  • A nearest-neighbor predictor with k = 1 copies the closest observed point and answers 6.
  • A model that assumes outputs return to the average when far from data answers about 4, the mean of the targets.

All three fit or summarize the observations in a defensible way. If x is the number of identical items and y their total cost, the first is surely right. If x is hours of study and y a test score capped at 6, the second is closer. If x is a meaningless code and the apparent trend a coincidence, the third is the cautious choice.

The deciding fact is what x and y are, and that knowledge sits with you until you encode it. This is the main reason careful feature construction and model choice repay time spent understanding the domain.

The bias you did not ask for

Optimization has preferences. Consider a single training equation with two unknown weights, w₁ + w₂ = 2, from the input (1, 1) with target 2. Every pair on that line gives zero squared error: (2, 0), (0, 2), (5, −3) and so on.

Gradient descent started at (0, 0), with a suitably small step size, changes both weights by identical amounts, because both inputs equal 1. It converges to (1, 1), which is the solution with the smallest sum of squares. No penalty was written anywhere, yet one solution was selected. Start somewhere else and you get a different one.

For linear least squares this effect is well understood. For deep networks, the implicit bias of training is an active research subject, and it is likely part of why very large models can still generalize.

Feature scaling is another hidden source. In nearest-neighbor methods, a column measured in dollars can swamp one measured in years. Choosing units amounts to declaring which differences count.

Matching bias to problem

Ask what you know before seeing the data.

  1. Should the output change smoothly as inputs change, or jump at thresholds?
  2. Is there a direction that must hold, such as risk not decreasing as a hazard grows?
  3. Which transformations of the input should not matter?
  4. Do you expect a few strong factors or many weak ones?
  5. Is there structure, such as sequence, grid, hierarchy or network?

Each answer points toward a model, a feature or a constraint. If domain experts are available, these questions make a productive first meeting.

Then test. Compare two or three candidates with genuinely different assumptions using held-out data. If trees and linear models perform alike, the relationship may be simple. A large gap in either direction tells you something about the shape of the problem.

Penalties as stated preferences

Regularization makes a preference explicit and adjustable. An L2 penalty adds λ times the sum of squared weights to the training loss, expressing a belief that effects are mostly modest and spread out. An L1 penalty adds λ times the sum of absolute values and tends to set some weights exactly to zero, expressing a belief that few features matter.

In probabilistic terms, many penalties correspond to a prior distribution over parameters: a Gaussian prior matches the squared penalty and a Laplace prior matches the absolute one, when you look for the single most probable parameter values. The link is explained in maximum a posteriori estimation.

The strength λ says how firmly you hold the belief against the evidence. Choose it on validation data. If the best value turns out to be near zero, the data are telling you the preference was not helping; if it is very large, the features may carry less signal than hoped.

Scale matters here as well. A weight depends on the units of its feature, so the same penalty treats a length in millimeters and in kilometers differently. Standardizing features, using statistics from the training data only, makes the preference even-handed. This is one more example of a choice that looks like housekeeping and is really an assumption about which solutions should be cheap.

Strong bias, weak bias and data

With little data, strong and roughly correct assumptions usually win, because they cut down variance. With abundant data, weaker assumptions can catch up and pass them, since the data can teach what would otherwise have been built in. Image recognition shows both sides: convolutional structure helps greatly on modest datasets, while models with fewer built-in spatial assumptions have become competitive when trained or pretrained on very large ones.

Transfer learning can be read the same way. Starting from a pretrained model gives your small task a bias learned from a larger one. It helps when the two tasks share structure and can hurt when they do not.

When a model fails on a particular kind of input, ask which assumption that input violates. A tree cannot extend a trend past the edge of its training range. A linear model misses an interaction nobody added. Naming the broken assumption usually suggests the repair.

Common questions

Is inductive bias something to remove?

No. A learner with no preferences cannot generalize. The goal is preferences that fit the problem and are stated openly enough that you can question them.

Is this the same as social bias in data?

They are different ideas that share a word. Inductive bias is a technical property of a learning method. Social or sampling bias concerns skews in who is represented and how outcomes were recorded. Both deserve attention, and fixing one does not fix the other.

Written for 4MachineLearning with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 42 articles in Foundations →

Latest news on this topic