Inferensys

Glossary

Mechanistic Interpretability

The field of reverse-engineering a neural network's learned algorithms and internal computations from its weights and activations into human-understandable components.
Developer reviewing semantic search engine results on laptop, relevance scores visible, technical search demo.
REVERSE ENGINEERING NEURAL NETWORKS

What is Mechanistic Interpretability?

Mechanistic interpretability is the field of reverse-engineering the internal computations and learned algorithms of a neural network into human-understandable components.

Mechanistic interpretability is the discipline of reverse-engineering a neural network's learned algorithms from its weights and activations into human-understandable components. Unlike feature attribution methods that explain which inputs mattered, mechanistic interpretability seeks to understand the how—identifying the specific circuits, subgraphs of connected neurons and attention heads, that implement precise mathematical functions. The goal is to decompose a black-box model into a faithful, causal description of its internal machinery.

The methodology relies on causal interventions such as activation patching and path patching to isolate the function of specific model components. Researchers hypothesize a circuit, then perform causal scrubbing to verify that the proposed subgraph is both necessary and sufficient for a behavior. This field treats models as computational artifacts to be decompiled, aiming to guarantee safety by verifying that an AI system's internal reasoning aligns with its intended purpose before deployment.

FOUNDATIONAL TECHNIQUES

Core Concepts in Mechanistic Interpretability

The essential building blocks for reverse-engineering neural networks into human-understandable algorithms. These concepts form the toolkit for isolating, analyzing, and validating the internal computations of AI models.

01

Circuits

Sparse, interpretable subgraphs of a neural network consisting of connected attention heads and MLP neurons that implement a specific, human-understandable algorithm. A circuit is the minimal set of model components that are necessary and sufficient for a particular behavior.

  • Example: The "induction circuit" in transformers copies patterns from earlier in a sequence
  • Key property: Circuits are discovered through causal interventions, not just correlation
  • Goal: Decompose a black-box model into a collection of verified, composable algorithms
02

Superposition

A hypothesized phenomenon where a neural network represents more independent features than it has dimensions in a given layer, compressing sparse features into a lower-dimensional space. This explains why individual neurons often appear polysemantic.

  • Mechanism: Features are stored as almost-orthogonal vectors in a compressed space
  • Consequence: A single neuron can participate in representing dozens of unrelated concepts
  • Resolution: Sparse autoencoders are used to decompress these superimposed features into interpretable, monosemantic directions
03

Activation Patching

A causal intervention technique that replaces a model's internal activation at a specific layer and position with a value from a corrupted or alternative forward pass to isolate its function. This is the primary experimental tool for circuit discovery.

  • Process: Run the model on a clean input, then patch in activations from a corrupted run
  • Purpose: Determine if a specific component is causally necessary for a behavior
  • Variants: Includes path patching, which isolates specific computational paths between components by freezing all other routes
04

Sparse Autoencoders

An unsupervised architecture trained to decompose a model's dense, polysemantic activations into a sparse set of interpretable, monosemantic features. This is the leading approach for resolving superposition.

  • Architecture: Encoder maps activations to a higher-dimensional sparse latent space; decoder reconstructs the original activation
  • Sparsity constraint: An L1 penalty on the latent activations forces most features to be zero
  • Result: Each active latent dimension corresponds to a single human-interpretable concept, enabling dictionary learning for neural networks
05

Causal Scrubbing

A systematic evaluation methodology that tests a hypothesized circuit by replacing all activations outside the circuit with corrupted values and verifying the model's performance is preserved. This is the gold standard for circuit validation.

  • Hypothesis testing: If the circuit is correct, scrubbing everything else should not degrade performance
  • Process: Identify a candidate circuit, corrupt all other activations, measure output fidelity
  • Rigor: Unlike ablation, scrubbing preserves the circuit's internal structure while destroying alternative pathways
06

Logit Lens & Tuned Lens

Techniques that decode intermediate residual stream activations into next-token predictions by applying the unembedding matrix at each layer. This reveals how the model's predictions evolve through the forward pass.

  • Logit Lens: Directly applies the final unembedding matrix to each layer's residual stream
  • Tuned Lens: Learns an affine transformation for each layer to produce more accurate decoded predictions
  • Insight: Reveals the iterative refinement process—early layers propose candidates, later layers disambiguate and confirm
MECHANISTIC INTERPRETABILITY

Frequently Asked Questions

Clear, technically precise answers to the most common questions about reverse-engineering the internal algorithms and learned computations within neural network weights.

Mechanistic interpretability is the field of reverse-engineering a neural network's learned algorithms and internal computations from its weights and activations into human-understandable components. Unlike traditional feature attribution methods like SHAP or LIME, which explain which inputs were important for a specific prediction, mechanistic interpretability seeks to understand how the model computes that prediction internally. It treats the model as a scientific object of study, aiming to decompose it into circuits—sparse, interpretable subgraphs of connected attention heads and MLP neurons that implement specific algorithms. This approach moves beyond input-output correlations to identify causal mechanisms, such as induction heads that perform in-context copying or knowledge neurons that store factual associations. The goal is a complete, causal understanding of model behavior, enabling robust auditing, safety guarantees, and surgical model editing.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.