Skip to content

Validating Mechanistic Interpretability: An Axiomatic ApproachValidating Mechanistic Interpretations: An Axiomatic Approach

arXiv· arXiv:2407.13594· Nils Palumbo, Ravi Mangal, Zifan Wang, Saranya Vijayakumar, Corina S. Pasareanu, Somesh JhaUniversity of Wisconsin-Madison; Colorado State University; Scale AI; Carnegie Mellon UniversityIndexed by this site · 27 days ago· Originally publishedAlignment

Quick read

Interpretability

Based on the paper PDF (AI-generated); refer to the original

The authors propose a set of axioms to formally verify mechanistic explanations, verify them on the 2-SAT and modular addition models, and state that existing explanations lack compositional verification.

Questions
In the field of mechanistic interpretability, the definitions and verification criteria for "mechanistic explanation" are mostly ad hoc, lacking formal verification methods that consider the compositional structure of neural networks.
Methods
Inspired by abstract interpretation in program analysis, the authors propose a set of axioms (prefix/component equivalence and replaceability) to formally verify mechanistic explanations, and apply them to the 2-SAT and modular addition models.
Experiments and results
On the 2-SAT model, the authors state that they validated the explanation that the model parses the formula into a clause representation and then enumerates assignments, with the ϵ values of the components ranging from 0.0000374 to 0.182; on the modular addition model, they validated the explanation of Nanda et al., with ϵ = 0.000335.
Limitations and future work
The authors note that the axioms are a necessary but possibly insufficient set, and apply only to discrete outputs; the experiments cover only two small Transformer models and do not involve large language models.
Experimental setupTwo-layer ReLU decoder-only Transformer (2-SAT model)、Modular addition model (Nanda et al., 2023a) · 2-SAT dataset、Modular Addition dataset · ϵ (error rate)、accuracy
Evaluated models
Two-layer ReLU decoder-only Transformer (2-SAT model)Modular addition model (Nanda et al., 2023a)
Benchmarks
2-SAT datasetModular Addition dataset
Metrics
ϵ (error rate)accuracy
AI summaryThe paper proposes a set of axioms that attempt to formally characterize mechanistic interpretability, that is, approximately describing the computational semantics of a neural network in a compositional manner. Drawing on abstract interpretation from program analysis, the authors apply these axioms to validate an existing interpretability study and a new case of solving the 2-SAT problem with a Transformer.

The paper proposes a set of axioms that attempt to formally characterize mechanistic interpretability, that is, approximately describing the computational semantics of a neural network in a compositional manner. Drawing on abstract interpretation from program analysis, the authors apply these axioms to validate an existing interpretability study and a new case of solving the 2-SAT problem with a Transformer.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors propose a set of axioms to formally verify mechanistic explanations, addressing the problem that existing verification criteria are ad hoc and lack compositionality.

    Core question: In the field of mechanistic interpretability, the definitions and validation standards of "mechanistic explanation" are mostly ad-hoc, lacking formal validation methods that account for the compositional structure of neural networks.

    • Problem scenario: Mechanistic explanation aims to reverse-engineer the computation of a neural network into a human-understandable program (circuit), but the authors point out that current criteria for judging the validity of an explanation are ad-hoc and do not account for the network's layered compositional structure.
    • Existing shortcomings: Existing validation methods (such as causal abstraction and causal scrubbing) mainly focus on input-output behavior or individual components, ignoring validation of the equivalence of intermediate-layer representations and not accounting for the cumulative accumulation of error across components.
    • Core observation: Inspired by abstract interpretation in program analysis, the authors believe that mechanistic explanation should, like abstract semantics, capture the semantics of a neural network in a compositional approximation.
    • Paper contribution: Proposes a set of axioms (Axioms 1-4) to formally validate mechanistic explanations, and validates their applicability on a 2-SAT model and a modular addition model.
  2. What related research exists?

    Related work includes mechanistic explanation, causal abstraction and scrubbing, and input interpretability methods; the authors state that existing work lacks compositional verification.

    Mechanistic explanation and circuit analysis

    • Nanda et al. (2023a)—mechanistic explanation of a modular addition model; the authors state that it provides evidence similar to Axioms 2 and 4, but lacks the compositional validation required by Axioms 1 and 3.
    • Zhong et al. (2023), Quirke & Barez (2024), Chughtai et al. (2023)—reverse-engineering toy models of algorithmic tasks (such as GCD, addition, group operations).
    • Cammarata et al. (2020), Wang et al. (2023), etc.—circuit analysis, validating circuits via activation patching, but the authors point out that these validation standards are ad-hoc.

    Causal abstraction and formal validation

    • Geiger et al. (2021, 2024), Chan et al. (2022)—causal abstraction and causal scrubbing; the authors consider these works complementary to this paper, but point out that they lack direct validation of the equivalence of internal representations (Axioms 1 and 2), and that causal abstraction lacks a concretization function γ, while causal scrubbing lacks an abstraction function α.

    Input interpretability

    • Simonyan et al. (2013), Sundararajan et al. (2017), etc.—gradient- and activation-based attribution methods, which belong to input interpretability and differ from the internal mechanism explanation this paper focuses on.

    Positioning: The authors state that this paper is complementary to works such as causal abstraction, but emphasize that this paper's axioms explicitly require validating the equivalence of intermediate representations and the replaceability of components, and account for the compositional accumulation of error.

  3. How does the paper address this problem?

    The authors propose four axioms (prefix/component equivalence and replaceability) to formally verify mechanistic explanations, and map abstract and concrete representations via α/γ functions.

    Overall approach: Treat the neural network as a purely functional program (λT) and the mechanistic explanation as a human-understandable program (λH), establish a mapping between the components of the two via an abstraction function α and a concretization function γ, and propose four axioms to verify the validity of the explanation.

    Problem formalization and axiom definitions

    • Definition of mechanistic explanation: Given a model t and its decomposition dt, a mechanistic explanation h is a program in λH with a decomposition dh of the same length, satisfying Axioms 1-4.
    • α and γ functions: α maps concrete activations to abstract features, and γ maps abstract features back to concrete representations; the authors note that these functions are inspired by abstract interpretation theory.
    • Four axioms:
      1. ϵ-Prefix Equivalence: prefix equivalence, requiring that the outputs of the abstract and concrete models at prefixes of the same length (after α mapping) agree with probability 1-ϵ.
      2. ϵ-Component Equivalence: component equivalence, requiring that the error introduced by a single component does not exceed ϵ.
      3. ϵ-Prefix Replaceability: prefix replaceability, requiring that after replacing the concrete prefix with the abstract prefix, the model output remains unchanged with probability 1-ϵ.
      4. ϵ-Component Replaceability: component replaceability, requiring that after replacing a single component, the output remains unchanged with probability 1-ϵ.

    Verification method

    • Statistical testing: Test the axioms by estimating the proportion of violations of the equations on the test set, using the Clopper-Pearson method to compute confidence intervals.
    • Compositionality: The authors emphasize that Axioms 1 and 3 (prefix axioms) cannot be derived from Axioms 2 and 4 (component axioms), because errors accumulate and must be verified explicitly.

    Case study applications

    • 2-SAT model: Decompose the model into two Transformer blocks, the first block as a parser and the second block as an evaluator. Use decision trees to learn neuron explanations, and define α/γ functions to verify the axioms.
    • Modular addition model: Verify the explanation of Nanda et al. (2023a), use linear mappings to learn α/γ, and apply discretization (rounding or equivalence classes) to handle continuous values.
  4. What experiments did the paper conduct?

    The experiments validate the axioms on a 2-SAT model and a modular addition model; the 2-SAT model has an accuracy of 99.76%, and the ϵ values of the components range from 0.0000374 to 0.182.

    Experimental Setup

    • Models under test:
      • 2-SAT model: a two-layer ReLU decoder Transformer, d=128, 1 attention head in the first layer, 4 heads in the second layer, 512 MLP hidden units, trained on a 2-SAT dataset with 10 clauses and 5 variables, test accuracy 99.76%.
      • Modular addition model: a single-layer Transformer block, P=113 (Nanda et al., 2023a).
    • Datasets:
      • 2-SAT: 10^6 SAT and 10^6 UNSAT instances (60% training, 40% testing); 10^5 SAT and 10^5 UNSAT for analysis.
      • Modular addition: uses the original training/test split of Nanda et al. (2023a).
    • Metric: ϵ value (error rate), reporting the upper bound of the one-sided 95% Clopper-Pearson confidence interval.
    • Baseline/comparison: the interpretation of the modular addition model by Nanda et al. (2023a).

    Main Results

    2-SAT model axiom verification results (according to Table 1 and the main text):

    Swipe horizontally to read the table

    ComponentAxiom 1 (prefix equivalence)Axiom 2 (component equivalence)Axiom 3 (prefix replaceability)Axiom 4 (component replaceability)
    Component 1 (first block)0.00003740.00003740.04180.0418
    Component 2 (second block hidden layer, decision tree)0.1820.1820.01280.0128
    Component 2 (second block hidden layer, disjunction-only)0.3090.3090.002900.00290
    Component 3 (output layer)0.0128 (decision tree) / 0.00290 (disjunction)0.00433same as leftsame as left
    • The authors state that the decision tree interpretation is better than the disjunction-only interpretation on prefix equivalence for component 2 (0.182 vs. 0.309), but disjunction-only is better on replaceability (0.00290 vs. 0.0128).
    • Removing the γ2 amplification step (setting activation to 2) causes the replaceability ϵ of component 2 to rise to 0.249 (decision tree) and 0.135 (disjunction-only).

    Modular addition model verification results:

    • With strong discretization (keeping 3 decimal places or equivalence classes), ϵ=0.000335 (perfect match).
    • With simple discretization (keeping 1 decimal place), ϵ=1 for Axioms 1 and 2 (complete failure), which the authors state indicates that the model behavior is not fully captured.

    Other Analyses

    • Synthetic error injection experiment (Table 1): after injecting 1% random errors into the first component, the component axioms (Axioms 2,4) remain unchanged on subsequent components, but the ϵ values of the prefix axioms (Axioms 1,3) rise (e.g., prefix equivalence for component 2 rises from 0.182 to 0.212); the authors state that this demonstrates that the prefix axioms can capture error accumulation.
    • Decision tree complexity analysis (Figure 14): limiting the decision tree to 4 leaf nodes versus no size limit gives similar F1 scores; the authors state that a simple decision tree is already sufficient to predict neuron behavior.
  5. What are some points that can be further explored?

    The authors point out that the axioms are a necessary but possibly insufficient set, and apply only to discrete outputs; the experiments cover only two small models.

    Limitations and future directions pointed out by the authors

    • Adequacy of the axioms: The authors state that these axioms are a "minimal necessary set", but "may be insufficient to characterize mechanistic explanation in all cases" (Section 3).
    • Future work: The authors plan in future work to consider analyzing models trained on other problems (Section 3).
    • Axioms 5 and 6: The authors propose stronger forms of the axioms (Strong/Weak Mechanistic Derivability), but point out that these requirements are difficult to establish in practice; this paper does not consider them and treats them as future goals (Appendix B).
    • Parallel intervention: The authors propose Axiom 11 to handle parallel intervention, but point out that its current form cannot be effectively evaluated, and leave the final formalization to future work (Appendix B.1.1).

    Scope of experimental coverage

    • Models tested: Only two small Transformer models are covered (a two-layer 2-SAT model and a single-layer modular addition model); large language models or vision models are not involved.
    • Output type: The axioms require outputs to be discrete values (after applying argmax or top-k); continuous outputs are not handled.
    • Components analyzed: The 2-SAT model analysis focuses on the components that affect the final prediction and does not analyze behaviors that do not affect the prediction.
    • Explanation types: For the second block of the 2-SAT model, only two neuron explanations, decision tree and disjunction-only, were tested; other Boolean function forms were not explored.
  6. Summarize the main content of the paper

    The authors propose a set of axioms to formally verify mechanistic explanations, verify them on the 2-SAT and modular addition models, and state that existing methods lack compositional verification.

    This paper proposes a set of axioms (Axioms 1-4) to formally define and verify mechanistic explanations, addressing the problem that verification criteria in this field are ad hoc and lack consideration of compositional structure. Inspired by abstract interpretation in program analysis, the authors treat the neural network as a concrete program and the mechanistic explanation as an abstract program, mapping intermediate representations via α/γ functions, and require the explanation to satisfy prefix equivalence, component equivalence, prefix replaceability, and component replaceability.

    On the 2-SAT model (a two-layer Transformer, 99.76% accuracy), the authors reverse-engineer that the model first parses the formula into a clause representation (first block), then evaluates satisfiability by enumerating variable assignments (second block). Verification shows that the ϵ values of the components range from 0.0000374 to 0.182, among which the decision-tree explanation outperforms the disjunction-only explanation on prefix equivalence (0.182 vs 0.309), but the latter is better on replaceability (0.00290 vs 0.0128). On the modular addition model, the authors verify the explanation of Nanda et al.; under strong discretization ϵ=0.000335, but simple discretization leads to ϵ=1, indicating that the choice of discretization is crucial for verifying internal behavior.

    The authors state that, compared with existing methods such as causal abstraction, the axioms in this paper explicitly require verifying the equivalence of intermediate representations and can capture error accumulation. The limitation is that the axioms are necessary rather than sufficient conditions, and currently apply only to small models with discrete outputs.

Read originalarxiv.org