Part 10 of my "revisiting my AI/ML notes" series. Everything so far has been about getting a network to learn at all. This post is about a different problem: getting it to learn the right things, instead of just memorizing the training data.
The problem: overfitting
A network with enough capacity can, given enough training time, essentially memorize its training set — including its noise and quirks — instead of learning patterns that generalize to new data. It looks great on training metrics and falls apart on anything it hasn't seen before. Two standard techniques exist specifically to prevent this: regularization (L1, L2) and dropout.
Dropout
Dropout, introduced by Nitish Srivastava and Geoffrey Hinton in 2014, is disarmingly simple: during training, randomly "turn off" a fraction of neurons in a given layer on every forward pass.
- A dropout probability like
p = 0.5means roughly 50% of neurons in that layer are randomly zeroed out on each pass. - Which specific neurons get dropped changes every single pass — no neuron can become over-reliant on always being present, and no neuron can "specialize" in memorizing one specific training quirk, because it might not even be active next time.
- At test time, no neurons are dropped — the full network is used. To keep the overall signal strength consistent between training and testing, the weights (or activations, depending on implementation) are scaled by
(1 - p).
This forces the network to spread useful information across many neurons instead of concentrating it in a few, which is exactly what generalization needs.
Choosing the dropout rate
The dropout probability p is a hyperparameter, and it needs tuning like any other:
- Too high, and you're removing so much of the network on each pass that it struggles to learn anything useful — underfitting.
- Too low, and you're barely regularizing at all — the overfitting problem you were trying to solve doesn't really go away.
Standard practice is to search over this value (hyperparameter tuning) rather than guessing, checking performance on validation data to find where the tradeoff actually lands for your specific problem.
Why this matters
Dropout and its cousin, weight regularization, are two of the most reliable tools for keeping a network's performance on unseen data close to its performance on training data. Without them, deep networks — which have enormous capacity to memorize — very often look excellent on paper and fail quietly in production.
Original Notes:


Top comments (0)