prove-model-drift

Don’t trust my binary. Don’t trust my tests. Run this 40-line PyTorch script on your own machines.

$python3 prove_model_drift.py

Note: prove_model_drift.py trains one small PyTorch network with one seed (42) and prints a SHA-256 hash of the final weights. It does not run CAGM; the CAGM results further down are a separate run.

What this shows: Standard training pipelines are not bit-identical across hardware. A different hash on your machines is the result this script tests for. It does not isolate which specific component (CPU architecture, GPU, or library build) caused the drift. If your machines return the same hash, they behaved identically on this specific test.

What is this?

Standard machine-learning training is not bit-exact across different hardware. Even if you fix the random seed, the initial weights, and the dataset, the underlying floating-point math drifts between CPU architectures, GPUs, and library builds.

This repository contains a minimal PyTorch script that trains a small neural network and prints the SHA-256 hash of the final model weights.

How to run it

You need Python 3 and PyTorch.

bash
git clone https://github.com/SwapnopamMitra/prove-model-drift.git
cd prove-model-drift
python3 prove_model_drift.py

The Results (Tested October 2026)

Same script, same seed (42), four different environments.

The final loss was identical on all four. The model weights were completely different.

EnvironmentDevicePyTorchFinal LossWeights SHA-256
Colab CPUIntel Xeon @ 2.20GHz2.11.0+cpu0.6941075367ed1ee5...
Colab GPUNVIDIA Tesla T42.11.0+cu1300.694107530ae59421...
TPU VM (host CPU)AMD EPYC 7B132.14.1+cpu0.69410753ef84b798...
Python RunnerIntel Xeon @ 2.80GHz2.8.00.69410753098cbd36...
Fingerprint · one cell per hex character of the weights SHA-256final loss 0.69410753 on all four

Full hashes

weights SHA-256
Colab CPU      67ed1ee52938f57d0c6d563eb84057e8a89aa164caf2186a0e64152dc23692a2
Colab GPU      0ae59421ab7821874cc8971673cc92743ade3d8b3244620893d17caf90a829d3
TPU VM (host)  ef84b798c8020f0100c2864bb9956b783ea1da566b66d64ddc92a4dcc2e6aa2d
Python Runner  098cbd36d74178015a5ced2560e0a296b6d57fabbb33a7f3b2be2cabd6c868a4

Raw run metadata

run metadata

      
Matches one of the four recorded hashes, or it is a fifth. A fifth is data.

Why this matters

If you are training an ML model for clinical use, finance, or compliance, you need to prove the model running today is mathematically identical to the model you validated last month. A matching loss is not proof. A matching hash is proof.

The Fix

I built CAGM, a fixed-point ML classifier that removes floating-point math from the training loop and emits a SHA-256 proof of the entire training trajectory.

I ran CAGM across the same four environments. Every run produced the exact same proof.

Four environments. Two CPU environments, an RTX 3050, and a Tesla T4. Same dataset. Same accuracy. Same training proof. Same model SHA-256.

EnvironmentAccuracyTraining proofModel SHA-256
Colab CPU0.514460MatchMatch
TPU VM (host CPU)0.514460MatchMatch
Local RTX 3050 6GB0.514460MatchMatch
Colab Tesla T40.514460MatchMatch
Dataset SHA-256:
737649857cd126fb09cd3cd9d0f63b39353f09eb73fc6c6642597ff3f35d3f96
Model SHA-256 (cagm_model1.onnx), identical in all four environments:
f32522987216045155d0be61753f6f9d7218ee61aea427b4ea08e2faf14efe5e

If you want to see how it works, look at samayuktam.com.

Run it on your own machines