A production model can change even when its code does not: a revised dataset can change its behavior. Versioning records which code, data, configuration, and model artifact belong together so a result can be reproduced and a deployed model can be traced. Git is a familiar choice for code; data versioning is harder because datasets take many forms and have no equally ubiquitous tool. section 1.1.1 section 2.1.3
Build versioning into the ML workflow rather than adding it after training:
- Track the origin and revisions of raw, transformed, and annotated data. Record when, where, how, and why data was collected; lineage makes it easier to correct bad data and recreate a dataset. section 2.1.1
- Keep code, configuration, data, and trained models as distinct versioned components with lineage links. Associate each model with its dataset version, and log experiment results, configuration, and checkpoints. section 2.1.3
- Choose pipeline data-access and storage methods that preserve version control and lineage. MLflow can log experiments and track model versions alongside a training pipeline. section 8.2 section 9.3
- Log model transitions through staging and production. If a release underperforms, its version and lineage provide context for investigation and make rollback to a previous model straightforward. section 2.1.5 section 2.1.6
Revising a car-price dataset
For a second-hand car price estimator, collect data for the intended passenger-car market and use a versioned ETL pipeline to generate the dataset. Preserve collection lineage so an erroneous dataset can be recreated and corrected without rebuilding complex extraction scripts blindly. section 2.1.1
Figure 2.5 A view of a retraining pipeline using the modular codebase concept. This approach of keeping the model, code, configuration files, and data as distinct versioned components with lineage links ensures that the process remains flexible, fast, and adaptable while enabling experimentation, debugging, and iterative development.
The retraining-pipeline diagram places model, code, configuration, and data in separate versioned components connected by lineage links. section 2.1.3
The same discipline extends beyond conventional models: prompts in production LLM applications also need version control and systematic testing. Versioning is most useful when paired with validation, experiment tracking, and monitoring—not treated as a substitute for them. section 13.0 section 2.1.6
























