Certified Circuits: Stability Guarantees for Mechanistic Circuits

    Alaa Anani1,2, Tobias Lorenz2, Bernt Schiele1, Mario Fritz2,*, Jonas Fischer1,*

    1Max Planck Institute for Informatics2CISPA Helmholtz Center for Information Security* Equal contribution

    ICML 2026

    TL;DRCertified Circuits wraps any circuit discovery algorithm and keeps only the components that provably stay in the circuit when the concept dataset is edited. The resulting circuits are up to 80% smaller and up to 56% more accurate than uncertified baselines.

    Figure 1 of Certified Circuits: Stability Guarantees for Mechanistic Circuits
    Figure 1: Certified circuits are smaller, more accurate, and generalize out of distribution. (a) For the African crocodile class, the certified circuit keeps stable semantic neurons, such as teeth, and abstains from unstable spurious ones, such as a bird, which raises circuit accuracy from 58% to 94%. (b) On in-distribution and shifted (OOD) test data, certified circuits are smaller and more accurate than baseline circuits, for both vision and language.

    Introduction

    Circuits are minimal subnetworks responsible for a specific model behavior, discovered from a concept dataset of example inputs. Existing discovery methods are brittle: swapping a few semantically equivalent examples can change the circuit, and circuits often fail on out-of-distribution data, so it is unclear whether they capture the concept or dataset-specific artifacts. Certified Circuits gives the first provable guarantee against this: for any dataset within r insertions, deletions, or substitutions of the original, the certified circuit stays the same. Components without a stable decision are left out, which makes circuits both smaller and more accurate (Figure 1).

    Method

    Certified Circuits works with any black-box discovery algorithm. We create n random sub-datasets by deleting each concept example with probability p_del, run discovery on each one, and record how often each neuron or edge is selected (Figure 2).

    Figure 2: certified circuit discovery via concept deletion smoothing
    Figure 2: Certified circuit discovery. (1) The inputs are a concept dataset D, the model as a graph G, and a circuit discovery algorithm A. (2) We sample dataset variants by deleting each example with probability p_del, (3) run A on each variant, and (4) aggregate how often each component is included, certifying it in, out, or abstaining (⊘). (5) The certified circuit is provably unchanged by dataset edits within radius r.

    A component whose inclusion probability exceeds a threshold τ is certified in; one whose exclusion probability exceeds τ is certified out; all others are abstained and dropped from the circuit. With confidence 1 − α, certified decisions hold for every dataset within edit distance r = ⌊log(1.5 − τ) / log p_del⌋.

    Experimental Setup

    For vision, we certify top-K relevance circuits on ResNet-101 and ResNet-50 for 100 ImageNet classes, and test them on four out-of-distribution (OOD) datasets: OOD-CV, ImageNet-A, ImageNet-O, and ImageNet-C. For language, we certify EAP-IG circuits on GPT-2 Small for IOI, IOI-Hard, and Greater-Than.

    We report circuit-class accuracy (cACC), the accuracy of the model restricted to the circuit, and circuit size K, the fraction of components kept. All results use n = 1,000 and α = 0.001; the vision radius is r = 1 (p_del = 0.6, τ = 0.95).

    Results

    Circuit Sufficiency and Compactness

    Certified circuits match or exceed the baseline’s peak accuracy on every dataset and task while being smaller. On ImageNet, they reach 95% cACC versus 83%, with 52% fewer components (Table 1).

    Table 1: peak circuit-class accuracy and corresponding circuit size
    Table 1: Certified versus baseline circuits at peak accuracy. Peak circuit-class accuracy (cACC) and the circuit size K at which it is reached, for ResNet-101 on vision datasets and GPT-2 Small on language tasks. Full is the unpruned model. Circuits are discovered on in-distribution (ID) data and evaluated on ID or shifted (OOD) data. Δ is the relative change from baseline to certified, computed on unrounded values.

    Large vision circuits admit competing or spurious features, so accuracy drops as K grows. Certified circuits peak earlier and higher (Figure 3).

    Figure 3: cACC versus circuit size on ImageNet and four OOD datasets
    Figure 3: Circuit accuracy against circuit size. Solid lines show certified circuits and dashed lines the top-K relevance baseline; colors distinguish ResNet-101 and ResNet-50. Circuits are discovered on ImageNet and evaluated on ImageNet (ID) or on four shifted (OOD) datasets.

    On GPT-2 Small, both methods reach 100% cACC in distribution, but certified circuits need 58%, 38%, and 75% fewer edges on IOI, IOI-Hard, and Greater-Than (Figure 4).

    Figure 4: certified and baseline EAP-IG edges on GPT-2 Small
    Figure 4: Edges kept by certified and EAP-IG circuits on GPT-2 Small. Circuit size at peak cACC for each task, on in-distribution (top) and shifted (bottom) prompts. Annotations give the relative edge reduction and the gain in peak cACC of the certified circuit over EAP-IG; r is the best certified radius for each task.

    Feature Visualization of Circuits

    For the digital-watch class, certified-in neurons respond to watch faces and dials. The neurons that certification abstains on, but the baseline keeps, fire on hands, wrists, or spurious patterns. Removing them raises cACC from 78% to 98% with 34% fewer components (Figure 5).

    Figure 5: digital-watch certified-in, abstained, and certified-out neurons
    Figure 5: What certification keeps and removes in the digital-watch circuit. Top-activating image patches of ResNet-101 neurons in each layer, grouped into certified-in neurons, neurons that certification abstains on but the baseline includes, and certified-out neurons.
    More neuron examples from other classes

    Accuracy of the digital watch circuit: 78% with the baseline, 98% certified (+26%), with a 34% smaller circuit.

    Kept by the baseline, dropped by certification. They tend to fire on co-occurring or spurious cues.

    Abstained neurons for the digital watch circuit: top-activating image patches of two neurons per layer, layers 1 to 4.

    Top-activating image patches, two neurons per layer, ResNet-101.

    Out-of-Distribution Generalization

    Circuits discovered on ImageNet transfer to shifted data without rediscovery. Certified circuits reach 93% cACC on OOD-CV (baseline 73%) and 94% on ImageNet-A (baseline 60%), where the full model reaches only 20% and 7%. On OOD language prompts, they use up to 80% fewer edges at equal or higher accuracy (Table 1).

    Structural Stability Under Distribution Shift

    When a circuit is rediscovered on shifted data, certified circuits overlap more with the original ImageNet circuit: their intersection-over-union is generally higher and varies less across classes. ImageNet-O is the exception, with high variance for both methods (Figure 6).

    Figure 6: per-class circuit IoU after rediscovery under distribution shift
    Figure 6: Circuit structure is more stable under distribution shift. Per-class intersection-over-union (IoU) between the circuit discovered on ImageNet and the circuit rediscovered on each shifted dataset, at the size K where the accuracy gap between certified and baseline circuits is largest. Boxes show the distribution over classes.

    Conclusion

    Certified Circuits certifies that a circuit stays unchanged under bounded edits to its concept dataset. Abstaining on unstable components gives circuits that are smaller, at least as accurate, and more reliable under distribution shift.

    Citation

    @inproceedings{anani2026certified,
      title     = {Certified Circuits: Stability Guarantees for Mechanistic Circuits},
      author    = {Anani, Alaa and Lorenz, Tobias and Schiele, Bernt and Fritz, Mario and Fischer, Jonas},
      booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
      series    = {Proceedings of Machine Learning Research},
      volume    = {306},
      pages     = {2650--2676},
      year      = {2026}
    }