1. Install
NeuronScope ships as a pure-Python wheel with an optional native accelerator. The base wheel is enough for this course.
pip install neuronscope2. Fingerprint a model
A fingerprint is the canonical identity of a model — its architecture, weights, and tokenizer collapsed to a 32-byte BLAKE3 digest. Two runs with the same fingerprint are byte-comparable.
import neuronscope as ns
from transformers import AutoModel
model = AutoModel.from_pretrained("distilbert-base-uncased")
fp = ns.fingerprint(model)
print(fp.hex[:16]) # e.g. ""3. Record activations
A recorder installs probes, iterates a dataset, and produces a .nsz artifact. The context manager guarantees hooks are removed even on error.
ds = ns.datasets.tiny_imdb(n=64)
with ns.Recorder(model, probes=[ns.probes.Activations("encoder.layer.*.output")]) as rec:
rec.record(ds)
rec.save("baseline.nsz")4. Inspect the artifact
The CLI reads .nsz files directly. ns show prints a summary of the run, including fingerprint, probe list, and per-layer tensor shapes.
ns show baseline.nsz5. Diff two runs
Re-run against a fine-tuned checkpoint and compare. ns diff refuses to compare runs whose fingerprints disagree on architecture — that would be a category error.
ns diff baseline.nsz finetuned.nsz --metric cosine6. Where to go next
- Activation basics — what probes actually capture.
- Comparing runs — metrics, alignment, and pitfalls.
- System architecture — how the recorder is built.