What happens to a model when the i.i.d. assumption is violated in production?
Quick Overview
Asks what happens to a deployed machine learning model when production data stops being independent and identically distributed with its training data. Tests understanding of covariate shift, label shift, concept drift, leaky validation splits and feedback loops, and how to detect and respond to each.
What happens to a model when the i.i.d. assumption is violated in production?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Other
What happens to a model when the i.i.d. assumption is violated in production?
Training, offline evaluation and generalization guarantees all assume that examples are independent and drawn from the same distribution the model will see after deployment. Walk through what breaks when production data violates the "identically distributed" part, the "independent" part, or both.
```hint Split the assumption
Treat "independent" and "identically distributed" separately. Each one fails in a different way and calls for a different fix.
```
```hint Which factor moved
Write the joint distribution as P(x) times P(y | x), or as P(y) times P(x | y), and ask which factor changed between training and production.
```
### What a Strong Answer Covers
- Why offline metrics and generalization guarantees depend on the i.i.d. assumption
- The distinct kinds of distribution shift and what each one does to accuracy and calibration
- How correlated examples inflate validation results and how feedback loops arise
- Why the degradation is often silent, including confident predictions on out-of-distribution inputs
- Practical responses: validation that mimics deployment, monitoring, retraining, reweighting and recalibration
### Follow-up Questions
- How would you detect covariate shift in production when labels arrive weeks late?
- Under label shift, how can you estimate the new class priors without labels and correct the model's probabilities?
- How would you design validation for a model trained on sessions where the same user appears many times?
- How does a recommender's feedback loop bias the training data for the next model, and how can you counter it?
Overview: Asks what happens to a deployed machine learning model when production data stops being independent and identically distributed with its training data. Tests understanding of covariate shift, label shift, concept drift, leaky validation splits and feedback loops, and how to detect and respond to each.
What happens to a model when the i.i.d. assumption is violated in production?
Training, offline evaluation and generalization guarantees all assume that examples are independent and drawn from the same distribution the model will see after deployment. Walk through what breaks when production data violates the "identically distributed" part, the "independent" part, or both.
What a Strong Answer Covers Guidance
Why offline metrics and generalization guarantees depend on the i.i.d. assumption
The distinct kinds of distribution shift and what each one does to accuracy and calibration
How correlated examples inflate validation results and how feedback loops arise
Why the degradation is often silent, including confident predictions on out-of-distribution inputs
Practical responses: validation that mimics deployment, monitoring, retraining, reweighting and recalibration
Follow-up Questions Guidance
How would you detect covariate shift in production when labels arrive weeks late?
Under label shift, how can you estimate the new class priors without labels and correct the model's probabilities?
How would you design validation for a model trained on sessions where the same user appears many times?
How does a recommender's feedback loop bias the training data for the next model, and how can you counter it?