What kinds of distribution shift exist, and how would you monitor a deployed model - classical or LLM-based - for them?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Three canonical types, distinguished by what changes between training and serving:
- Covariate shift: P(x) changes, P(y|x) stable - new user demographics, new device types, traffic mix changes. The model sees inputs unlike its training data.
- Label/prior shift: P(y) changes - fraud rate doubles during holidays; class frequencies move while the class-conditional behaviour holds.
- Concept drift: P(y|x) itself changes - the same input now means something else. Adversarial domains (fraud, spam, abuse) drift because your model exists; attackers adapt to it.
Full worked answer
Three canonical types, distinguished by what changes between training and serving:
- Covariate shift: P(x) changes, P(y|x) stable - new user demographics, new device types, traffic mix changes. The model sees inputs unlike its training data.
- Label/prior shift: P(y) changes - fraud rate doubles during holidays; class frequencies move while the class-conditional behaviour holds.
- Concept drift: P(y|x) itself changes - the same input now means something else. Adversarial domains (fraud, spam, abuse) drift because your model exists; attackers adapt to it.
Monitoring stack, ordered by signal latency:
- Input drift (immediate): compare live feature distributions to a training/reference window - PSI, KL divergence, Kolmogorov-Smirnov tests per feature; for unstructured inputs, monitor drift in embedding space (distance between live and reference embedding distributions).
- Prediction drift (immediate): shifts in the output score distribution or predicted-class mix often flag trouble before labels arrive.
- Proxy/behavioural metrics (fast): CTR, user corrections, thumbs-down rates, escalation-to-human rates, retry rates.
- Ground-truth metrics (delayed): true accuracy/PR once labels land - chargebacks at 60 days, churn at 90. The delay is why layers 1-3 exist.
- Golden/canary sets: fixed eval suites replayed on a schedule - regression detection independent of traffic.
For LLM systems specifically: the query distribution drifts (new topics, new jailbreak patterns), and - uniquely - the model itself shifts under you when a provider updates a hosted model or you change a prompt. Treat prompts+model versions like code: pin versions, run eval suites (LLM-judge with periodic human audit) on every change, log samples for offline re-scoring, and monitor output properties (length, refusal rate, tool-call rate, judge scores) as prediction-drift signals.
Responses: retrain/fine-tune on recent data, recalibrate thresholds (cheap, often sufficient for prior shift), or fix upstream data pipelines - a surprising fraction of "drift" alerts are broken feature pipelines, not the world changing.
What a good answer covers
- Covariate shift: P(x) changes, P(y|x) stable - new user demographics, new device types, traffic mix changes
- Label/prior shift: P(y) changes - fraud rate doubles during holidays; class frequencies move while the…
- Concept drift: P(y|x) itself changes - the same input now means something else
- Monitoring stack, ordered by signal latency: 1
- Input drift (immediate): compare live feature distributions to a training/reference window - PSI, KL…
Key terms: Covariate shift · Label/prior shift · Concept drift · Input drift · embedding space · Prediction drift · Proxy/behavioural metrics · Ground-truth metrics · Golden/canary sets · model itself shifts under you
In the glossary: Covariate shift · Drift · PSI · Accuracy · Jailbreak · Judge (LLM-as-judge)
Interviewer follow-ups to expect
How do you distinguish concept drift from a data-pipeline bug?
- Covariate shift: P(x) changes, P(y|x) stable - new user demographics, new device types, traffic mix changes. The model sees inputs unlike its training data.
- Label/prior shift: P(y) changes - fraud rate doubles during holidays; class frequencies move while the class-conditional behaviour holds.
- Concept drift: P(y|x) itself changes - the same input now means something else. Adversarial domains (fraud, spam, abuse) drift because your model exists; attackers adapt to it.
Prior shift only - can you fix it without retraining?
Design the drift monitoring for a RAG-based support bot.
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep