Interpretability and Interventions¶
This pillar covers the tools for looking inside a model while it runs, GPTScope and the inspector, and the planned interventions that change a model's computation during a run.
The roadmap graph shows how these features depend on features in other pillars. Ideas for this pillar that are not in the registry are on its candidates page.
Shipped¶
- INT-01 GPTScope. GPTScope is an applet that trains a small character-level language model live and shows what it has learned in seven windows, each answering one question.
- INT-02 ThoughtSpace. ThoughtSpace draws the model's residual stream as a 3-D constellation, with every token's state at every depth as a point and a trail joining the depths.
- INT-03 Head Views. The head views plot each attention head by mean attended distance and entropy, and draw the attention matrix of a selected head as a texture.
- INT-04 Controls for Experiments. Protocol 3.1 controls let a viewer pause, step and resume a running script, change its registered parameters and run its registered actions, which an interpretability run uses to repeat an experiment.
- INT-11 Ablate. Ablate sets the output of a module, or the slice of one attention head, to zero at a step boundary while the run trains, from a command or from a toggle control bound to an intervention point.
- INT-23 Head Ablation Demo. A demo ablates the strongest induction head of a transformer that trains, live and with a toggle, and the loss rises while the head is out, in the Attention Arc Tower.
- INT-27 EmbedScope. EmbedScope trains a small MNIST network with a learned 3-D bottleneck and draws the test set's embeddings as a live scatter of ten classes, with SQL panels.
- INT-34 Intervention Commands. The commands intervene.points, intervene.set, intervene.clear and intervene.list make each module and each attention head of the attached script an intervention point, and apply an ablation at the next step.
- INT-35 Model Probes. Model probes expose residual streams, MLP inputs and outputs, and attention patterns on PyTorch and HookedTransformer models without a CPU copy.
- INT-36 Feature Dictionaries. Dictionary adapters connect SAELens sparse autoencoders and circuit-tracer transcoders to Caliper with staged device loads and lazy decoder lookups.
- INT-37 Example Index. Live and disk indexes retrieve top activating 33-token windows from Neuronpedia or local prompts and publish ranked windows to token strips.
- INT-38 Attribution Graphs. Circuit attribution runs circuit-tracer over ReplacementModel transcoders, prunes on CPU, and publishes up to 8,192 nodes and 262,144 edges.
- INT-39 Graph Pieces. Library pieces draw attribution graphs, feature examples, activation heatmaps, and paired output probabilities in the native app and browser viewer.
- INT-40 Feature Steering. Feature interventions clamp or scale transcoder and SAE features or add vectors at selected positions, with live baseline-versus-steered bars.
- INT-41 Activation Patching. Activation patches substitute clean prompt activations, and patch.sweep measures normalized recovery across all layers and token positions.
- INT-42 Inference Runs. Hosted inference runs expose prompt controls, traced features, one-click circuit interventions, fork checkpoints, and paired greedy generation.
Built¶
- INT-05 Inspector. The inspector is an applet that attaches to a running script and shows its model in docked panes for inference, the list of tensors, a single tensor and the J-space trace.
- INT-06 Inspector Tensor View. The tensor view draws a tensor at its true shape, zooms down to single cells by sampling the visible region, and lets a person read and edit cells, rows and columns.
- INT-07 Inspector 3-D Model View. The 3-D model view draws every tensor of a model as a panel sized to its shape and textured with its heatmap, grouped and stacked by layer.
- INT-08 App-to-Script Requests. A script serves requests over a socket next to its session, so the app can ask it to run a task, stream events back, cancel it and fetch tensor values in binary chunks.
- INT-09 Language Models Run from the App. An example script loads a small language model with MLX and serves the inspector's requests, with generation, a tensor list, sampled views and in-memory weight edits.
- INT-15 J-Space Trace Pane. The Trace pane reads a model through a Jacobian lens as it generates, showing the J-space grid and the attention patterns token by token, with a playback clock and the whole run as a tape.
- INT-28 Vocabulary Embedding View. A 3-D view draws every row of a model's embedding table as a point, grouped by token kind, so that a person can orbit the vocabulary and read a token by hovering its point.
- INT-29 Token Trajectories. A 3-D view draws each token of a run as a path up the model's layers and marks the layer from which the lens settles on the next token.
- INT-30 GrokScope. GrokScope is an applet in which a small network learns modular addition, memorising first and generalising thousands of steps later, shown as a tower of rings of its token embedding.
- INT-31 Interpretability Example Scripts. Two example scripts reproduce published interpretability measurements live in Caliper, finding induction heads in one small language model and a truth direction in another.
- INT-32 J-Space Interventions. The inspector reads a running language model through a Jacobian lens and intervenes in its J-space across a band of layers, by ablating, removing or swapping lens directions or injecting a scaled direction, with intact and intervened runs sampled alike.
Planned¶
- INT-10 Intervention API. Intervention points declared on a PyTorch model in Caliper LIB let the viewer ablate, scale, steer and patch at step boundaries, with each intervention recorded with the run and compared with the original. Sprint 6.
- INT-12 Scale. Scale multiplies a chosen activation or direction by a factor during a run. Sprint 6.
- INT-13 Steer. Steer adds a chosen direction to the residual stream at selected layers and positions during a run. Sprint 6.
- INT-14 Patch. Patch replaces an activation in one run with the matching activation from another run. Sprint 6.
- INT-16 Induction Metrics. Induction metrics score each attention head for induction behaviour and show the scores in GPTScope.
- INT-17 Activation Patching in GPTScope. Activation patching in GPTScope lets a person replace activations of one run with those of another and see the effect on the model's output.
- INT-18 MLX Support. Support for MLX lets the interpretability tools read activations and apply interventions on models written in MLX.
- INT-19 JAX Support. Support for JAX lets the interpretability tools read activations and apply interventions on models written in JAX.
- INT-21 Interventions from the Viewer. A person picks a head in the attention view and ablates it, or turns a selection in an embedding into a steering direction, from the viewer. Sprint 6.
- INT-22 nnsight and TransformerLens Adapters. A model wrapped in nnsight or TransformerLens offers its intervention points to Caliper through an adapter. Sprint 6.
- INT-33 Interventions in the Trace Pane. The Trace pane drives the intervention API, so that a person intervenes from the trace view on any model that the API supports and compares the run before and after. Sprint 6.
Ideas¶
- INT-24 OpenGLlama Applet. OpenGLlama could return as an applet of its own beside the inspector.
- INT-25 Point Picking in ThoughtSpace. A person could pick a point in ThoughtSpace's constellation and see its token and depth.
- INT-26 Learned Projection in ThoughtSpace. ThoughtSpace could offer a learned projection of the residual stream beside its fixed one.
Decisions¶
- INT-20 Interventions and the Inspector. This decision sets when the inspector branch, which already holds a J-space Trace pane and J-space interventions, merges, and how those interventions become the general intervention API of sprint 6.