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.
Prerequisites: Why Learning From Data Works At All
Here is a classifier. It takes a real number , has one real parameter , and predicts
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 for and hand it any labelling you like of those twenty points. There are of them. A single value of realises every one, checked exhaustively.
A. How it does it
The trick is that is not being used as a knob. It is being used as a tape.
Take the labels , each , and set
Then picks out the binary expansion of from digit 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 at which this stops working, so the class 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 , 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 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 have VC dimension , 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.
- This labelling
- reachable
- Labellings reachable
- 7 / 8
- VC dimension
- 2
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 from the boundary, with the data inside a ball of radius . The capacity of that restricted class is bounded by regardless of the dimension. Push 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 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 , 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: 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.