tezvyn:

Why version code, data, and models in MLOps?

AI-drafted, machine-checkedSource: ml-ops.orgintermediate
Why version code, data, and models in MLOps?

Tests immutable lineage across code, data, and models. Strong answers cover content-addressed data, git commits, a model registry linking both, and CI triggers on any change. Red flag: saying git alone handles data and models.

WHAT THIS TESTS: Whether you recognize that machine learning systems are functions of code, data, and compute, so reproducibility requires versioning all three as a unified lineage graph rather than treating ML like traditional software where Git alone is sufficient.

A GOOD ANSWER COVERS: First, the why. Training code without the exact data snapshot and model weights is useless for debugging drift or compliance, and data changes are often the biggest source of model behavior change in production. Second, the implementation architecture. Use content-addressed storage for data, such as DVC, lakeFS, or cloud object storage with versioned buckets and cryptographic hashes, so datasets are immutable and referenceable. Use Git for code to capture training scripts, feature engineering logic, and serving code. Use a model registry, such as MLflow Model Registry or a custom metadata store, where every registered model version stores a manifest containing the data version hash, the Git commit SHA, hyperparameters, and dependency lock files. Third, the interconnection mechanism. The manifest acts as the single source of truth that binds the three artifacts together, enabling you to recreate the exact training run. Fourth, automation. CI/CD triggers retraining or redeployment when any of the three assets change, ensuring the lineage stays current without manual bookkeeping. Fifth, environment reproducibility via container images or dependency locks, because code and data still fail if package versions differ.

COMMON WRONG ANSWERS: Proposing Git alone for data and models, which breaks down beyond tens of megabytes and lacks content-addressing for datasets. Treating model versioning as sequential file names like model_v1.pkl without metadata linking back to training context. Ignoring data versioning entirely and only tracking code and model checkpoints. Suggesting manual spreadsheets to track which data was used with which model.

LIKELY FOLLOW-UPS: How would you handle terabyte-scale dataset versioning without copying data? How do you reproduce a model when the original training environment no longer exists? How do you version features and feature transformations alongside raw data? What is your rollback strategy when a deployed model was trained on data that is later found to be biased or corrupted?

ONE CONCRETE EXAMPLE: A fraud detection model starts degrading. You pull the production model version from the registry, read its manifest, check out the exact Git commit for the training code, mount the exact hashed dataset from your content-addressed store, and rerun training in a container built from the locked dependency file. The reproduced metrics match production logs, proving the issue is data drift rather than a code bug.

Source: ml-ops.org

Read the original → ml-ops.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.