---
title: Explain what dropout does during training and inference, why it regularises, and how it interacts with batch…
url: https://gurkanozkan.ai/learn/questions/mle-why-dropout-works-04/
markdown: https://gurkanozkan.ai/learn/questions/mle-why-dropout-works-04.md
kind: question
role: ML engineering
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/mle-why-dropout-works-04.json
robots: noindex
---

# Explain what dropout does during training and inference, why it regularises, and how it interacts with batch normalisation.

ML engineering · Technical · Medium

## Answer

*Model answer, written in a candidate's voice*

### In short

- Training: randomly zero units with probability p; inverted dropout scales kept units by 1/(1-p).
- Inference: dropout off, all units active, no scaling.
- Regularisation: less co-adaptation, noise injection, implicit ensemble of subnetworks.
- Placement: rare in conv layers and modern transformer attention; common in MLP heads.
- BN interaction: train/test variance shift; place dropout after BN or use sparingly.

### In full

Dropout randomly sets a fraction p of activations to zero during training; with inverted dropout the surviving units are scaled by 1/(1-p), so the expected activation is unchanged and at inference dropout is simply turned off, with all units active and no rescaling. It regularises by preventing units from co-adapting to each other, injecting noise, and approximating an ensemble over many subnetworks, which makes the learned features more robust rather than memorising one fixed pathway. It is usually used sparingly in conv layers and in modern transformer attention, but more commonly in MLP heads and classifier layers. With batch normalisation the interaction is delicate: BN uses batch statistics in training and running statistics at test time, while dropout changes the activation distribution and variance, so train and inference behaviour can drift apart. In practice I place dropout after BN or keep it light, and I validate rather than assume it helps.

*Checked against sources by an independent AI reviewer.*

## What a strong answer covers

- Randomly zeroes units with probability p. Inverted dropout scales the kept units by 1/(1−p) so that inference needs no scaling.
- Interpretations: an implicit ensemble of subnetworks, less co-adaptation, noise injection.
- Placement and rates: rare in conv layers and modern transformers' attention; common in MLP heads.
- Interaction with BN: variance shift between train and test, so dropout is usually placed after BN or used sparingly.

## Common mistakes

- leaving dropout active at inference (forgetting `model.eval()`)
- scaling twice.

## Topic guides

- [Deep learning fundamentals](https://gurkanozkan.ai/learn/topics/deep-learning.md)
- [Training neural networks: losses, optimisers, numerics and scale](https://gurkanozkan.ai/learn/topics/training.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
