Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Reproducibility: Rebuilding a Model Months Later
AI & Machine Learning

Reproducibility: Rebuilding a Model Months Later

An auditor, a customer complaint or a bug will eventually require you to reproduce an old model exactly. What has to be recorded for that to be possible.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Reproducing a model needs four things recorded together: the exact training data, the code, the environment and the configuration. Most teams keep the code and lose the data snapshot, which is the one that cannot be reconstructed afterwards.

Why this comes up

It seems theoretical until it is not. A customer disputes a decision from March. A bug is found and you need to know which predictions were affected. An auditor asks how a decision was made. A model degrades and you want to compare against the previous version.

In each case you need to reconstruct what the model was at a point in time, and in each case the answer is usually 'we think so' rather than 'yes'.

The four things that must be captured

ComponentWhat to recordUsual failure
DataExact training rows, or a snapshot referenceSource tables have moved on; cannot rebuild
CodeCommit hash of training and feature codeUsually fine, sometimes uncommitted local changes
EnvironmentLibrary versions, container image digest'Latest' pulled a new version silently
ConfigurationParameters, random seeds, thresholdsHeld in someone's notebook

Data is the one that defeats most teams. Operational tables update continuously, so re-running last March's query today returns different rows. Without a snapshot or a way to query as of a date, the model cannot be rebuilt.

Practical ways to pin the data

  • Write the training set to immutable storage and record its location and checksum with the model
  • Use a warehouse that supports time-travel queries, and record the timestamp
  • Keep append-only history tables for key entities so state can be reconstructed as of a date
  • At minimum, record the exact query and the run timestamp - weaker, but far better than nothing

For most businesses, writing the training extract to object storage alongside the model artefact is the simplest reliable option. Storage is cheap relative to the cost of not being able to answer.

What to store with each deployed model

Treat the deployed model as a package rather than a file. Alongside the weights, store the training data reference, the code commit, the environment digest, the configuration, the evaluation results on a named test set, the date and the person who approved it.

That package is what lets someone six months later answer questions without archaeology. It is also what a regulator or auditor will ask for, in more or less those terms.

Bit-exact or close enough

Perfect bit-level reproducibility is achievable but can be expensive - it requires pinning random seeds, controlling thread counts and sometimes accepting slower training.

For most business purposes, functional reproducibility is sufficient: rebuilding produces a model that behaves equivalently and makes the same decisions on a reference set. Decide which you need, and be aware that regulated contexts sometimes require the stricter version.

The code is almost always recoverable. The data as it stood that day usually is not.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

Do we need to keep every training dataset?

Every one used to train a model that made real decisions, for as long as those decisions could be questioned. Intermediate experiments can go.

Is a model registry enough?

Only if it records the data reference and environment as well as the artefact. Many registries store the model and little else.

How long should we retain these?

As long as the decisions could be challenged - which in regulated contexts may be years. Take advice for your sector.

Does this apply to models we did not train?

Yes in a different form. Record which third-party model and version was used and when, since providers change models beneath you.

Keep reading

More on AI & Machine Learning

Start here

Want machine learning project details from us?

Tell us what you are trying to predict and roughly what data you hold. We will come back with an honest view on whether machine learning is the right tool, what the work would involve and a realistic cost range. If a spreadsheet would do the job, we will say so.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →