scripts/checks/causal_lens.py) and its whole-model edges and sources (findings §12,
scripts/checks/edges_in_context.py).
lens_predicts_steering
signature
TracerLensBackend(model, contexts, r_lens=...) for circuit-tracer, toy.demo() for the toy model, or anything
with write_vectors, n_units, lens_logits, steer, lenses, token_strings, vocab_mask and describe.The units under test.
LensUnit(layer, index, kind="feature" | "neuron", sign=1, dose=None, label=None). Use
units_from_nodes(nodes) for graph features: one unit per (layer, feature), its largest activation as the dose.Random units drawn from each tested layer, each pushed with the same write norm as a tested unit.
report.flagged() lists the tested units with a flag: lens misses (rho below the 5% point of its layer’s random
units and 0.1 below their median) or label disagrees (the label names none of the top tokens of any read nor of the
steering).
edges_agree
signature
Edges between
"layer:index" units with their weights, or a GraphSummary from circuitcheck.diff.Directed pole-to-pole edges.
neuron_lens.load_catalog(model_id, layers, table="edges" | "sources") reads
neuron-lens’s; EdgeCatalog.from_rows, EdgeCatalog.load and EdgeCatalog(pairs, layers) build others.A graph unit’s catalog poles,
(layer, neuron, sign). Defaults to neuron_poles ("L:n" is both poles, "L:n+"
one). For transcoder features use circuitcheck.tracer.map_features_to_neurons.circuitcheck.lens.neuron_lens
Needs pip install "circuitcheck[neuronlens]" (huggingface_hub, pyarrow). COVERED lists the models: Qwen3 0.6B,
1.7B, 4B, 8B and 14B (and their base models) and Gemma 4 12B.
Toy backend
circuitcheck.lens.toy.demo() is a six-layer model whose writes reach the output through a context-dependent map:
the logit lens reads early layers badly, the toy’s R-lens (the average map) reads every layer well. demo_units()
gives a graph’s worth of units, with one correct and one wrong label. demo_edges() gives a toy catalog and a graph
whose edges partly follow it.