Model Monitoring & Drift Detection

What to Monitor

CategoryMetricsWhy
PerformanceAccuracy, latency, error rate, throughputDetect degradation before users notice
Data driftInput feature distributions, token distributionsWorld changes → model gets stale
Output driftResponse length distribution, sentiment, refusal rateModel behavior shifting over time
SafetyToxicity rate, PII in outputs, jailbreak success rateSafety guardrails weakening
CostTokens per request, GPU utilization, API spendBudget anomalies indicate abuse
OperationalUptime, queue depth, timeout rateInfrastructure health

Drift Detection Methods

Statistical tests: Compare current input/output distributions against a reference baseline using KS test, PSI (Population Stability Index), or Jensen-Shannon divergence.

Performance benchmarks: Run a fixed evaluation set on a schedule. If accuracy drops below threshold, trigger alert.

Canary queries: Periodically send known-answer queries and verify correct responses. Functions like a health check for model quality.

Human evaluation sampling: Randomly sample a percentage of production outputs for human review. Track quality scores over time.

Alerting Thresholds

ConditionAction
Accuracy drops >5% from baselineAlert — investigate
Latency p99 exceeds 2x normalAlert — check GPU health
PII detection rate spikesCritical alert — potential data leakage
Refusal rate drops significantlyAlert — safety guardrails may be degraded
API cost exceeds daily budget by 2xAlert — possible extraction or abuse
Error rate exceeds 5%Alert — infrastructure issue

Tools

ToolPurpose
Evidently AIOpen-source ML monitoring, drift detection
ArizeML observability platform
WhyLabsData and model monitoring
Fiddler AIModel performance management
Custom Prometheus/GrafanaBuild your own with standard observability stack