Skip to main content
Adapted from neuron-lens (MIT): its causal lens check (findings §3, scripts/checks/causal_lens.py) and its whole-model edges and sources (findings §12, scripts/checks/edges_in_context.py).

lens_predicts_steering

signature
SteeringBackend
required
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.
Sequence[LensUnit]
required
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.
Sequence[str]
Defaults to every lens the backend offers (logit, and R when an R-lens is loaded).
int
default:"16"
Random units drawn from each tested layer, each pushed with the same write norm as a tested unit.
float
default:"1.0"
Each unit is steered at dose_scale x (unit.dose or 1).
int
default:"20"
How many top tokens of each read a label is compared with.
Callable[[str, list[str]], bool]
Replaces the default word-matching judge, label_matches.
object
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
Mapping[(str, str), float] | GraphSummary
required
Edges between "layer:index" units with their weights, or a GraphSummary from circuitcheck.diff.
EdgeCatalog
required
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.
Mapping[str, list[Pole]] | Callable
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.
int
Keep only the strongest edges by |weight|.
object

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.