Skip to main content
circuitcheck’s checks were built for transcoder features in circuit-tracer graphs. They work just as well on the model’s own MLP neurons, through neuronkit. No transcoder is trained, so nothing is reconstructed and there is no error node to worry about.

What a neuron node is

Inside each MLP block, a SwiGLU model computes, for every token, one number per neuron:
A neuron node is that number for one neuron at one token position: (layer, neuron index, position). It uses circuitcheck’s usual FeatureNode, with feature holding the neuron index, so every tool reads it unchanged. Two things differ from a transcoder feature:
  • a neuron is almost never exactly zero, so every neuron of a layer counts as active at every position. The random controls are uniformly random neurons of the same layer and position, and the matched-norm controls are the neurons whose write, |activation| × ‖W_down column‖, is closest in size;
  • a neuron has two ends, or poles: what makes it fire strongly positive and what makes it fire strongly negative. Labels describe one pole at a time, written 12:n345+ or 12:n345-.
The approach follows Neurons as an Interpretable Basis: read the raw neurons one pole at a time, describe each from its strongest firings, and test every description in the model.

Install

install
Until neuronkit is on PyPI, install it from GitHub first: pip install "git+https://github.com/albertlieyingadrian/neuronkit".

Try it on the toy (CPU, no downloads, no key)

The toy is a real two-layer Qwen2 with a one-character-per-token tokenizer and a few neurons set by hand. The letters stand for cities: D is Dallas, O is Oakland, A is Austin and S is Sacramento.
  • L0/N0 is a switch: it fires on D and writes the direction the output reads as A.
  • L1/N0 is a readout: it fires just as hard on D, because it reads what the switch wrote, but it writes into a direction nothing downstream uses.
  • L0/N2 is a relay source: it fires on T and writes a direction the unembedding cannot see. Only L1/N7 reads that direction, and L1/N7 writes A.
neurons
Add --html report.html --json report.json to any of them for the reports.

validate: switch or readout?

NeuronBackend wraps any Hugging Face causal LM and its tokenizer. Pass it to validate like any other backend. backend.nodes(prompt, specs) turns "layer:neuron@position" strings into nodes that carry their real activations (position -1 is the last token).
neurons
Each intervention is a neuronkit edit at the node’s position: ablation sets the neuron to 0, steering multiplies it by 3, and the counterfactual patch gives it its value on the other prompt. The verdict rules and the report are the same as for transcoder features (see the validator).

A neuron’s subcircuit

neuronkit traces what drove one firing: with the norm in front of the MLP frozen, every earlier head and neuron contributes an exact share of the activation. subcircuit_group keeps the k strongest earlier neurons as a group, so you can ask whether a neuron’s drivers are themselves a switch:
neurons
The readout’s only driver is the switch. So the graph-style reading “L1/N0 matters” is wrong, but the neuron does point at the one that does matter. The trace is direct-path: chains through several components are not followed.

label: does the description hold up?

A label is only worth as much as its test. label_neuron writes a description of one pole from its strongest firings, or takes one you give it, and then tests it three ways:
1

Predict

A judge gets the description and a shuffled mix of held-out firing excerpts and random windows of the corpus, and says which ones fire. Scores: balanced accuracy and AUROC.
2

Simulate

The judge predicts a 0-10 activation for every token of held-out excerpts. Those predictions, scaled to the pole’s p99.9 magnitude, are patched in for the real activations, and the result is compared with zero-ablating the neuron on the same tokens: recovered = 1 - KL(simulated) / KL(ablated). 1.0 means the description carries everything the neuron’s activations carry there; 0.0 means it does no better than deleting the neuron.
3

Write (optional)

With n_write, the judge writes texts meant to fire the pole, and the report says whether one beats the corpus maximum.
The trust score (label.score) is recovered: it is measured in the model’s own output, so a description that only sounds right does not earn it. The excerpts the explainer saw are never scored. This runs neuronkit’s score_description, which uses circuitcheck’s excerpt format and simulation prompt, so feature labels and neuron labels are tested the same way.
neurons
The readout’s recovered is None, and its ablation_kl is about 0. Deleting it changes nothing, so there is no damage for a description to recover. The predict test alone would have scored its (correct) description well. toy.judge() is a scripted judge for the toy. On a real model, pass any circuitcheck LLM, for example make_llm("anthropic") (Claude Haiku 5.5, with a reply cache) or make_llm("openai", "gpt-5-mini").

lens: is a neuron a steering vector you can read?

Returning to the Neuron Basis for Interpretability reads a SwiGLU neuron as a context-gated steering vector. When it fires at a, it adds a × w to the residual stream, where w is its column of the down projection. The gate g · x decides whether it fires, and the sign of u · x decides which way: along +w or along -w. So each pole is a fixed direction that can be read from the weights alone, with a lens. The applications post uses those reads to find and steer neurons without labels. circuitcheck’s lens check tests that reading. Does the lens read of ±w predict what adding c × w actually does to the next-token distribution, better than random neurons of the same layer pushed at the same write norm? NeuronLensBackend provides the neuron version of each piece:
neurons
  • The switch L0/n0+ writes the Austin direction, so both lenses read A, and so does its steering.
  • The relay source L0/n2+ writes a direction the unembedding cannot see. Its logit lens reads nothing and is flagged lens misses (logit). Its Jacobian lens follows the write through L1/N7 and reads A, which is what steering with it does. This is the case the Jacobian lens is for: later layers transform what a neuron writes.
  • The switch’s negative pole L0/n0- reads fine as a direction, but it is flagged gate closed: on these contexts the neuron never fires with that sign, so the model never pushes along -w.
The Jacobian lens uses neuronkit’s readout.jacobian_direction (a finite difference at the last token of each context) when the installed neuronkit has it, and an exact Jacobian-vector product otherwise. The two agree, and a test checks it.
A SwiGLU neuron is quadratic at zero (silu(g) × u), so its Jacobian vanishes where it is silent. A Jacobian lens only sees through a later neuron whose gate is open on the contexts. Pick contexts like the ones you care about.

diff: which neurons did fine-tuning change?

Fine-tuning updates the same weights, so neuron L12/N345 exists before and after and can be compared directly. diff_neurons runs the same prompts through both models and gives every neuron one number per prompt. By default that number is its tail rate: the share of tokens where it fires beyond the before model’s p99 or below its p1. The thresholds come from the before model and are used for both models, so a change in rate is a change in behaviour on a fixed scale. With stat="mean", the number is the mean activation instead. The numbers then go through circuitcheck’s diff: gained, lost, up and down statuses, the paired swap null with a Benjamini-Hochberg correction, bootstrap intervals, the split-half check and, with control=, the control-run contrast.
neurons
There is no transcoder caveat here, because no dictionary was trained on the base model. The report keeps two others: the thresholds come from the model before training, and a neuron that changed rate may also have changed meaning. Describe and validate gained neurons before calling them findings.

On a real model

The neuron indices below are placeholders: pick yours from a probe, a graph, or a diff.
gpu
The same from the command line:
gpu
Controls come from the layers of the neurons you test (pass layers= to NeuronBackend to change that). Every neuron of those layers is a candidate, so a 0.5B model gives about 5,000 candidates per layer and position.

How it relates to neuronkit

neuronkit does the neuron measurements: finding the MLP sites of any dense or mixture-of-experts Hugging Face model, capturing and editing activations with plain PyTorch hooks, per-neuron percentiles, subcircuit traces and description scores. circuitcheck adds what it adds to circuit-tracer: matched controls with printed verdict rules, a statistically checked diff, and trust scores reported next to every label. The two share code instead of copying it. neuronkit’s judge steps use circuitcheck’s excerpt format and prompts, and circuitcheck imports neuronkit only inside circuitcheck.neurons, so the base install stays light.