What is an activation
An activation is the output tensor of an internal module for a given input batch. It is not an attention weight, not a gradient, and not a hidden state variance — those are distinct probe kinds and record separately.
Layer selectors
Selectors are glob patterns matched against the framework's canonical module path.encoder.layer.*.output matches every encoder block's output; **.attn matches every attention submodule regardless of depth.
probes.py··python
probes = [
ns.probes.Activations("encoder.layer.*.output"),
ns.probes.Attention("**.self_attn"),
]Shapes and dtypes
- Activations are recorded in the model's native dtype (usually
float16orbfloat16). - Shape is
[batch, tokens, hidden]for transformer blocks; the recorder does not reshape. - Casting to
float32at record time is opt-in viaActivations(..., cast="float32").
Common pitfalls
- Recording every layer of a 70B model is rarely what you want — start with a stride.
- Attention outputs are post-projection; use
Attentionfor pre-projection weights.