Dropout

Dropout is a training technique for neural networks that randomly switches off a share of units at each training step, so the network cannot lean too heavily on any one of them and overfits less.

A neural network is made of many units, or neurons, passing signals to one another. With dropout, each time the network trains on a batch of examples, every unit in a chosen layer is switched off at random with some probability, say one in two. The next batch gets a different random selection. When the trained network is put to use, nothing is switched off and every unit takes part.

The point is to stop units from depending on each other too much. If any unit might vanish at any moment, each one has to learn something useful on its own rather than relying on a particular partner to correct it. Google's machine learning glossary compares the effect to training the network to emulate an exponentially large ensemble of smaller networks. That makes dropout a form of regularisation: a way of reducing overfitting, where a model memorises its training data and does badly on new data.

The technique was introduced in a July 2012 paper by Geoffrey Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever and Ruslan Salakhutdinov, which randomly left out half of the network's feature detectors on each training case and reported large gains on speech and object recognition benchmarks. A fuller 2014 paper in the Journal of Machine Learning Research, titled Dropout: A Simple Way to Prevent Neural Networks from Overfitting, reported improvements across vision, speech recognition, document classification and computational biology.

Here is how it looks in a common framework. PyTorch's dropout layer has a default probability of 0.5. During training it sets each value to zero with that probability and scales the survivors up by 1/(1 - p), so with p at 0.5 half the values become zero and the rest are doubled, keeping the overall signal the same size. In evaluation mode the layer does nothing at all.

Dropout is a training setting, not something a user of a finished model ever sees. The rate is a hyperparameter that developers tune, and it is one of several tools against overfitting alongside more data, weight penalties and early stopping. It is not always switched on: Hugging Face's TRL library, for example, turns dropout off by default when it runs preference training with DPO.

Common questions

What does dropout do in a neural network?

During training it randomly sets a fraction of a layer's units to zero on each step, so the network cannot rely on any particular unit. This reduces overfitting and usually helps the model perform better on new data.

What is a good dropout rate?

There is no universal value; it is a hyperparameter tuned for each model. The original 2012 work dropped half of the hidden units, and PyTorch's dropout layer defaults to a probability of 0.5, but many models use lower rates or none.

Is dropout used when a model is running?

No. Dropout is applied only during training. When the model is used for predictions, all units are active, and frameworks such as PyTorch scale values during training so that nothing needs adjusting afterwards.

Who invented dropout?

It was introduced by Geoffrey Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever and Ruslan Salakhutdinov in a 2012 paper, followed by a fuller 2014 paper led by Srivastava in the Journal of Machine Learning Research.

Finding more

Search for "dropout regularization", "dropout neural network" or "Srivastava dropout 2014" to read more. The original papers on arXiv and in the Journal of Machine Learning Research, Google's machine learning glossary and the documentation for frameworks such as PyTorch and Keras are reliable. Tutorials vary in quality, so check any rule of thumb about dropout rates against the framework's own documentation.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.