SAEs Can Improve Unlearning: Dynamic Sparse Autoencoder Guardrails for Precision Unlearning in LLMs

Aashiq Muhamed, Jacopo Bonato, Mona T. Diab, Virginia Smith

TL;DR

This paper introduces Dynamic SAE Guardrails (DSG), a novel method that uses Sparse Autoencoders (SAEs) for precise and efficient machine unlearning in Large Language Models (LLMs). DSG significantly outperforms existing methods by dynamically identifying and intervening on specific model features, offering better control over knowledge removal while preserving general capabilities.

What Problem Does This Paper Address?

Machine unlearning aims to remove specific knowledge from trained LLMs, crucial for safety, privacy, and model maintenance. However, current gradient-based unlearning methods are plagued by high computational costs, instability, poor performance with sequential unlearning requests, vulnerability to attacks, low data efficiency, and a lack of interpretability. While Sparse Autoencoders (SAEs) offer a promising avenue for more targeted, activation-based unlearning, previous attempts have underperformed gradient-based methods due to imprecise interventions. This paper addresses the challenge of achieving effective, efficient, and interpretable unlearning by leveraging SAEs in a novel, dynamic way.

Methods

The core innovation is Dynamic SAE Guardrails (DSG). DSG combines several key components:

  • Principled Feature Selection: It uses Fisher Information (FI) to identify SAE features that are causally linked to the "forget" data. This is based on the insight that features with high squared activations on the forget set are likely responsible for encoding that knowledge.
  • Dynamic Classifier: Instead of a static intervention, DSG uses an input-dependent classifier. This classifier determines if a given input sequence is "forget-relevant" based on the activation patterns of the selected features.
  • Targeted Clamping: Intervention (clamping of feature activations) is only applied when the input is classified as forget-relevant. This conditional approach minimizes side effects on general model capabilities.
  • Activation Statistics: DSG uses a percentage-based statistic of "forget-set activated tokens" within a sequence to make its classification decision, which is shown to be more robust than raw counts.

Datasets

The paper evaluates DSG on several datasets:

  • WMDP (World Model Data Platform): Used for benchmarking hazardous knowledge unlearning, specifically WMDP-Bio (biosecurity) and WMDP-Cyber (cybersecurity).
  • WikiText: Used as the "retain" dataset for WMDP experiments.
  • MMLU (Massive Multitask Language Understanding): Used to evaluate general model utility and fluency.
  • NEWS and BOOKS corpora: Used for the MUSE benchmark, which features significant domain overlap between forget and retain sets.

Key Insights and Ideas

  • Dynamic Intervention is Key: The paper demonstrates that static, universal interventions on SAE features are suboptimal. Dynamic, input-dependent interventions are crucial for balancing unlearning effectiveness with utility preservation.
  • Fisher Information as a Proxy for Causal Influence: The work provides a theoretical link between Fisher Information of SAE features and their causal influence in mediating information flow from data to model outputs. This justifies using squared activations as a principled way to select features for unlearning.
  • SAEs Can Outperform Gradient-Based Methods: Contrary to prior findings, this work shows that well-designed SAE-based unlearning (DSG) can surpass gradient-based methods in terms of effectiveness, efficiency, and interpretability.
  • Interpretability Enables Zero-Shot Unlearning: DSG's reliance on interpretable SAE features allows for effective unlearning even without domain-specific data, by querying for concepts and identifying relevant features.

Key Results

  • Superior Forget-Utility Trade-off: DSG consistently outperforms leading gradient-based and static SAE methods on benchmarks like WMDP and MUSE, achieving significantly better unlearning (lower accuracy on forget data) while maintaining high general model utility (MMLU accuracy). For example, on WMDP-Bio, DSG reduced accuracy to 29.64% compared to RMU at 50.00%, while maintaining 99.34% MMLU accuracy.
  • Enhanced Efficiency and Stability: DSG offers improved computational efficiency and hyperparameter stability compared to gradient-based methods, requiring only forward passes for intervention.
  • Robustness to Relearning Attacks: DSG demonstrates superior resistance to relearning attacks, especially when integrated during training (Train-time DSG).
  • Data Efficiency: DSG performs well even with limited training data, maintaining effectiveness across various dataset sizes.
  • Zero-Shot Unlearning: DSG can achieve effective unlearning without domain-specific data by leveraging interpretable SAE features identified through concept queries.

Limitations and Future Work

  • SAE Quality Dependency: The effectiveness of DSG relies on the quality and interpretability of the learned SAE features. The paper notes that while Gemma-2-2B has available high-quality SAEs, extending DSG to other models and architectures might require further investigation.
  • Scalability of SAEs: The computational cost of training SAEs can be demanding, though their inference-time efficiency is a benefit. Future work could explore how performance scales with SAE width and training configurations.
  • Approximate Unlearning: Like all approximate unlearning methods, DSG does not guarantee complete removal of targeted knowledge; it reduces the likelihood of generating unwanted outputs.
  • Responsible Deployment: The authors acknowledge the dual-use nature of unlearning technology and emphasize the need for responsible development and deployment.

Future work could investigate extending DSG to larger models and diverse architectural families, as well as exploring its performance scaling with SAE width and training configurations.

Summary updated

BibTeX
@inproceedings{muhamed2025saes,
  author = {Aashiq Muhamed and Jacopo Bonato and Mona T. Diab and Virginia Smith},
  title = {{SAEs Can Improve Unlearning: Dynamic Sparse Autoencoder Guardrails for Precision Unlearning in LLMs}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=kaPAalWAp3},
}
Figure