Single logo
  • Courses
  • Blog
  • About
Join for freeJoin free
Learning pathData and Features in Production
  1. 1
    Time Splits and Group Splits: Make the Split Match How the Model Is Used
  2. 2
    Time Series Basics: Lags, Rolling Windows and Walk-Forward Backtesting
  3. 3
    Feature Engineering Patterns, Each One Tested: Date Parts, Differences, Windows and Target Encoding
  4. 4
    Point-in-Time Correctness: Join Features as of Each Event with merge_asof
  5. 5
    Data Validation and Schema Checks: Stop Bad Input Before It Reaches the Model
  6. 6
    Training-Serving Skew: Same Model, Different Inputs, and How to Detect It
  7. 7
    Feature Stores: Offline and Online Stores, and When You Actually Need One
  8. 8
    Data Versioning with DVC: Tie Every Model to the Exact Data That Trained It
  1. Blog
  2. /
  3. Machine Learning
  4. /
  5. MLOps and Production ML

Learning path: Data and Features in Production · Step 6 of 8

Training-Serving Skew: Same Model, Different Inputs, and How to Detect It

Offline the model is great, live it gets worse, and nothing crashes. What training-serving skew is, the three usual causes, how it differs from drift, and how to detect it, test the alert and roll back.

Chaand Sheikh

·27 November 2026Data and Features in Production

What you will learn

  • Define training-serving skew: the same record gives one feature value in training and another in serving
  • Name the usual causes: transforms, timestamps and fill rules that differ between pipelines
  • Tell skew apart from drift and from label leakage
  • Detect it with live distributions and replay, test the alert on purpose, and recover with feature versions

Before you start

  • Data Validation and Schema Checks
  • Point-in-Time Correctness

Take a food delivery app. A model predicts when your order will arrive. In the offline test it's off by about 4 minutes on average. The team ships the same model, and soon it's off by 11 minutes. (These numbers are a made-up example.)

No crash, no alert. Every call still returns 200. Nothing is broken, yet the answers are wrong.

That's the classic interview question too: offline accuracy is high, live predictions keep getting worse. What is training-serving skew, and how would you detect it?

The short answer

Skew means the same input gives one feature value in training and another in serving. A feature is just a number the model reads. Same model, different inputs.

  1. Check the feature transforms and the timestamps, side by side.
  2. Watch the live distributions against the training ones.
  3. Version your features, so you can roll back to the last good one.

A simulator whose dials read differently

Think of a pilot in a simulator. The altitude dial reads in feet: 10,000 feet, and the pilot passes every test. Then comes the real plane. Same pilot, but this dial reads in metres, so at the very same height it says 3,048. That looks far too low, so the pilot pulls up. A perfect reaction, to a wrong reading.

The pilot is the model. The simulator is training, the real plane is serving, and the dial is a feature. The pilot didn't forget anything. The dials just read differently.

One order, two sets of numbers

Back to the delivery app. One order goes through two pipelines: the code that turns raw data into features for training, and the code that does it at serving time.

One order, two pipelines, two sets of numbers one order1 pm, 5 km EXAMPLE, synthetic numbers training pipeline serving pipeline distance 5 (km) 3.1 (miles) transform problem hour 7 (UTC) 13 (local) timestamp problem prep time, blank 12 (average) 0 fill rule differs The model learned the left column and is served the right one. No error.
Example numbers. Each feature has the same name in both pipelines and a different value.
  • Distance, a transform problem. Training stores 5 kilometres. Serving sends miles, so 3.1.
  • Hour, a timestamp problem. An order at 1 pm. Training saved 7, in UTC; serving sends 13, in local time.
  • A blank prep time, a fill rule problem. Training filled in the average, 12 minutes. Serving just sends 0.

The model gets numbers it never learned from, and nothing warns it. You can see the same thing with real numbers in Data Validation and Schema Checks: a serving helper that turns car weight into kilos took test RMSE from 2,068 to 5,067, and most of those cars still passed the schema.

The trap: calling it drift and retraining

Here's where weak answers go wrong. Live got worse, so "it must be drift, let's retrain". But retrain on the same pipeline, and serving still sends different numbers, so the same gap comes back.

What changedDo the pipelines agree on one record?
DriftThe world changedYes
SkewThe pipelines disagreeNo
Label leakageA training feature secretly held the outcome, so the offline score was falseNot the question: the offline score was never real

Same symptom, different bugs. Rule out label leakage too (see Train-Test Split and Data Leakage and Point-in-Time Correctness).

Catch it before the customer does

  • Compare distributions. Plot a feature in training, then the live values on top. With miles instead of kilometres, the whole distance shape slides to the left. Compare live against training feature by feature, and alert when the gap goes past a normal day.
  • Replay. Send the same records through both pipelines, and count what share match.
  • Test the alert on purpose. Ship a kilometres-to-miles change in shadow mode, where nobody uses its answers. It passes if the alert fires, and rolling back to the last feature version clears it.

An alert you've never seen fire is only a hope.

The follow-up questions

  • Is it skew or drift? Replay the same records through both pipelines. If they disagree, it's skew. If they agree, that points to drift.
  • How do you stop it coming back? Share one transform between training and serving, or train on the features you logged at serving time. (A feature store is one way to share them; see Feature Stores.)
  • A bad feature version is live. What first? Roll back to the version the model was trained on, then fix it.

Before you touch the model, compare the inputs.

Quick recap

StepWhat to do
SpotHigh offline, low live, nothing crashed: suspect the inputs first
FindCheck transforms, timestamps and fill rules side by side
DetectLive vs training distributions, plus replay through both pipelines
ProveShip a known skew in shadow mode and see the alert fire
RecoverRoll back to the feature version the model was trained on

The pilot didn't forget how to fly. The dial just read differently.

Built this? Share your solution in the StudyEasy AI Community.

Join free on Skool →
← Previous
Data Validation and Schema Checks: Stop Bad Input Before It Reaches the Model
Next →
Feature Stores: Offline and Online Stores, and When You Actually Need One
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool
Go deeper with a course

Machine Learning Engineer: From First Model to ML Engineer

Learn machine learning in Python, then ship it: data analysis, regression, classification, tuning, deployment and MLOps.View on Udemy ↗: Machine Learning Engineer: From First Model to ML Engineer (opens in a new tab)

Related articles
Python Virtual Environments: One Project, One Toolbox

Why every Python project gets its own virtual environment: two projects that need different versions of requests, python -m venv .venv, activation, pip install and the PyCharm setting that activates it for you.

Git and GitHub Fundamentals: Commits, Branches, Push and Pull

The Git you use every day, on a tiny hello-ml project: commits as save points, the staging area, a branch merged with a fast-forward, then push, clone, pull and pull requests with a teammate.

Testing a FastAPI App with pytest: Three Small Tests

A tiny FastAPI app with a Hello World route and a name route that refuses numbers, three pytest tests that check it, and what happens when the validation is deleted by mistake.

Config and Logging Instead of Hard-Coded Values in ML Training

Take the hard-coded values out of a car price training script: one config.toml read with tomllib, logging with levels and a run id on every line, and secrets read from the environment. Same RMSE, 2195, before and after.

On this page
  • The short answer
  • A simulator whose dials read differently
  • One order, two sets of numbers
  • The trap: calling it drift and retraining
  • Catch it before the customer does
  • The follow-up questions
  • Quick recap
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool
Go deeper with a course

Machine Learning Engineer: From First Model to ML Engineer

Learn machine learning in Python, then ship it: data analysis, regression, classification, tuning, deployment and MLOps.View on Udemy ↗: Machine Learning Engineer: From First Model to ML Engineer (opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.