Mechanistic interpretability of LLMs
Testing whether findings on open models transfer to closed, API-only ones. Training data attribution and data-based unlearning for Llama, with Meta AI Safety.
Zachariah Carmichael, Ph.D.
I’m a Staff Research Scientist at Meta. I work on mechanistic interpretability and attribution for LLMs and for ranking models with over 100B parameters, on evaluations of LLM agents that hold up under scrutiny, and on the infrastructure that runs both on production models. I also lead maintenance of PyTorch Captum. My Ph.D. is from the University of Notre Dame, on models that are interpretable by design and on the ways post hoc explanations fail.
Testing whether findings on open models transfer to closed, API-only ones. Training data attribution and data-based unlearning for Llama, with Meta AI Safety.
Backtests of LLM agents are quietly inflated when live tools can reach the answer: the later fix, the incident report, the benchmark’s own key. I built a runtime that replays an agent against the world as it was at a past moment and fails closed on anything it can’t date. It exposed a benchmark score inflated more than 2×, and caught a context change that looked like a win but was a 2-point loss, before it shipped.
Meta’s internal extension of Captum: feature, layer, and neuron attribution for ranking models with over 100B parameters, on up to hundreds of GPU nodes. It is the attribution tool across Meta’s recommendation system stack. Using it to root-cause production incidents saved about 6.3 engineer-years in 2025, and editing out harmful neurons it found improved a production ads model’s log-loss by 0.7%. I also lead maintenance of open-source PyTorch Captum.
Explanations for Meta’s Diff Risk Score, which predicts which code changes will cause incidents: highlighting of the risky code on about 20,000 changes a day, and an agentic risk model that explains its reasoning, beats the fine-tuned production model, and is now deployed company-wide.
An autonomous research campaign halved the parameters of a 100B+-parameter ads ranking model with no measurable quality loss; the smaller model is now in production. I also built an agentic optimizer, a sandboxed coding agent that searches agent-harness changes, which beat GEPA on 15 of 20 LLM capability and agentic benchmarks.
Learned surrogates for expensive simulation: a 3D CNN that stands in for a computational fluid dynamics solver at 2,000× the speed, used with reinforcement learning to cut data-center emissions; and SIRNet, a hybrid neural and compartmental model of COVID-19 spread. Earlier, deep learning to detect Alzheimer’s disease from low-cost EEG in an IRB-approved study.
ICML 2026 Mechanistic Interpretability Workshop · Spotlight
Most frontier models are closed, so interpretability research runs on open models and hopes the findings carry over. We measured whether they do, across eleven Llama, Qwen, GPT, and Gemini models. Models that agree on the answer often disagree on why, and attention, the easiest internal signal to read, predicts almost none of what drives the output.
Llama-3.1-8B vs. GPT-4oEleven models on BoolQ answer: true false one dot per deleted sentence median r² across model pairs
One BoolQ promptInside two open modelsillustrative values
Q Is California still part of the United States?
Llama-3.1-8B True GPT-4o True
Llama-3.1-8B GPT-4o bar = change in log-odds when the sentence is deleted
Δℓ = ‖Δz‖ ‖v‖ cos(Δz, v)
Same answer. Most frontier models expose only log-probabilities, so interpretability research runs on open models and hopes the findings transfer. Log-odds are an API-visible readout of the representation. On BoolQ, Llama-3.1-8B and GPT-4o largely agree (r² = 0.66), but mostly because they agree on the answer: within each class, r² falls to 0.42 and 0.35.
Different reasons. Delete one sentence at a time and measure how far the log-odds move: that is each sentence’s attribution, and it needs only API access. The same two models agree much less here (r² = 0.36). Models that agree on what the answer is often disagree on why.
Where they split. Across 11 Llama, Qwen, GPT, and Gemini models, prediction fidelity is 0.72 but word-level attribution fidelity is 0.17. Inside open models, a deletion moves the representation by a similar amount in each model, but in a different direction relative to the readout. Attention agrees almost perfectly across models and predicts almost none of the causal effect.
ECCV 2024
Prototype networks classify by similarity to learned prototypes, but the prototypes live in a latent space you can only glimpse through stand-ins. ProtoFlow builds the network on an invertible flow and learns each prototype as a distribution, so you can see a prototype exactly and sample new examples from it.
Input space𝒳
Latent space𝒵
Prototypes as points. A standard prototype network learns each prototype as a point in latent space. To show what a prototype looks like, it substitutes the nearest training example, so the picture is a stand-in for what the model learned.
Prototypes as distributions. ProtoFlow replaces the encoder with an invertible normalizing flow f and learns each prototype as a Gaussian in latent space. An input x is classified by how likely f(x) is under each class’s prototypes.
Exact and generative. Because f is invertible, prototypes map back to input space exactly: f⁻¹(μ) is the prototype, not an approximation, and each Gaussian becomes a region of input space. Sampling from a prototype and inverting generates new examples.
WACV 2024 · with MERL
“This looks like that” explanations draw a box around the part of the image a prototype matched. For almost every backbone in use, that box is an artifact of upsampling: the matched feature depends on nearly the whole image. PixPNet makes the box true.
Input imageprototype match
Backbonereceptive field of one map cell
What it shows. Prototype part networks explain a match by upsampling a coarse similarity map to the size of the image and boxing the top 5%. The box says the prototype matched the bird’s head.
What it computes. Each cell of that map, though, depends on a receptive field that grows with every layer. In the backbones these models use, it covers most or all of the image. The box comes from interpolation, not from what the network used.
PixPNet. PixPNet constrains the backbone’s receptive field and maps each similarity score to the exact pixels it depends on, so the highlighted region is the region the model used.
AAAI 2023 · Oral
If a model can tell when it is being explained, it can lie to the explainer. We show how to catch a model doing that and how to recover the explanation it was trying to hide.
Feature space probe biased answer innocuous answer biased answer ×rejected
Explanation of xfeature importance
Probing. LIME and SHAP explain a prediction by querying the model on perturbed copies of the input x and fitting a simple model to its answers. Many of those perturbations land far from any real data.
Fooled. A scaffolded model exploits this. It recognizes off-distribution queries and answers them with an innocuous model, while real inputs still get the biased one. The explanation says the sensitive attribute doesn’t matter.
Unfooled. A conditional anomaly detector scores each query against the data. CAD-Detect flags a model whose behavior changes off-distribution; CAD-Defend drops those queries and resamples in-distribution ones, and the hidden attribute reappears.
NeurIPS 2023 XAI Workshop
Exact ground-truth attributions for 2,000 models, and every popular explainer misattributes as interactions grow.
AutoML 2023 · Oral
Searching for architectures on the accuracy–interpretability Pareto front, scaled to 100+ HPC nodes at LLNL.
DATE 2019
An FPGA accelerator built on posit arithmetic, from my M.S. work on low-precision deep learning. Still my most-cited paper.