Skip to content
Kudos AI
Lire en français
Statistical Learning Theory

One Parameter, Infinite Capacity

A classifier with exactly one real parameter fits all 1,048,576 labellings of twenty points, every time, and predicts a twenty-first at 0.5038 accuracy over twenty thousand trials. Counting parameters measures neither an upper nor a lower bound on what a model class can fit, which is why capacity has to be measured some other way.

4 min readKudos AI

Prerequisites: Why Learning From Data Works At All

Points on a line taking every labelling in turn while a single dial turns, the decision boundary reorganising completely at each twitch of it.

Here is a classifier. It takes a real number xx, has one real parameter θ\theta, and predicts

hθ(x)=sign⁡(sin⁡(θx)).h_\theta(x) = \operatorname{sign}\left(\sin(\theta x)\right).

One parameter. Fewer than a straight line through the origin has in two dimensions, which is usually where people put the cheap end of the scale.

Put twenty points at xi=2−ix_i = 2^{-i} for i=1,…,20i = 1, \dots, 20 and hand it any labelling you like of those twenty points. There are 220=1,048,5762^{20} = 1{,}048{,}576 of them. A single value of θ\theta realises every one, checked exhaustively.

A. How it does it

The trick is that θ\theta is not being used as a knob. It is being used as a tape.

Take the labels y1,…,ymy_1, \dots, y_m, each ±1\pm 1, and set

θ=π(1+∑i=1m1−yi2 2i).\theta = \pi\left(1 + \sum_{i=1}^{m} \frac{1 - y_i}{2}\, 2^{i}\right).

Then θxi=θ2−i\theta x_i = \theta 2^{-i} picks out the binary expansion of θ/π\theta/\pi from digit ii onward, and the sign of the sine reads off the bit that was written there. Each label occupies its own binary place, and nothing collides, because the points were chosen an octave apart.

A real number holds infinitely many bits. There is no mm at which this stops working, so the class {hθ}\{h_\theta\} shatters sets of every finite size and its VC dimension is infinite.

B. It learns nothing

Fit the twenty points with random labels, then ask about a twenty-first point at x21=2−21x_{21} = 2^{-21}, also labelled at random. Over 20,000 trials: training accuracy 100% every time, held-out accuracy 0.5038.

That is exactly what "infinite VC dimension" means operationally. The twenty labels fix the first twenty bits of θ/π\theta/\pi and say nothing whatsoever about the twenty-first, so the prediction on a new point is a coin flip. The model has perfect memory and no generalisation at all, and the distribution-free bounds correctly refuse to say anything about it.

So far this is a curiosity. The part worth keeping is what it does to parameter counting.

C. Parameter count is not an upper bound

The natural reading of "one parameter" is "this class cannot express much". The sine classifier says that reading is simply wrong. Capacity is about how many distinct labellings a class can produce on a finite sample, and the number of parameters constrains that only when the parameters are used the way we expect them to be: continuously, locally, one direction of variation each.

Linear separators in Rd\mathbb{R}^d have VC dimension d+1d + 1, so the intuition survives there and generalises badly beyond it. A single real number can carry a whole training set.

For contrast, the figure shows a class with two parameters whose capacity really is finite: with one interval on three points it reaches 7 of the 8 labellings and cannot produce (1, 0, 1).

Interactive: find the labelling it cannot produce

Click a point to flip its label.

1x = 11x = 20x = 3
This labelling
reachable
Labellings reachable
7 / 8
VC dimension
2
Hypothesis class:

Reachable, and the interval drawn around the ones is the hypothesis that does it. Keep going: 1 of the eight labellings cannot be produced at all. Try to find one before pressing the button.

D. And it is not a lower bound either

The reverse direction fails too, and this is the one that matters in practice.

Add a margin requirement to linear separators: classify correctly with all points at distance at least γ\gamma from the boundary, with the data inside a ball of radius RR. The capacity of that restricted class is bounded by R2/γ2R^2 / \gamma^2 regardless of the dimension. Push dd to infinity, which is what a kernel does, and that bound does not move at all: the constraint has removed almost every function the parameters could otherwise express, and what is left is governed by a scale rather than by a count.

Modern networks are the same phenomenon at a larger scale. They have more parameters than training examples, so parameter counting places their capacity above nn and every classical bound built on it is vacuous. They generalise anyway. The parameters are not free to take arbitrary values: they are reached by a particular optimiser, from a particular initialisation, under weight decay and early stopping and data augmentation, and the set of functions actually reachable that way is far smaller than the set the architecture could express.

E. What to measure instead

If the count does not bound capacity in either direction, the honest options are empirical.

  • Try to fit random labels. If a model can achieve zero training error on the same inputs with the labels shuffled, its effective capacity on that sample is at least nn, and any explanation of its real performance has to come from somewhere other than the size of the hypothesis class.
  • Measure the margin, and the norm. For the classes where a bound does exist, the quantity in it is a scale, not a count: R2/γ2R^2/\gamma^2 for separators, weight norms for networks. Those are things you can compute after training.
  • Hold something out, and hold it out properly. A validation estimate is a direct measurement of what the bounds are trying to bound, and it remains the only capacity measure that is always available.
  • Be suspicious of any capacity claim made before training. The sine classifier is one line of code away from looking like the simplest model in the world.

Capacity is a property of what a procedure can actually reach, not of how many numbers it happens to store.

References & further reading

  • Gareth James, Daniela Witten, Trevor Hastie, Robert Tibshirani, An Introduction to Statistical Learning, with Applications in R, Springer (Springer Texts in Statistics 103), 2013source ↗
  • Ian Goodfellow, Yoshua Bengio, Aaron Courville, Deep Learning, MIT Press (Adaptive Computation and Machine Learning), 2016source ↗

Copyrighted works are cited for reference only and are not hosted here; please consult the publisher for access.

Related reading

4 min readStatistical Learning Theory

The Theorem That Says Nothing About Your Problem

Averaged over all 256 functions from three bits to one, a nearest-neighbour learner and a learner built to be wrong on purpose both score exactly 0.500000 off the training set. That is the no free lunch theorem, it is exactly true, and the moment the average is restricted to the six functions that depend on a single bit the two separate to 0.333333 and 0.666667.

Machine LearningMathematics
7 min readStatistical Learning Theory

Why Learning From Data Works At All

The gap between the error you measure and the error you will suffer, why picking the best of a thousand identical hypotheses makes it look 0.1149 better than chance, how capacity is counted for infinite model classes, and the theorem that equalises every learner - with the assumption that makes it true.

Machine LearningMathematics
7 min readStatistical Learning Foundations

The Bias-Variance Tradeoff

The exact decomposition of expected test error into squared bias, variance, and irreducible noise, demonstrated numerically with a 2,000-run simulation where all three terms are measured separately and shown to add up.

StatisticsMachine LearningMathematics
← Back to all articles