ML SYSTEM DESIGN & MLOPS Β· INTERVIEW QUESTION
What is data drift and concept drift? How do you detect and handle them?
π‘ intermediate Β· Monitoring & Observability
Hint: Input distribution changes vs relationship between input and output changes.
Answer
Data drift: input feature distribution changes over time (e.g., user demographics shift). Concept drift: the relationship between features and target changes (e.g., user preferences evolve).
Types: sudden (overnight change), gradual (slow shift), recurring (seasonal), incremental (continuous).
Detection:
-
Statistical tests: KS test, PSI (Population Stability Index), chi-squared for categorical features.
-
Model performance monitoring: track accuracy, latency over time.
-
Prediction distribution monitoring: shifts in output scores. Handling:
-
Retrain on recent data (sliding window)
Online learning (incremental updates) 3. Ensemble with concept drift detectors 4. Feature monitoring alerts.
Best practice: monitor both input features AND model performance. Performance drop without data drift suggests concept drift.
Related questions
- What is experiment tracking and why is it important for LLM projects?
- Design a real-time ML serving system for a recommendation engine handling 10k QPS.
- What is LLMOps and how does it differ from traditional MLOps?
- What are ML design patterns? Explain the Feature Store pattern.
- What is model distillation? How is it used in production?