Dropout randomly sets each neuron's output to zero with probability during training:
The scaling (inverted dropout) ensures expected output magnitude stays the same, so no adjustment is needed at inference time.
Why it works:
- Prevents co-adaptation — neurons can't rely on specific other neurons being present, forcing redundant representations
- Implicit ensemble — each forward pass uses a different random subnetwork; inference averages over all subnetworks
- Acts as a stochastic regularizer — similar effect to penalty in linear models
Practical details:
- Common values: – (higher = more regularization)
- Applied after activation functions, typically before the next linear layer
- Disabled at inference — always use full network at test time
- Not used with Batch Normalization in the same block (they interact poorly)
In modern architectures:
- Transformers use dropout on attention weights and after feed-forward layers
- Large pretrained models (GPT-3+) often train with dropout = 0 and rely on data scale instead
- DropPath (stochastic depth) — drops entire residual blocks; used in vision transformers
See also: Regularization, Batch Normalization, Residual Connections