The interview problem

Practice prompt

Explain the scaling used by inverted dropout and what it preserves during training.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

For activation x and independent Bernoulli keep mask m with keep probability p, use y=mx/p during training and the unmasked activation at inference. Conditional on x, the expectation of y is x. This preserves the local mean, not equality of whole-network predictions through nonlinear layers. Specify whether masks are shared across time or features for the architecture.

2. Trace the design or derivation

Sample mask
  → scale retained activation
  → train
  → disable ordinary dropout at inference

Conditioning on x, E[y²]=x²/p, so Var(y)=x²(1/p−1). This gives 16 for the example. Correlated masks change covariance between activations even if each marginal mean is preserved; the mask-sharing convention therefore matters for sequence models and structured inputs.

3. Calculate the example

For x=4 and p=0.5, y is 0 or 8 with equal probability. Mean is 4 and variance is 16. Removing the scaling would give mean 2. The increased variance is part of the training perturbation.

4. Failure cases and trade-offs

Training-mode dropout left on during ordinary inference makes outputs stochastic. Heavy dropout can underfit, and batch normalization interactions require care. Stochastic inference may support an uncertainty heuristic, but it is not automatically calibrated epistemic uncertainty. Tune against held-out task metrics.

5. Validation, follow-ups and self-review

Verify empirical mean and variance over many independent masks. Follow-up: how would dropout on recurrent connections differ from independent per-step masking? Self-review: distinguish preserved expectation from preserved prediction.

Sources and related practice

Technical reference: docs.pytorch.org — Training dropout and scaling conventions.

Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Overfitting, regularization, and early stopping; Compare batch and layer normalization.

Continue your preparation

Choose a connected learning path or browse more ML fundamentals questions. Read our editorial method and attribution policy.