The best way researchers found to stop a neural network from memorizing its training data was to randomly sabotage it while it learns. The same trick, at the wrong moment, now makes models worse. Both are true.
1) The problem: neurons form cliques
A neural net is layers of small computing units ("neurons") passing signals along. Left alone they co-adapt: Neuron A only works if Neuron B fires a certain way, so the net learns a tangled shortcut that nails the training data and falls apart on anything new. That's overfitting.
2) The fix: bench a random slice, every step
Dropout (Srivastava, Hinton et al., 2014) switches off a random subset of neurons on every training step. No neuron can count on a specific teammate showing up, so each has to carry weight alone. Rotating understudies, nobody irreplaceable.
3) The clever part
You aren't training one network. Each step trains a different thinned version, all sharing one set of weights, so you train an exponential number of them at once. At test time you turn dropout off and the full network approximates averaging that ensemble, in one forward pass.
In code, torch.nn.Dropout zeroes elements with probability p and scales the survivors by 1/(1-p) during training, so the expected signal doesn't shrink. In eval mode it's an identity function. Forget model.eval() and you ship noise into every prediction.
4) Modern LLM pretraining turned it off
The 2017 Transformer paper used p=0.1 on its sublayer outputs and embeddings. But "Drop Dropout on Single-Epoch Language Model Pretraining" (ACL Findings, 2025) found downstream performance improves when dropout is left out. If a model sees each token once, it can't memorize the set. The data is the regularizer.