Model drift in production: how to detect it, and what to do when you find it
Three kinds of drift
Gama and colleagues' survey of concept drift distinguishes changes in the input distribution from changes in the relationship between inputs and the target [3]. In practice there are three cases to watch:
- Data drift: inputs move, such as a new customer segment, a new product line or a changed form field.
- Concept drift: the same inputs now mean something else, such as fraud patterns that adapt to your rules.
- Upstream model change: for hosted LLMs, the provider updates the model. Chen, Zaharia and Zou found GPT-4's accuracy on one prime-number task fell from 84% to 51% between the March and June 2023 versions [4].
What to monitor
Inputs: feature distributions against a reference window, missing-value rates and schema changes. Outputs: the distribution of predictions and confidence, refusal rates for LLMs. Outcomes: the real labels when they arrive, which are the only direct measure of accuracy. Google's ML Test Score rubric lists these monitoring tests alongside data and infrastructure tests as a production-readiness checklist [2].
How to respond
Not every alert means retraining. Fix data drift caused by a broken pipeline at the pipeline. Address concept drift with fresh labels and retraining. Handle an upstream LLM change by pinning the model version, re-running the evaluation set and adjusting prompts before moving to the new version.
Google Cloud's MLOps guidance describes levels from manual training to fully automated continuous training and delivery [5]. Whatever the level, a retrained model should pass the same evaluation and approval as any other release, and the previous version should stay ready for rollback.
Sources
- [1]Hidden Technical Debt in Machine Learning Systems (Sculley et al., 2015) · NeurIPS
- [2]The ML Test Score: A Rubric for ML Production Readiness (Breck et al., 2017) · Google Research
- [3]A Survey on Concept Drift Adaptation (Gama et al., 2014) · ACM Computing Surveys
- [4]How is ChatGPT's behavior changing over time? (Chen, Zaharia & Zou, 2023) · arXiv
- [5]MLOps: Continuous delivery and automation pipelines in machine learning · Google Cloud
Implement this
Ready to deploy this at your organisation?
More from Solnix