---
title: What causes training–serving skew and how do you prevent and detect it?
url: https://gurkanozkan.ai/learn/questions/mle-training-serving-skew-34/
markdown: https://gurkanozkan.ai/learn/questions/mle-training-serving-skew-34.md
kind: question
role: ML engineering
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/mle-training-serving-skew-34.json
robots: noindex
---

# What causes training–serving skew and how do you prevent and detect it?

ML engineering · Technical · Medium

## Answer

*Model answer, written in a candidate's voice*

### In short

- Causes: duplicated transformation code, different data sources or freshness, timezone/unit bugs, missing-value handling.
- Prevention: one shared transformation path; log served features and train on those logs; parity tests for any second implementation.
- Detection: schema and distribution checks between training and serving, e.g. daily comparisons of served vs training statistics (TensorFlow Data Validation or similar) with drift alerts.
- Launch safety: shadow scoring before rollout and gradual rollout.

### In full

Training–serving skew happens when the features the model sees in training are not the same features it sees in production, usually because transformation logic is duplicated and drifts, training and serving read different sources or freshness, timezone/unit/scale handling differs, or missing values are filled differently. The fix is to make one transformation path the source of truth and to log the exact features served in production so training can be rebuilt from those logs; where a second implementation is unavoidable, it needs parity tests. I would also run schema and distribution checks between training and serving, for example a daily comparison of served-feature statistics against the training statistics with a tool such as TensorFlow Data Validation, alerting on drift in distributions, nulls and ranges rather than watching only model metrics. Before launch I would shadow-score the new pipeline against live traffic, confirm the served features match the training distribution, and roll out gradually. In short, skew is prevented by shared code and logged served features, and detected by continuous train/serve comparison plus shadow testing.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Causes: duplicated transformation code, different data sources or freshness, timezone/unit bugs, missing-value handling.
- Prevention: one transformation path; log served features and train on the logs.
- Detection: schema and distribution checks between training and serving (e.g. scheduled comparisons of training and serving statistics with a tool such as TFDV, with drift alerts).
- Shadow scoring before launch.

## Common mistakes

- relying only on offline metrics
- re-implementing features in a second language without parity tests.

## Topic guides

- [Data quality, leakage and drift](https://gurkanozkan.ai/learn/topics/data-quality.md)
- [MLOps and LLMOps](https://gurkanozkan.ai/learn/topics/mlops.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
