Model Unlearning via Sparse Autoencoder Subspace Guided Projections

Xu Wang, Zihao Li, Benyou Wang, Yan Hu, Difan Zou

TL;DR

This paper introduces SSPU, a novel method for selectively removing knowledge from large language models (LLMs) by leveraging interpretable features from Sparse Autoencoders (SAEs). SSPU achieves a better balance between forgetting unwanted information and retaining overall model performance, while also significantly improving robustness against adversarial attacks.

What Problem Does This Paper Address?

Large language models (LLMs) are incredibly powerful due to the vast amount of information they store. However, this also presents a significant challenge: how do we selectively remove specific, potentially harmful or private, information from these models without degrading their overall capabilities? Existing methods for "unlearning" this knowledge often fall short. Some, like gradient-based approaches, lack transparency in how they modify the model, making it hard to verify if the knowledge is truly gone. Others, like SAE-based steering, can be vulnerable to cleverly crafted prompts designed to bypass the unlearning process. The core problem is achieving precise, interpretable, and robust knowledge removal.

Methods

The authors propose SAE-Guided Subspace Projection Unlearning (SSPU), a three-stage framework.

  1. SAE Feature Selection: They first identify which features within a Sparse Autoencoder (SAE) are most and least associated with the knowledge to be forgotten. This is done by analyzing the mean squared activation of SAE features on "forget" and "retain" datasets.
  2. Subspace Construction: Using the selected features, they construct two "subspaces": a "relevant" subspace capturing directions related to the unwanted knowledge and an "irrelevant" subspace for everything else. This is achieved by performing QR decomposition on the decoder weights of the SAE.
  3. SSPU Unlearning: During training, SSPU guides parameter updates. It forces the model's activations for "forget" data into the "irrelevant" subspace while simultaneously constraining parameter updates to stay within the "relevant" subspace. This is achieved by optimizing a combined loss function that includes an unlearning term (pushing activations to the irrelevant subspace), a retention term (preserving original behavior on retained data), and a regularization term (constraining parameter updates).

Datasets

  • Forget Corpora: WMDP-Cyber (used for primary experiments) and WMDP-Bio (used for generalization tests). These are multiple-choice question datasets designed to probe hazardous knowledge.
  • Retain Corpus: WikiText, used to preserve general language capabilities.
  • Utility Benchmarks: MMLU (Comprehensive Knowledge), TruthfulQA (Truthfulness), and GSM8K (Mathematical Reasoning). These are standard benchmarks for evaluating LLM capabilities.

Key Insights and Ideas

  • Interpretable Features as Guides: The core idea is that interpretable features from SAEs can provide a much more targeted and understandable way to guide model unlearning, moving beyond simple gradient manipulation.
  • Subspace Projection for Precision: By defining "relevant" and "irrelevant" subspaces, SSPU can precisely control where model updates are applied, minimizing collateral damage to unrelated knowledge.
  • Robustness Against Adversarial Attacks: The method's focus on parameter updates, guided by interpretable subspaces, makes it inherently more robust to jailbreak prompts compared to inference-time SAE steering.
  • Layer Selection Matters: The authors found that the effectiveness of SAE-based unlearning varies significantly by layer, with earlier layers often being more impactful for feature extraction.

Key Results

  • Improved Forgetting: SSPU reduced harmful knowledge accuracy on the WMDP-Cyber dataset by 3.22% compared to the strongest baseline (RMU).
  • Strong Knowledge Retention: SSPU improved the average utility score across MMLU, TruthfulQA, and GSM8K by 2.88% over RMU, indicating it preserves general capabilities well.
  • Enhanced Adversarial Robustness: SSPU significantly lowered malicious accuracy under jailbreak prompts, achieving up to 13.59% improvement over SAE-steering and 2.83% over RMU.
  • Scalability: SSPU introduces minimal computational and memory overhead, with less than 2% increase in training time and memory cost, making it practical for large LLMs.

Limitations and Future Work

  • SAE Dependency: SSPU relies on the availability of a well-trained SAE. If a suitable SAE is unavailable or difficult to train for a specific domain or model, SSPU's applicability might be limited.
  • Corpus Separability: The approach assumes clear separation between forget and retain corpora, which might not always be straightforward in real-world scenarios.
  • Subspace Dimensionality: The choice of subspace dimensions (K and orthonormal rank) introduces hyperparameters that require empirical tuning for optimal trade-offs.
  • Unrelated Capability Guarantee: While SSPU constrains updates to a "relevant" subspace, it doesn't explicitly guarantee that capabilities outside this subspace remain entirely unaffected.

Future work could explore extending SSPU to multimodal LLMs and investigating its applicability in scenarios with less clearly separable data.

Summary updated

BibTeX
@inproceedings{wang2025model,
  author = {Xu Wang and Zihao Li and Benyou Wang and Yan Hu and Difan Zou},
  title = {{Model Unlearning via Sparse Autoencoder Subspace Guided Projections}},
  booktitle = {MUGen @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=MIlqM98o9I},
}
Figure