Explain Inverted Dropout Scaling Between Training and Serving
Last updated: November 29, 2026
Quick Overview
An engineer ports a Google Lens image classifier to a new serving stack and accuracy drops because dropout behaves differently. Explain what dropout does, why activations must be rescaled, and where the scaling belongs.
0
0
0 solved
An engineer ports a Google Lens image classifier to a new serving stack and accuracy drops because dropout behaves differently. Explain what dropout does, why activations must be rescaled, and where the scaling belongs.
Train-versus-serve mismatches are a classic source of silent regressions in Google production ML. The question checks that you understand dropout as a regularizer and can reason about expected activations, which matters for anyone touching model export code.
What the Interviewer Expects
- Describe dropout as randomly zeroing units with probability $p$ during training
- Explain why expected activation changes and must be matched at inference
- Describe inverted dropout (divide by $1-p$ at train time) versus scaling weights at test time
- Explain why dropout reduces co-adaptation and acts like an ensemble
- Diagnose the bug: dropout left on at serving, or scaled twice
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- Why does dropout interact badly with batch normalization in some architectures?
- What is Monte Carlo dropout and when would you keep dropout on at inference?
- Why do large pretrained transformers often use little or no dropout?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
I would ask what the serving stack does with the dropout op: is it removed, left in training mode, or replaced by a manual scale? And what keep rate was used in training....
Approach
Derive expected activations under dropout, show the two equivalent scaling conventions, then list the ways a port can get it wrong....