Dropout Regularization
Dropout trains a neural network by randomly switching off a fraction of its units on every pass, forcing the network to stop leaning on any single unit and produce something closer to an average over many smaller networks.
Prerequisites: The Multilayer Perceptron, The Bias-Variance Decomposition
A large neural network has enough capacity to memorize its training data outright — including the noise. Left unchecked it will happily wire up a handful of units to detect quirks of specific training examples rather than genuine patterns, the way a research team that always works together starts covering for each other's blind spots instead of each person independently getting the analysis right. The team looks great on the deals they've already seen and falls apart on a new one.
Dropout breaks up that team on purpose. On every training pass, each hidden unit is temporarily deleted — its output forced to zero — with some fixed probability, independently of every other unit. A different random subset of the network trains on every batch, so no unit can count on any particular teammate being present. Each one has to become independently useful.
The mechanics, one symbol at a time
Let be a layer's output vector before dropout, and let be the keep probability (the chance any given unit survives this pass). Draw a random mask for each unit , where with probability and otherwise:
In words: flip an independent, biased coin for every unit on every pass; if it comes up "drop," that unit's output is zeroed for this pass only, as if it did not exist. At test time you want the network's full capacity, so no units are dropped — but their outputs must then be scaled by (or equivalently, scaled by during training, the more common convention), because at training time each surviving unit was implicitly compensating for its missing neighbors and would otherwise produce outputs that are too large on average.
Worked example 1: one forward pass with a fixed mask
A layer with four units produces raw outputs . Keep probability , and this pass's coin flips give the mask .
Masked output: .
Using the "scale during training" convention, divide the surviving units by : . The next layer sees a network that, this batch, only has units 1 and 3 to work with, boosted so their expected contribution matches what the full network would have produced.
Run the next batch and a different mask might be — a completely different sub-network trains on that pass. Over thousands of batches, the model has effectively trained something close to an enormous ensemble of overlapping smaller networks, all sharing the same weights.
Worked example 2: why it stops units from co-adapting
Suppose unit A has learned to detect "earnings surprise" and unit B has learned to detect "earnings surprise, confirmed by unit A" — B has become a parasite riding on A rather than an independent detector. Without dropout, that costs nothing during training because A is always present. With dropout at , unit A is absent on roughly half of all passes. On those passes, B's parasitic signal is worthless — it contributes nothing useful to the prediction, and the loss punishes the network for it. Over many passes, gradient descent is pushed toward B learning something that works whether or not A happens to be present that pass — an independently useful feature rather than a redundant echo. That is precisely what "prevents co-adaptation" means in practice.
Drag the complexity slider in the explorer above: dropout is one of the standard tools for pulling a model back from the high-variance, overfit side of that curve without shrinking its raw capacity, by making the effective model simpler on every individual pass.
What this means in practice
Dropout is typically applied to fully connected layers, with around 0.5 for hidden layers and closer to 0.8–0.9 for inputs (you rarely want to delete raw features outright). It is usually turned off — or replaced with the milder recurrent-dropout variants — inside recurrent layers, because randomly deleting a unit at every timestep of a sequence destroys the very memory those units are meant to carry. In modern architectures that already have batch normalization and residual connections, dropout is used more sparingly than in the era it was introduced, since those other tools provide some regularizing effect on their own; stacking all three aggressively can under-fit.
Dropout regularizes by training a different random sub-network on every pass and effectively averaging over all of them, which stops units from relying on specific co-workers being present and forces each one to be independently useful.
The classic confusion: forgetting to switch dropout off at test time, or forgetting the compensating scale factor. If units keep getting randomly zeroed during inference, predictions become noisy and non-reproducible — same input, different answer on every call — and if the scale factor is mismatched between training and inference conventions, every prediction is systematically biased even though the model "looks fine" in training loss.
Practice in interviews
Further reading
- Srivastava et al., Dropout: A Simple Way to Prevent Neural Networks from Overfitting
- Goodfellow, Bengio & Courville, Deep Learning, ch. 7