← Questions

Debug a model that does worse online than offline

0
AmazonAI/ML designLast asked Jan 2026

An AI/ML design interview question asked in Amazon's system design round, last asked Jan 2026. It tests model monitoring, training-serving skew and evaluation.

A model scored well in offline evaluation, but after launch its online metrics are worse than the model it replaced, or worse than offline numbers predicted. Walk through how you find out why and what you do about it.

Requirements

  • Functional: a systematic investigation from symptom to root cause, the checks you would run in order, and the fix for each cause.
  • Non-functional: find the cause quickly and safely, with the old model available as a fallback, and change the process so the gap is caught before the next launch.

Clarifying questions

  • What kind of model and product: ranking, recommendations, classification, fraud?
  • Which offline metric was used, and which online metric dropped? Are they measuring the same thing?
  • Is the drop across all traffic or in some segments (new users, a region, a device)?
  • Did it appear at launch, or slowly afterwards?

What a strong answer covers

  • First rule out the plumbing: the right model version is serving, the experiment assignment is correct, logging works, and the online metric is computed correctly.
  • Training-serving skew: features computed differently online (different code, missing values, stale or delayed features, different defaults). Detect it by logging the features at serving time and comparing them with the training features for the same requests.
  • Leakage in the offline set: features that encode the label or the future, or a random split that should have been a time-based one.
  • Data drift and population differences between the evaluation set and live traffic, checked by segment.
  • An offline metric that does not track the business goal (AUC up while calibration or the top of the ranking gets worse), and position bias in logged data.
  • Feedback loops: the old model chose what was shown, so the training data reflects its choices; the new model is judged on data it never influenced.
  • Fixes and prevention: shadow traffic before launch, a feature store shared by training and serving, time-based validation, per-segment dashboards and a staged rollout with automatic rollback.

Follow-ups

  • Features match exactly and the data has not drifted, yet the gap remains. What next?
  • How do you build an offline evaluation that predicts the online result better?
  • The new model wins on clicks but loses on long-term retention. How do you decide?

Where it's asked

What it tests

model monitoring · training-serving skew · evaluation

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing