What artefacts and metadata must you version so that a trained ML model can be reproduced and safely rolled back in production, and why can bit-exact reproduction still fail?

ML system design, Deployment
Level L3 Intermediate. Length Medium. Nature Th Theoretical.

What's being asked

Whether you understand everything that defines an ML build beyond model weights, and why hardware non-determinism separates practical reproducibility from bit-exact determinism.

Key idea

Unlike traditional software where code alone defines a release, an ML model is a function of code, data, features, configuration and execution environment. You must version all of these together with explicit lineage in a model registry, while aiming for statistical reproducibility because GPU (graphics processing unit) kernels and parallel data loading often prevent bit-exact repeats.

Steps

  1. Version code and feature definitions: store the Git commit hash for training and serving code, along with exact feature-transformation definitions, fitted preprocessors (scalers, vocabularies) and feature-store schema versions.
  2. Version immutable data snapshots: record a content-hashed dataset snapshot (or immutable table version ID) and the exact train/validation/test split indices so retraining never silently reads updated rows.
  3. Version configuration, seeds and environment: log hyperparameters, training schedule, random seeds (for weight initialisation, shuffling and sampling) and an exact environment specification (container image digest, framework versions and GPU driver stack).
  4. Register the model artefact and lineage: store the serialised weights, evaluation metrics, input/output schema signature and a lineage graph linking the registered model version back to its exact code commit, data snapshot and training run.
  5. Enable safe rollback: rollback requires reverting both the serving artefact and any paired preprocessing config or feature definition together so training–serving skew is not introduced.
  6. Explain why bit-exact reproduction may fail: parallel GPU reductions (such as atomic floating-point additions whose summation order varies across threads), asynchronous multi-worker data loading and hardware differences introduce small numerical drift, so teams target statistical reproducibility (metrics within expected seed-to-seed variance) unless deterministic kernels are explicitly enforced at a speed penalty.

Common mistakes

How long your answer should be

About 2–3 minutes; checklist of versioned items, lineage, and GPU non-determinism.

Read this

Previous in ML system design: How much memory does an approximate nearest neighbour (ANN) index of 100 million 256-dimensional item embeddings require in fp32 (32-bit floating point), in fp16 (16-bit floating point), and with product quantisation (PQ) using 32 sub-quantisers of 1 byte each? How does PQ achieve this compression, and what are the trade-offs?
Next in ML system design: How do you design a CI/CD (continuous integration and continuous delivery) pipeline for a production ML system, and how does it differ from ordinary software CI/CD?