Mechanistic Unlearning: Robust Knowledge Unlearning and Editing via Mechanistic Localization

Phillip Huang Guo, Aaquib Syed, Abhay Sheshadri, Aidan Ewart, Gintare Karolina Dziugaite

One of the most persistent challenges in AI safety and alignment is determining how to make a Large Language Model (LLM) "forget" specific, undesirable information without degrading its general capabilities. This paper introduces Mechanistic Unlearning, a novel approach that leverages mechanistic interpretability to identify and edit the specific internal "circuits" responsible for storing facts.

By targeting the Fact Lookup (FLU) stage rather than just the components that affect the final output, the authors achieve unlearning that is significantly more robust against adversarial attacks, alternative prompting, and relearning attempts.

The Problem: Output-Tracing is Brittle

Current methods for "editing" or "unlearning" knowledge in LLMs are surprisingly fragile. You might successfully train a model to stop outputting "Michael Jordan plays basketball," but if you ask it a multiple-choice question or rephrase the prompt, the model often reveals it still retains the underlying fact.

The authors argue this happens because existing techniques, such as Causal Tracing, rely on Output-Tracing (OT). These methods identify components that have a high causal impact on the final output, which often ends up targeting the "extraction" or "formatting" layers of the model. This is essentially putting a mask over the model's mouth: the underlying "latent knowledge" remains intact in earlier layers, making it easy for an adversary to bypass the edit or for the model to "relearn" the fact with minimal data.

The Solution: Mechanistic Localization

The core innovation of this work is Mechanistic Localization. Instead of looking at what changes the output, the authors use mechanistic interpretability tools—like linear probing and path patching—to find the specific MLP layers where a fact is actually "looked up" from the model's weights and injected into the latent stream.

A high-level depiction of mechanistic unlearning, showing the distinction between normal fact lookup and an edited fact lookup targeting specific MLP weights.

The process involves three main steps:

  1. Localization: Identifying the Fact Lookup (FLU) mechanism—the specific layers that enrich the model's internal representations with subject attributes.
  2. Editing: Performing localized fine-tuning, updating only the weights within these targeted FLU components.
  3. Loss Function: Applying a multi-part loss that encourages the model to adopt a new "target" fact (or forget an old one) while penalizing it for losing general language modeling capabilities (measured via the Pile dataset) or forgetting unrelated facts.

Key Insights and Results

The researchers evaluated their approach across several models (Gemma-7B, Gemma-2-9B, and Llama-3-8B) using the Sports Facts dataset, the CounterFact benchmark, and MMLU as a control for general reasoning.

1. Source vs. Mouth

Targeting the "source" (Fact Lookup) is fundamentally more effective than targeting the "mouth" (Output Tracing). If you disrupt the information before it ever enters the model's internal "conversation," it becomes much harder to extract later. By using linear probes, the authors showed that OT methods leave the unwanted fact clearly represented in the model's early layers, whereas Mechanistic Unlearning effectively "erases" the trace of the fact.

2. Closing the MCQ Gap

The paper highlights a massive gap in current benchmarks: many models appear to have "unlearned" a fact on standard completion tasks but fail miserably when tested with Multiple Choice Questions (MCQ). In the Sports-Athlete-Editing task, FLU-localized edits generalized to MCQ formats 40% better than other localization methods, making it the only tested method that consistently closed this gap.

3. Robustness to Relearning

Perhaps the most striking result is the model's resistance to relearning. When the authors attempted to "re-train" the model on the forgotten facts, models edited with standard OT methods recovered up to 63% of the knowledge. In contrast, models edited via FLU localization only recovered about 20%.

Radar chart demonstrating that Fact Lookup (FLU) localization outperforms baselines across multiple metrics, including resistance to relearning and MCQ edit accuracy.

Furthermore, FLU localization maintained higher scores on MMLU compared to non-localized fine-tuning, proving that being "surgical" with edits prevents collateral damage to the model's general intelligence.

Limitations and Future Work

While highly effective, Mechanistic Unlearning currently faces a significant bottleneck: manual effort. Identifying the FLU mechanism for different types of knowledge requires bespoke interpretability work.

Future research directions include:

  • Automation: Developing methods to automatically discover these high-level mechanisms to scale the unlearning process.
  • Beyond Factual Recall: Investigating whether mechanistic unlearning can be applied to more abstract concepts, such as removing a model's ability to write malicious code or express specific biases.
  • Scaling to Larger Models: Adapting localization techniques for the increasingly complex circuits found in 70B+ or 400B+ parameter models.

Summary updated

BibTeX
@inproceedings{guo2025mechanistic,
  author = {Phillip Huang Guo and Aaquib Syed and Abhay Sheshadri and Aidan Ewart and Gintare Karolina Dziugaite},
  title = {{Mechanistic Unlearning: Robust Knowledge Unlearning and Editing via Mechanistic Localization}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=92oBV5HAGl},
}
Figure