> ## Documentation Index
> Fetch the complete documentation index at: https://circuitcheck.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# circuitcheck.diff

> Graph summaries, loaders and the diff.

## `diff_graphs`

```python signature theme={null}
diff_graphs(before, after, *, settings=None, control=None, replication=None,
            fvu_before=None, fvu_after=None, labels=None, before_name="before", after_name="after") -> DiffReport
```

**before** `Sequence[GraphSummary]` *required*

Graphs of the model before training.

**after** `Sequence[GraphSummary]` *required*

Graphs after training. With the same length as `before`, graphs are paired by index (same prompts). Otherwise the
test is unpaired.

**settings** `Settings`

See the [guide](https://circuitcheck.mintlify.site/guides/diff.md#settings).

**control** `tuple[before, after]`

Graphs of a run that did not learn the behaviour.

**replication** `tuple[before, after]`

Graphs of another seed.

**fvu\_before** `Sequence[float]`

Per-layer reconstruction error before training.

**fvu\_after** `Sequence[float]`

Per-layer reconstruction error after training.

**labels** `Mapping[str, str]`

Feature labels to show next to units.

**DiffReport** `object`

**fields**

**summary** `Summary`

Counts, Jaccard overlap, `change_score`, `change_p`, `min_p`, split-half overlap and chance, control and replication counts.

**top** `list[UnitChange]`

Top features by increase in influence.

**gained / lost / down** `list[UnitChange]`

Up to 50 each.

**edges** `list[EdgeChange]`

Edges among the top features.

**validity** `Validity`

Scores before and after, FVU, `warnings`, `ok`.

**caveats** `list[str]`

Always includes the base-model transcoder caveat.

`UnitChange` fields: `unit`, `before`, `after`, `delta`, `present_before`, `present_after`, `status`
(`gained` | `lost` | `up` | `down` | `stable`), `sign_agreement`, `ci_low`, `ci_high`, `p_null`, `q_null`,
`control_delta`, `specific`, `replicated`, `label`.

## `GraphSummary`

**name** `str` *required*

**features** `dict[str, float]` *required*

`"layer:feature"` to influence, summed over positions.

**edges** `dict[tuple[str, str], float]`

(source, target) to summed edge weight.

**replacement\_score, completeness\_score, error\_influence** `float | None`

**model, prompt, meta** `optional`

## Loaders

| Function | Input |
| - | - |
| `from_circuit_tracer(graph, name, node_threshold=0.8, edge_threshold=0.98, max_edges=5000)` | a `circuit_tracer.graph.Graph` or a `.pt` path (needs circuit-tracer) |
| `from_neuronpedia(data, name=None)` | a Neuronpedia graph JSON (dict or path); per-node influence is recovered from the cumulative scores |
| `from_feature_lists(name, features, influence, edges)` | plain lists in circuit-tracer's node order |
| `save_summaries(path, groups)` / `load_summaries(path)` | `{"group": [GraphSummary, ...]}` as JSON, gzipped if the path ends in `.gz` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.