Validating Mechanistic Interpretations: An Axiomatic Approach

Nils Palumbo, Ravi Mangal, Zifan Wang, Saranya Vijayakumar, Corina S. Păsăreanu, Somesh Jha · DOI

Abstract

Mechanistic interpretability aims to reverse engineer the computation performed by a neural network in terms of its internal components. Although there is a growing body of research on mechanistic interpretation of neural networks, the notion of a mechanistic interpretation itself is often ad-hoc. Inspired by the notion of abstract interpretation from the program analysis literature that aims to develop approximate semantics for programs, we give a set of axioms that formally characterize a mechanistic interpretation as a description that approximately captures the semantics of the neural network under analysis in a compositional manner. We demonstrate the applicability of these axioms for validating mechanistic interpretations on an existing, well-known interpretability study as well as on a new case study involving a Transformer-based model trained to solve the well-known 2-SAT problem.

Introduction

Mechanistic interpretability (MI) seeks to explain neural network behavior by identifying "circuits"—subgraphs of neurons and weights that perform specific logical tasks. However, current MI research often relies on "vibes-based" storytelling, where researchers identify patterns and use activation patching to create a plausible narrative without a formal standard for completeness or faithfulness. Crucially, existing methods often overlook compositionality, failing to account for how small errors in one layer can compound as data flows through the network. This paper addresses these gaps by introducing a rigorous axiomatic framework for validating mechanistic interpretations.

An Axiomatic Framework for Validation

Drawing inspiration from Abstract Interpretation in program analysis, we propose four core axioms to define an $\epsilon$-accurate mechanistic interpretation. By using Abstraction ($\alpha$) and Concretization ($\gamma$) functions to bridge the gap between high-dimensional neural activations and human-interpretable symbols, we can mathematically compare a black-box model to a white-box "abstract program."

  1. Prefix Equivalence: The state of the interpretation after $i$ steps must match the state of the neural network after $i$ layers.
  2. Component Equivalence: A single step in the interpretation must behave like the corresponding single layer in the network.
  3. Prefix Replaceability: Replacing the first $i$ layers of the network with the interpretation should preserve the final output.
  4. Component Replaceability: Swapping a specific layer for its interpreted version should not significantly alter the output.

These axioms, particularly the "Prefix" variants, are essential for identifying compounding errors that isolated component validation might miss.

Case Study: The 2-SAT Transformer

We applied this framework to a Transformer-based model trained to solve the 2-Satisfiability (2-SAT) problem. Our axiomatic analysis revealed that the model does not employ a complex graph algorithm. Instead, it functions as a two-stage system: a parser (Block 1) that stores clauses in specific token positions, and an evaluator (Block 2) that performs an exhaustive evaluation of variable assignments.

Sparsity in the 2-SAT model: Only a small subset of hidden neurons contribute significantly to the final SAT logit.

A key finding was the extreme sparsity of the decision-making process. Only 34 out of 512 hidden neurons in the MLP were identified as "evaluating neurons" responsible for the final SAT/UNSAT decision. Figure 1 illustrates this sparsity, showing that only a few neurons have high output coefficients for the SAT logit.

Average activation of a specific neuron across different logical formula categories, demonstrating its role as a semantic evaluator.

Furthermore, we mapped these neurons to specific logical categories. As shown in Figure 2, individual units (such as unit 10) exhibit distinct activation patterns across different formula categories, confirming their role as semantic evaluators within the abstract program. The interpretation of the parser block achieved a near-perfect prefix equivalence error ($\epsilon$) of approximately 0.0000374.

Re-evaluating Modular Addition

We also re-evaluated the landmark study by Nanda et al. (2023) on "grokking" in modular addition ($a + b \pmod{113}$). While our framework confirmed the "sum-of-angles" trigonometric identity theory, it highlighted that the original study lacked the compositional evidence required by our axioms. We validated the sum-of-angles interpretation with a strong $\epsilon$ of 0.000335, providing the first formal proof of its faithfulness as a compositional representation of the model's logic.

Discussion and Future Work

While this axiomatic approach provides a rigorous foundation for MI, challenges remain. Discretization is a double-edged sword: aggressive discretization can obscure true model behavior, while insufficient discretization leads to overly complex interpretations. Additionally, scaling these methods from "toy" models to Large Language Models (LLMs) presents significant engineering hurdles. Future work may involve using these axioms as a loss function to automatically discover the most faithful human-readable programs that describe a model's internal logic.

Summary updated

BibTeX
@inproceedings{palumbo2025validating,
  author = {Nils Palumbo and Ravi Mangal and Zifan Wang and Saranya Vijayakumar and Corina S. Păsăreanu and Somesh Jha},
  title = {{Validating Mechanistic Interpretations: An Axiomatic Approach}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=qBtomgvLwn},
}
Figure