My model works well during training and validation.
But inference results differ even with similar inputs.
There’s no obvious bug in the code.
It feels like something subtle is off.
How do I prevent training–serving skew in ML systems?
Sambhavesh PrajapatiBegginer
Training–serving skew occurs when feature transformations differ between training and inference.
This often happens when preprocessing is implemented separately in notebooks and production services. Even small differences in scaling, encoding, or default values can change predictions significantly.
The most reliable fix is to package preprocessing logic as part of the model artifact. Use shared libraries, serialized transformers, or pipeline objects that are reused during inference.
If that’s not possible, enforce strict feature tests that compare transformed outputs between environments.